Improve payout processors UI

Some quick fixes, closes #3697.
This commit is contained in:
Dennis Reimann 2022-05-02 15:07:48 +02:00 committed by Andrew Camilleri
parent 8bd54493a3
commit d7faa0a0fd
5 changed files with 60 additions and 68 deletions

View File

@ -101,10 +101,10 @@ public class UILightningAutomatedPayoutProcessorsController : Controller
Id = activeProcessor.Id,
Processed = tcs
});
TempData.SetStatusMessageModel(new StatusMessageModel()
TempData.SetStatusMessageModel(new StatusMessageModel
{
Severity = StatusMessageModel.StatusSeverity.Success,
Message = $"Processor updated."
Message = "Processor updated."
});
await tcs.Task;
return RedirectToAction("ConfigureStorePayoutProcessors", "UiPayoutProcessors", new {storeId});
@ -121,11 +121,12 @@ public class UILightningAutomatedPayoutProcessorsController : Controller
{
IntervalMinutes = blob.Interval.TotalMinutes;
}
public double IntervalMinutes { get; set; }
public AutomatedPayoutBlob ToBlob()
{
return new AutomatedPayoutBlob() { Interval = TimeSpan.FromMinutes(IntervalMinutes) };
return new AutomatedPayoutBlob { Interval = TimeSpan.FromMinutes(IntervalMinutes) };
}
}
}

View File

@ -114,10 +114,10 @@ public class UIOnChainAutomatedPayoutProcessorsController : Controller
Id = activeProcessor.Id,
Processed = tcs
});
TempData.SetStatusMessageModel(new StatusMessageModel()
TempData.SetStatusMessageModel(new StatusMessageModel
{
Severity = StatusMessageModel.StatusSeverity.Success,
Message = $"Processor updated."
Message = "Processor updated."
});
await tcs.Task;
return RedirectToAction("ConfigureStorePayoutProcessors", "UiPayoutProcessors", new {storeId});
@ -138,7 +138,7 @@ public class UIOnChainAutomatedPayoutProcessorsController : Controller
public AutomatedPayoutBlob ToBlob()
{
return new AutomatedPayoutBlob() { Interval = TimeSpan.FromMinutes(IntervalMinutes) };
return new AutomatedPayoutBlob { Interval = TimeSpan.FromMinutes(IntervalMinutes) };
}
}
}

View File

@ -6,7 +6,6 @@
ViewData.SetActivePage("PayoutProcessors", "Lightning Payout Processor", Context.GetStoreData().Id);
}
<div class="row">
<div class="col-xl-8 col-xxl-constrain">
<div class="d-flex align-items-center justify-content-between mb-3">
<h3 class="mb-0">@ViewData["Title"]</h3>
@ -18,10 +17,12 @@
}
<form method="post">
<div class="form-group">
<label asp-for="IntervalMinutes" class="form-label">Set interval in minutes.</label>
<input asp-for="IntervalMinutes" class="form-control">
<label asp-for="IntervalMinutes" class="form-label" data-required>Interval</label>
<div class="input-group">
<input asp-for="IntervalMinutes" class="form-control" inputmode="numeric" style="max-width:10ch;">
<span class="input-group-text">minutes</span>
</div>
</div>
<button name="command" type="submit" class="btn btn-primary mt-2" value="Save" id="Save">Save</button>
</form>
</div>

View File

@ -3,10 +3,9 @@
@{
ViewData["NavPartialName"] = "../UIStores/_Nav";
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePage("PayoutProcessors", "OnChain Payout Processor", Context.GetStoreData().Id);
ViewData.SetActivePage("PayoutProcessors", "On-Chain Payout Processor", Context.GetStoreData().Id);
}
<div class="row">
<div class="col-xl-8 col-xxl-constrain">
<div class="d-flex align-items-center justify-content-between mb-3">
<h3 class="mb-0">@ViewData["Title"]</h3>
@ -18,10 +17,12 @@
}
<form method="post">
<div class="form-group">
<label asp-for="IntervalMinutes" class="form-label">Set interval in minutes.</label>
<input asp-for="IntervalMinutes" class="form-control">
<label asp-for="IntervalMinutes" class="form-label" data-required>Interval</label>
<div class="input-group">
<input asp-for="IntervalMinutes" class="form-control" inputmode="numeric" style="max-width:10ch;">
<span class="input-group-text">minutes</span>
</div>
</div>
<button name="command" type="submit" class="btn btn-primary mt-2" value="Save" id="Save">Save</button>
</form>
</div>

View File

@ -17,11 +17,8 @@
{
foreach (var processorsView in Model)
{
<div class="row">
<h4>@processorsView.Factory.FriendlyName</h4>
<div class="row">
<div class="col">
<table class="table table-hover">
<h4 class="mt-5">@processorsView.Factory.FriendlyName</h4>
<table class="table table-hover mt-0">
<thead>
<tr>
<th>Payment Method</th>
@ -34,9 +31,7 @@
<tr>
<td>
@conf.Key.ToPrettyString()
</td>
<td class="text-end">
@if (conf.Value is null)
{
@ -45,20 +40,14 @@
else
{
<a href="@processorsView.Factory.ConfigureLink(storeId, conf.Key, Context.Request)">Modify</a>
<span>-</span>
<a asp-action="Remove" asp-route-storeId="@storeId" asp-route-id="@conf.Value.Id" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-description="The Payout Processor @processorsView.Factory.Processor for @conf.Key.CryptoCode will be removed from your store.">Remove</a>
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
}
}
else