mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
Improve store/selectlist labeling (#3014)
This commit is contained in:
parent
5318684e5c
commit
0558631982
@ -83,8 +83,8 @@ namespace BTCPayServer.Controllers.GreenField
|
|||||||
|
|
||||||
var store = new Data.StoreData();
|
var store = new Data.StoreData();
|
||||||
|
|
||||||
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymnetMethodId);
|
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymentMethodId);
|
||||||
ToModel(request, store, defaultPaymnetMethodId);
|
ToModel(request, store, defaultPaymentMethodId);
|
||||||
await _storeRepository.CreateStore(_userManager.GetUserId(User), store);
|
await _storeRepository.CreateStore(_userManager.GetUserId(User), store);
|
||||||
return Ok(FromModel(store));
|
return Ok(FromModel(store));
|
||||||
}
|
}
|
||||||
@ -104,9 +104,9 @@ namespace BTCPayServer.Controllers.GreenField
|
|||||||
return validationResult;
|
return validationResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymnetMethodId);
|
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymentMethodId);
|
||||||
|
|
||||||
ToModel(request, store, defaultPaymnetMethodId);
|
ToModel(request, store, defaultPaymentMethodId);
|
||||||
await _storeRepository.UpdateStore(store);
|
await _storeRepository.UpdateStore(store);
|
||||||
return Ok(FromModel(store));
|
return Ok(FromModel(store));
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ namespace BTCPayServer.Controllers.GreenField
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(request.DefaultPaymentMethod) &&
|
if (!string.IsNullOrEmpty(request.DefaultPaymentMethod) &&
|
||||||
!PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymnetMethodId))
|
!PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymentMethodId))
|
||||||
{
|
{
|
||||||
ModelState.AddModelError(nameof(request.Name), "DefaultPaymentMethod is invalid");
|
ModelState.AddModelError(nameof(request.Name), "DefaultPaymentMethod is invalid");
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ namespace BTCPayServer.Models.InvoicingModels
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DisplayName("Store")]
|
||||||
public SelectList Stores
|
public SelectList Stores
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
|
@ -61,7 +61,9 @@ namespace BTCPayServer.Models.PaymentRequestViewModels
|
|||||||
[Required] public string Title { get; set; }
|
[Required] public string Title { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Store")]
|
||||||
public SelectList Stores { get; set; }
|
public SelectList Stores { get; set; }
|
||||||
|
|
||||||
[EmailAddress]
|
[EmailAddress]
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Display(Name = "Store")]
|
||||||
public SelectList Stores
|
public SelectList Stores
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<span asp-validation-for="NotificationUrl" class="text-danger"></span>
|
<span asp-validation-for="NotificationUrl" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="StoreId" class="form-label"></label>
|
<label asp-for="Stores" class="form-label"></label>
|
||||||
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
||||||
<span asp-validation-for="StoreId" class="text-danger"></span>
|
<span asp-validation-for="StoreId" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<input type="hidden" name="Id" value="@Model.Id" />
|
<input type="hidden" name="Id" value="@Model.Id" />
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="StoreId" class="form-label"></label>
|
<label asp-for="Stores" class="form-label"></label>
|
||||||
@if (string.IsNullOrEmpty(Model.Id))
|
@if (string.IsNullOrEmpty(Model.Id))
|
||||||
{
|
{
|
||||||
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
@if (ViewBag.ShowStores)
|
@if (ViewBag.ShowStores)
|
||||||
{
|
{
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="StoreId" class="form-label"></label>
|
<label asp-for="Stores" class="form-label"></label>
|
||||||
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
||||||
<span asp-validation-for="StoreId" class="text-danger"></span>
|
<span asp-validation-for="StoreId" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user