diff --git a/Shifty.App/Components/MenuItems.razor b/Shifty.App/Components/MenuItems.razor
index f2537e4..2adf21a 100644
--- a/Shifty.App/Components/MenuItems.razor
+++ b/Shifty.App/Components/MenuItems.razor
@@ -10,77 +10,80 @@
@using Shifty.App.DomainModels
@using LanguageExt.UnsafeValueAccess
@using Shifty.App.Repositories
+@using MudExtensions
@inject ISnackbar Snackbar
@inject IJSRuntime JSRuntime
@inject IMenuItemService MenuItemService
@inject IDialogService DialogService
- @if (_loading)
- {
-
-
-
- }
- else
- {
-
-
-
-
-
-
-
-
-
-
-
- @{
- if (context.Item.Active)
- {
-
- }
- else
- {
-
- }
- }
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @{
+ if (context.Item.Active)
+ {
+
+ }
+ else
+ {
+
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+ Add Product
+
+
+
+
-
-
-
- Add Product
-
-
}
diff --git a/Shifty.App/Components/ProductManager.razor b/Shifty.App/Components/ProductManager.razor
index 01a538e..98d713e 100644
--- a/Shifty.App/Components/ProductManager.razor
+++ b/Shifty.App/Components/ProductManager.razor
@@ -20,115 +20,118 @@
}
- @if (_loading)
- {
-
-
-
- }
-
-
-
-
-
-
-
-
-
- @{
- if (context.Item.Visible)
- {
-
- }
- else
- {
-
- }
- }
-
-
-
-
-
-
-
-
-
-
-
- Visible to:
- @foreach (var group in Enum.GetValues())
- {
-
- @group
- }
-
-
-
-
- @{
- if (context.Item.IsPerk)
- {
-
- }
- else
- {
-
- }
- }
-
-
-
-
-
-
- @foreach (var mi in _allMenuItems)
- {
- @mi.Name
- }
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @{
+ if (context.Item.Visible)
+ {
+
+ }
+ else
+ {
+
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+ Visible to:
+ @foreach (var group in Enum.GetValues())
+ {
+
+ @group
+ }
+
+
+
+
+ @{
+ if (context.Item.IsPerk)
+ {
+
+ }
+ else
+ {
+
+ }
+ }
+
+
+
+
+
+
+ @foreach (var mi in _allMenuItems)
+ {
+ @mi.Name
+ }
+
+
+
+
+
-
-
-
- Add Product
-
-
+
+
+
+ Add Product
+
+
+
+
@code
{
diff --git a/Shifty.App/Components/UnusedTickets.razor b/Shifty.App/Components/UnusedTickets.razor
index e2773bf..b36f04e 100644
--- a/Shifty.App/Components/UnusedTickets.razor
+++ b/Shifty.App/Components/UnusedTickets.razor
@@ -7,36 +7,41 @@
@using Shifty.App.Shared
@using Shared
@using LanguageExt.UnsafeValueAccess
+@using MudExtensions
@inject IUnusedTicketsService _unusedTicketsService
@inject ISnackbar Snackbar
-
-
- Unused Tickets
-
- @if (_loading)
- {
-
- }
-
-
-
-
-
-
-
-
- @context.Item.UnusedPurchasesValue.ToString("0.00")
-
-
-
- No records found for the given time period
-
+
+ Unused Tickets
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @context.Item.UnusedPurchasesValue.ToString("0.00")
+
+
+
+ No records found for the given time period
+
+
+
+
@code
diff --git a/Shifty.App/Components/UserTable.razor b/Shifty.App/Components/UserTable.razor
index d757983..73be8f6 100644
--- a/Shifty.App/Components/UserTable.razor
+++ b/Shifty.App/Components/UserTable.razor
@@ -5,63 +5,73 @@
@using Shifty.Api.Generated.AnalogCoreV2
@using Shared
@using LanguageExt.UnsafeValueAccess
+@using MudExtensions
@inject IUserService _userService
@inject ISnackbar Snackbar
-
-
- Users
-
-
-
-
- Id
- Name
- Email
- UserGroup
-
-
- @context.Id
- @context.Name
- @context.Email
- @context.UserGroup
-
-
- @context.Id
- @context.Name
- @context.Email
-
-
- @foreach (var group in Enum.GetValues()) {
- @group
- }
-
-
-
- No matching records found
-
-
-
-
-
+
+ Users
+
+
+
+
+
+
+
+
+
+
+
+ Id
+ Name
+ Email
+ UserGroup
+
+
+ @context.Id
+ @context.Name
+ @context.Email
+ @context.UserGroup
+
+
+ @context.Id
+ @context.Name
+ @context.Email
+
+
+ @foreach (var group in Enum.GetValues()) {
+ @group
+ }
+
+
+
+ No matching records found
+
+
+
+
+
+
+
+
@code
@@ -69,11 +79,13 @@
private MudTable _table;
private string searchString = "";
UserGroup UserGroupBeforeEdit;
+ private bool _loading = false;
private async Task> LoadUsers(TableState state)
{
+ _loading = true;
var result = await _userService.SearchUsers(searchString, state.Page, state.PageSize);
-
+ _loading = false;
return result.Match(
Succ: res => {
return new TableData(){ Items = res.Users.AsEnumerable(), TotalItems = res.TotalUsers};
diff --git a/Shifty.App/Components/Voucher.razor b/Shifty.App/Components/Voucher.razor
index 947e595..d177e6f 100644
--- a/Shifty.App/Components/Voucher.razor
+++ b/Shifty.App/Components/Voucher.razor
@@ -7,6 +7,7 @@
@using LanguageExt.UnsafeValueAccess
@using Shifty.App.Repositories
@using Shifty.App.DomainModels
+@using MudExtensions
@inject IProductService _productService
@inject IVoucherService _voucherService
@inject ISnackbar Snackbar
@@ -71,25 +72,28 @@
- @if (_showProgressBar)
- {
-
-
-
- }
- @if (_vouchers is not null)
- {
-
- }
+
+
+
+
+
+
+
+ @if (_vouchers is not null)
+ {
+
+ }
+
+
@@ -100,7 +104,7 @@
public System.Security.Claims.ClaimsPrincipal User { get; set; }
private VoucherForm _voucherForm = new();
private bool _isFormValid = false;
- private bool _showProgressBar = false;
+ private bool _loading = false;
private IEnumerable _products = new List();
private IEnumerable _vouchers;
private string _voucherCodes;
@@ -146,7 +150,7 @@
private async Task IssueVoucher()
{
- _showProgressBar = true;
+ _loading = true;
_vouchers = null;
_voucherCodes = null;
var result = await _voucherService.IssueVouchers(
@@ -158,12 +162,12 @@
result.Match(
Succ: response => {
- _showProgressBar = false;
+ _loading = false;
_vouchers = response;
_voucherCodes = string.Join("\n", _vouchers.Select(issueVoucherResponse => issueVoucherResponse.VoucherCode));
},
Fail: ex => {
- _showProgressBar = false;
+ _loading = false;
Snackbar.Add(ex.Message, Severity.Error);
}
);