wip - move loading to bottom of page - added missing lib ref
This commit is contained in:
parent
e7b91dec1f
commit
88039cd8f5
37 changed files with 237 additions and 210 deletions
|
@ -32,12 +32,13 @@ namespace Wonky.Client.HttpInterceptors
|
|||
private readonly IToastService _toast;
|
||||
private readonly RefreshTokenService _refreshTokenService;
|
||||
private ILogger<HttpInterceptorService> _logger;
|
||||
private ILocalStorageService _storage;
|
||||
private readonly ILocalStorageService _storage;
|
||||
private IAuthenticationService _authenticationService;
|
||||
|
||||
public HttpInterceptorService(HttpClientInterceptor interceptor,
|
||||
NavigationManager navigation, IToastService toast,
|
||||
RefreshTokenService refreshTokenService, ILogger<HttpInterceptorService> logger,
|
||||
ILocalStorageService storage)
|
||||
ILocalStorageService storage, IAuthenticationService authenticationService)
|
||||
{
|
||||
_interceptor = interceptor;
|
||||
_navigation = navigation;
|
||||
|
@ -45,6 +46,7 @@ namespace Wonky.Client.HttpInterceptors
|
|||
_refreshTokenService = refreshTokenService;
|
||||
_logger = logger;
|
||||
_storage = storage;
|
||||
_authenticationService = authenticationService;
|
||||
}
|
||||
|
||||
public void RegisterEvent()
|
||||
|
@ -75,8 +77,8 @@ namespace Wonky.Client.HttpInterceptors
|
|||
// set new token
|
||||
e.Request.Headers.Authorization = new AuthenticationHeaderValue("bearer", token);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void AfterSend (object sender, HttpClientInterceptorEventArgs e)
|
||||
|
@ -100,11 +102,13 @@ namespace Wonky.Client.HttpInterceptors
|
|||
// _toast.ShowWarning(message);
|
||||
break;
|
||||
case HttpStatusCode.Unauthorized:
|
||||
ClearInfo();
|
||||
_authenticationService.Logout();
|
||||
_navigation.NavigateTo($"/login/{currDoc}");
|
||||
message = "Venligst login ...";
|
||||
_toast.ShowWarning(message);
|
||||
break;
|
||||
case HttpStatusCode.Conflict:
|
||||
break;
|
||||
case HttpStatusCode.InternalServerError:
|
||||
message = "Der er interne problemer på serveren ...";
|
||||
_toast.ShowError(message);
|
||||
|
@ -115,11 +119,6 @@ namespace Wonky.Client.HttpInterceptors
|
|||
}
|
||||
// throw new HttpResponseException(message);
|
||||
}
|
||||
|
||||
private async void ClearInfo()
|
||||
{
|
||||
await _storage.ClearAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ public interface ICrmHistoryHttpRepository
|
|||
{
|
||||
Task<InvoiceListView> FetchInvoiceList(string companyId);
|
||||
Task<InvoiceView> FetchInvoice(string companyId, string invoiceId);
|
||||
Task<List<ProductInventoryView>?> FetchInventory(string companyId);
|
||||
Task<List<ProductHistoryView>?> FetchHistory(string companyId);
|
||||
Task<List<ProductHistoryView>?> FetchHistory(string companyId, string sku);
|
||||
Task<string> RpcSyncErpToCrm(string companyId, string syncDate);
|
||||
Task<List<ProductInventoryView>> FetchInventory(string companyId);
|
||||
Task<List<ProductHistoryView>> FetchHistory(string companyId);
|
||||
Task<List<ProductHistoryView>> FetchHistory(string companyId, string sku);
|
||||
Task<string> RpcSyncErpToCrm(string companyId, string syncDate, string etag);
|
||||
}
|
|
@ -108,14 +108,16 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository
|
|||
return await _client.GetFromJsonAsync<List<ProductHistoryView>>(
|
||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProductExt}/{sku}", _options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// execute a remote procedure designed to update crm database from erp system based on a date string
|
||||
/// </summary>
|
||||
/// <param name="companyId"></param>
|
||||
/// <param name="syncDate"></param>
|
||||
/// <param name="etag"></param>
|
||||
/// <returns>date string</returns>
|
||||
public async Task<string> RpcSyncErpToCrm(string companyId, string syncDate)
|
||||
public async Task<string> RpcSyncErpToCrm(string companyId, string syncDate, string etag)
|
||||
{
|
||||
return await _client.GetStringAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmRpcSyncExt}/{syncDate}");
|
||||
return await _client.GetStringAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmRpcSyncExt}/{syncDate}?etag={etag}");
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
<div class="sticky-top bg-dark rounded-2 px-3">
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-sm-2">
|
||||
<CatalogGroupComponent OnChanged="SetItemGroup"/>
|
||||
<CatalogGroupComponent OnChanged="SetGroupCol"/>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<CatalogSearchComponent OnChanged="SetSearchCol"/>
|
||||
|
@ -39,15 +39,15 @@
|
|||
<PageSizeComponent OnChanged="SetPageSize"/>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<PaginationComponent MetaData="_metaData" Spread="2" SelectedPage="SelectedPage"/>
|
||||
<PaginationComponent MetaData="_metaData" Spread="2" SelectedPage="SetSelectedPage"/>
|
||||
</div>
|
||||
<div class="col-sm-2 text-end">
|
||||
<a class="btn btn-secondary" href="/price-catalog/print"><i class="bi-printer"></i> Udskriv</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<CatalogTableComponent ItemList="_items"/>
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
<CatalogTableComponent ItemList="_items"/>
|
|
@ -55,7 +55,7 @@ public partial class CatalogPage : IDisposable
|
|||
|
||||
Interceptor.RegisterEvent();
|
||||
Interceptor.RegisterBeforeSendEvent();
|
||||
await GetSalesItems();
|
||||
await FetchSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetSearchPhrase(string searchTerm)
|
||||
|
@ -63,7 +63,7 @@ public partial class CatalogPage : IDisposable
|
|||
_items = new List<SalesItemView>();
|
||||
_paging.PageNumber = 1;
|
||||
_paging.SearchTerm = searchTerm;
|
||||
await GetSalesItems();
|
||||
await FetchSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetPageSize(string pageSize)
|
||||
|
@ -71,7 +71,7 @@ public partial class CatalogPage : IDisposable
|
|||
_items = new List<SalesItemView>();
|
||||
_paging.PageSize = Convert.ToInt32(pageSize);
|
||||
_paging.PageNumber = 1;
|
||||
await GetSalesItems();
|
||||
await FetchSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetSearchCol(string columnName)
|
||||
|
@ -79,32 +79,32 @@ public partial class CatalogPage : IDisposable
|
|||
_items = new List<SalesItemView>();
|
||||
_paging.PageNumber = 1;
|
||||
_paging.SearchColumn = columnName;
|
||||
await GetSalesItems();
|
||||
await FetchSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetSortCol(string orderBy)
|
||||
{
|
||||
_items = new List<SalesItemView>();
|
||||
_paging.OrderBy = orderBy;
|
||||
await GetSalesItems();
|
||||
await FetchSalesItems();
|
||||
}
|
||||
|
||||
private async Task SelectedPage(int page)
|
||||
private async Task SetSelectedPage(int page)
|
||||
{
|
||||
_items = new List<SalesItemView>();
|
||||
_paging.PageNumber = page;
|
||||
await GetSalesItems();
|
||||
await FetchSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetItemGroup(string groupFilter)
|
||||
private async Task SetGroupCol(string groupFilter)
|
||||
{
|
||||
_items = new List<SalesItemView>();
|
||||
_paging.PageNumber = 1;
|
||||
_paging.SelectGroup = groupFilter;
|
||||
await GetSalesItems();
|
||||
await FetchSalesItems();
|
||||
}
|
||||
|
||||
private async Task GetSalesItems()
|
||||
private async Task FetchSalesItems()
|
||||
{
|
||||
Working = true;
|
||||
var pagingResponse = await ItemRepo.GetSalesItemsPaged(_paging);
|
||||
|
|
|
@ -21,12 +21,9 @@
|
|||
|
||||
@attribute [Authorize(Roles = "Admin,Advisor,Office,Warehouse")]
|
||||
|
||||
<CatalogTablePrintComponent ItemList="Items" />
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
else
|
||||
{
|
||||
<CatalogTablePrintComponent ItemList="Items" />
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
||||
|
|
|
@ -38,11 +38,11 @@
|
|||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
@if (ReportStatusView.ReportItems.Any())
|
||||
{
|
||||
<AdvisorActivityTableComponent ActivityList="ReportStatusView.ReportItems"/>
|
||||
}
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -16,17 +16,13 @@
|
|||
*@
|
||||
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using System.Security.Claims
|
||||
@using Wonky.Client.Components
|
||||
|
||||
@attribute [Authorize(Roles = "Admin,Office,Warehouse,Advisor")]
|
||||
@page "/companies/{CompanyId}/orders/{OrderId}"
|
||||
|
||||
@* <ReportItemComponent ReportItem="@_item" /> *@
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<LoaderThreeDots/>
|
||||
}
|
||||
<table class="table table-sm table-striped d-print-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -158,3 +154,7 @@ else
|
|||
</div>
|
||||
}
|
||||
}
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@page "/companies/{CompanyId}/activities"
|
||||
@attribute [Authorize(Roles = "Advisor")]
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Name))
|
||||
{
|
||||
<div class="row pt-2 pb-1 rounded-2 bg-dark text-white">
|
||||
|
@ -96,3 +92,7 @@
|
|||
}
|
||||
</div>
|
||||
}
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
@using Microsoft.AspNetCore.Authorization
|
||||
@page "/companies/{CompanyId}/h/i"
|
||||
@attribute [Authorize(Roles = "Advisor")]
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
<div class="row pt-2 pb-1 rounded-2 bg-dark text-white">
|
||||
<div class="col-sm-6">
|
||||
<h4 class="pt-1">@Company.Name</h4>
|
||||
|
@ -35,3 +31,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<ProductInventoryTableComponent CompanyId="@CompanyId" ProductList="Inventory"/>
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
@page "/companies/{CompanyId}/invoices"
|
||||
@using Wonky.Client.Components
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Name))
|
||||
{
|
||||
<div class="row pt-2 pb-1 rounded-2 bg-dark text-white">
|
||||
|
@ -21,3 +16,8 @@
|
|||
</div>
|
||||
<InvoiceTableComponent CompanyId="@CompanyId" InvoiceList="@History.Invoices"/>
|
||||
}
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -28,17 +28,9 @@ public partial class CrmCompanyInvoiceListPage : IDisposable
|
|||
|
||||
Company = await CompanyRepo.GetCompanyById(CompanyId);
|
||||
|
||||
await FetchInvoices();
|
||||
Working = false;
|
||||
}
|
||||
|
||||
private async Task FetchInvoices()
|
||||
{
|
||||
Working = true;
|
||||
Toaster.ShowInfo("Arbejder på sagen ...", "Vent venligst");
|
||||
History = await HistoryRepo.FetchInvoiceList(CompanyId);
|
||||
|
||||
Working = false;
|
||||
Toaster.ClearAll();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -49,12 +49,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AdvisorCompanyTableComponent CompanyList="Companies" OnDelete="DeleteCompany" />
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
else
|
||||
{
|
||||
<AdvisorCompanyTableComponent CompanyList="Companies" OnDelete="DeleteCompany" />
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,6 @@
|
|||
|
||||
|
||||
<h2>Opret kunde</h2>
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<EditForm EditContext="CompanyContext" OnValidSubmit="SubmitCompanyForm">
|
||||
<DataAnnotationsValidator/>
|
||||
<InputText type="hidden" id="salesRepId" @bind-Value="Company.SalesRepId"/>
|
||||
|
@ -136,3 +132,10 @@
|
|||
|
||||
<VatLookupDkModal VatAddress="CompanyVatAddress" EntityName="@Company.Name" VatNumber="@Company.VatNumber"
|
||||
@ref="VatLookupPopup" OnSelectedCompany="SelectCompanyCallback"/>
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
||||
|
|
@ -21,10 +21,6 @@
|
|||
@attribute [Authorize(Roles = "Advisor")]
|
||||
@page "/companies/{CompanyId}"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Account))
|
||||
{
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Blocked))
|
||||
|
@ -237,3 +233,8 @@
|
|||
@ref="VatLookupPopup" OnSelectedCompany="SelectedCompanyCallback" />
|
||||
<ContactModal ParamContact="@SelectedContact" CompanyName="@Company.Name"
|
||||
@ref="ContactPopup" OnSaveClicked="WriteContactCallback" OnDeleteClicked="DeleteContactCallback"/>
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
||||
//
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using Blazored.LocalStorage;
|
||||
|
@ -48,10 +49,10 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
private EditContext ErpContext { get; set; }
|
||||
private DateTime LastVisit { get; set; }
|
||||
private DateTime NextVisit { get; set; }
|
||||
private VatAddress CompanyVatAddress = new();
|
||||
private VatAddress CompanyVatAddress { get; set; } = new();
|
||||
private string VatState { get; set; } = "the-ugly";
|
||||
private bool ValidVat;
|
||||
private bool HasFolded;
|
||||
private bool ValidVat { get; set; }
|
||||
private bool HasFolded { get; set; }
|
||||
private string CurrentVat { get; set; } = "";
|
||||
private string CountryCode { get; set; } = "dk";
|
||||
private string VisitState { get; set; } = "the-ugly";
|
||||
|
@ -65,41 +66,48 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
private ContactDto DefaultContact { get; set; } = new();
|
||||
private ContactModal ContactPopup { get; set; } = new();
|
||||
private UserInfoView UserInfo { get; set; } = new();
|
||||
private string Etag { get; set; } = "";
|
||||
|
||||
private string _getServerData { get; set; } = "";
|
||||
[Parameter]
|
||||
public string RpcDone
|
||||
{
|
||||
get => _getServerData;
|
||||
set
|
||||
{
|
||||
if (_getServerData == value)
|
||||
return;
|
||||
_getServerData = value;
|
||||
var x = PrepareCompanyDate().Result;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<string> PrepareCompanyDate()
|
||||
{
|
||||
// call background task to fetch contacts
|
||||
await FetchContacts(CompanyId);
|
||||
return await HistoryRepo.RpcSyncErpToCrm(Company.CompanyId, Company.HistorySync, Etag);
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// fetch user info from local storage
|
||||
UserInfo = await Storage.GetItemAsync<UserInfoView>("_xu");
|
||||
CountryCode = UserInfo.CountryCode.ToLower();
|
||||
CountryIsDk = CountryCode == "dk";
|
||||
|
||||
// setup interceptor
|
||||
Interceptor.RegisterEvent();
|
||||
Interceptor.RegisterBeforeSendEvent();
|
||||
// fetch company from backend
|
||||
await FetchCompany(CompanyId);
|
||||
// initialize default contact
|
||||
DefaultContact = new ContactDto { CompanyId = CompanyId, ContactId = "", FirstName = ""};
|
||||
// setup form context
|
||||
ErpContext = new EditContext(Company);
|
||||
// assign event handlers to context
|
||||
ErpContext.OnFieldChanged += HandleFieldChanged;
|
||||
ErpContext.OnValidationStateChanged += ValidationChanged;
|
||||
// call background task to sync backend with erp
|
||||
await SyncCompanyHistory(CompanyId, Company.HistorySync);
|
||||
// call background task to fetch contacts
|
||||
await FetchContacts(CompanyId);
|
||||
// remove loading image
|
||||
Working = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get company by id
|
||||
/// </summary>
|
||||
/// <param name="companyId"></param>
|
||||
private async Task FetchCompany(string companyId)
|
||||
{
|
||||
Company = await CompanyRepo.GetCompanyById(companyId);
|
||||
Company = await CompanyRepo.GetCompanyById(CompanyId);
|
||||
Etag = Company.Etag;
|
||||
Company.Etag = Guid.NewGuid().ToString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(CompanyId))
|
||||
RpcDone = CompanyId;
|
||||
|
||||
CurrentVat = Company.VatNumber;
|
||||
|
||||
Company.CountryCode = UserInfo.CountryCode.ToLower();
|
||||
// internal flag
|
||||
EnableActivity = Company.ValidVat;
|
||||
|
@ -142,6 +150,16 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
// create search address from address
|
||||
if (CountryIsDk)
|
||||
CompanyVatAddress = PrepareVatAddress(Company);
|
||||
|
||||
// initialize default contact
|
||||
DefaultContact = new ContactDto { CompanyId = CompanyId, ContactId = "", FirstName = ""};
|
||||
// setup form context
|
||||
ErpContext = new EditContext(Company);
|
||||
// assign event handlers to context
|
||||
ErpContext.OnFieldChanged += HandleFieldChanged;
|
||||
ErpContext.OnValidationStateChanged += ValidationChanged;
|
||||
|
||||
// remove loading image
|
||||
Working = false;
|
||||
}
|
||||
|
||||
|
@ -151,11 +169,9 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
/// <param name="companyId"></param>
|
||||
private async Task FetchContacts(string companyId)
|
||||
{
|
||||
Working = true;
|
||||
// load contacts
|
||||
Contacts = await ContactRepo.GetContacts(companyId);
|
||||
Contacts = Contacts.OrderBy(x => x.FirstName).ToList();
|
||||
Working = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -296,7 +312,7 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
/// <returns>true/false</returns>
|
||||
private async Task UpdateVatNumber()
|
||||
{
|
||||
// simple format validation if CRM indicates invalid vatNumber
|
||||
// VAT format validation
|
||||
if (!VatUtils.ValidateFormat(Company.CountryCode, Company.VatNumber))
|
||||
{
|
||||
Toaster.ShowError($"Moms Nummer ugyldigt");
|
||||
|
@ -348,17 +364,6 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
return new VatAddress();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rpc call to sync backend with ERP system
|
||||
/// </summary>
|
||||
private async Task SyncCompanyHistory(string companyId, string syncDate)
|
||||
{
|
||||
Working = true;
|
||||
// send rpc request to backend
|
||||
await HistoryRepo.RpcSyncErpToCrm(companyId, syncDate);
|
||||
Working = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Change activity enabled state
|
||||
/// </summary>
|
||||
|
|
|
@ -18,13 +18,15 @@
|
|||
@using Wonky.Client.Components
|
||||
@page "/sales-reports"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="alert text-black border border-1">
|
||||
<div class="col">
|
||||
<h3>Rapport Arkiv</h3>
|
||||
</div>
|
||||
</div>
|
||||
<ReportTableComponent ReportList="ReportList" />
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -20,11 +20,6 @@
|
|||
@attribute [Authorize(Roles = "Advisor")]
|
||||
@page "/sales-reports/new"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
||||
@* report header *@
|
||||
<div class="row sticky-top bg-dark text-white rounded-2 mb-2 py-2 align-items-center">
|
||||
<div class="col-sm-8">
|
||||
|
@ -303,3 +298,9 @@
|
|||
</div>
|
||||
</EditForm>
|
||||
<ConfirmationModal BodyMessage="@Prompt" OnOkClicked="ConfirmSaveCallback" @ref="ConfirmReportModal"/>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@page "/sales-reports/view/{ReportDate}"
|
||||
@attribute [Authorize(Roles = "Advisor,Admin,Supervisor")]
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="report-main">
|
||||
|
||||
<div class="row bg-dark text-white rounded-2 mb-2 py-2 align-items-center d-print-none">
|
||||
|
@ -71,3 +67,9 @@
|
|||
<ReportItemComponent ReportItem="@item"></ReportItemComponent>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@attribute [Authorize(Roles = "Advisor")]
|
||||
@page "/task-items"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row mb-1 align-items-center">
|
||||
|
@ -42,3 +38,9 @@
|
|||
<TaskItemTableComponent TaskItemList="TaskItems" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -16,13 +16,10 @@
|
|||
*@
|
||||
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Wonky.Client.Components
|
||||
@attribute [Authorize(Roles = "Advisor")]
|
||||
@page "/tasks/{TaskItemId}"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Opgave</h3>
|
||||
|
@ -105,3 +102,9 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
@page "/companies/{CompanyId}/workplaces/{WorkplaceId}/documents"
|
||||
|
||||
<h2>Dokumenter</h2>
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
|
|
|
@ -25,10 +25,12 @@
|
|||
<h2>@_company.Name</h2>
|
||||
</div>
|
||||
</div>
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="row">
|
||||
<WorkplaceListComponent CompanyId="@CompanyId" Workplaces="@_workplaces" />
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -17,13 +17,10 @@
|
|||
|
||||
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Wonky.Client.Components
|
||||
@attribute [Authorize(Roles = "Advisor")]
|
||||
@page "/companies/{CompanyId}/workplaces/{WorkplaceId}"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
|
@ -123,3 +120,9 @@
|
|||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots />
|
||||
}
|
||||
|
|
|
@ -30,6 +30,6 @@ public partial class Logout
|
|||
{
|
||||
await AuthenticationService.Logout();
|
||||
|
||||
NavigationManager.NavigateTo("/");
|
||||
NavigationManager.NavigateTo("/login");
|
||||
}
|
||||
}
|
|
@ -53,8 +53,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<AdvisorCompanyTableComponent CompanyList="_companyList" />
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<AdvisorCompanyTableComponent CompanyList="_companyList" />
|
|
@ -52,8 +52,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<OfficeCustomerTableComponent CompanyList="_companyList" />
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<OfficeCustomerTableComponent CompanyList="_companyList" />
|
|
@ -20,10 +20,6 @@
|
|||
@attribute [Authorize(Roles = "Admin,Office,Warehouse")]
|
||||
@page "/office/customers/{CompanyId}/orders/new"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<EditForm EditContext="_editContext">
|
||||
<DataAnnotationsValidator/>
|
||||
<div class="row mb-1">
|
||||
|
@ -188,16 +184,15 @@
|
|||
|
||||
</EditForm>
|
||||
<div class="card-footer">
|
||||
@if (HideButton)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row mt-2 mb-2">
|
||||
<div class="col text-end">
|
||||
<button type="button" class="btn btn-primary" @onclick="CreateOrder" disabled="@FormInvalid">Ordre order</button>
|
||||
<button type="button" class="btn btn-primary" @onclick="CreateOrder" disabled="@FormInvalid">Opret ordre</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@attribute [Authorize(Roles = "Admin,Office,Warehouse,Advisor")]
|
||||
@page "/office/customers/{CompanyId}/orders/{OrderId}"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<table class="table table-sm table-striped d-print-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -155,3 +151,9 @@
|
|||
<h4 class="text-center">@_reportItem.OfficeNote</h4>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@attribute [Authorize(Roles = "Admin")]
|
||||
@page "/office/users/advisors/{CountryCode}/{UserId}/reports"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<div class="row">
|
||||
|
@ -36,3 +32,9 @@
|
|||
<OfficeReportTableComponent CountryCode="@CountryCode" UserId="@UserId" ReportList="@_reports" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -20,11 +20,6 @@
|
|||
@page "/office/users/advisors/{CountryCode}/{UserId}/reports/{ReportDate}"
|
||||
@attribute [Authorize(Roles = "Admin")]
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
||||
<div class="report-main">
|
||||
<div class="row mb-3 d-print-none">
|
||||
@* <div class="col-md-6 align-content-center"> *@
|
||||
|
@ -75,3 +70,9 @@
|
|||
<ReportItemComponent ReportItem="@item"></ReportItemComponent>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@attribute [Authorize(Roles = "Admin,Office")]
|
||||
@page "/office/users/advisors/{CountryCode}"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<h3>Sælgere</h3>
|
||||
|
@ -32,3 +28,9 @@
|
|||
<OfficeAdvisorTableComponent UserList="_salesReps" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@using Wonky.Client.Components
|
||||
@attribute [Authorize(Roles = "Admin")]
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<h3>Bruger info</h3>
|
||||
|
@ -134,3 +130,9 @@
|
|||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
@attribute [Authorize(Roles = "Admin,Warehouse,Office")]
|
||||
@page "/warehouse/orders/process/{OrderId}"
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(_order.OrderDate))
|
||||
{
|
||||
<table class="table">
|
||||
|
@ -125,3 +121,9 @@
|
|||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
}
|
||||
|
|
|
@ -35,9 +35,13 @@ namespace Wonky.Client.Services
|
|||
private readonly IOptions<ApiConfig> _apiConfig;
|
||||
private readonly ILogger<AuthenticationService> _logger;
|
||||
|
||||
public AuthenticationService(HttpClient client,
|
||||
public AuthenticationService(
|
||||
HttpClient client,
|
||||
AuthenticationStateProvider authStateProvider,
|
||||
ILocalStorageService localStorage, IOptions<ApiConfig> apiConfig, ILogger<AuthenticationService> logger)
|
||||
ILocalStorageService localStorage,
|
||||
IOptions<ApiConfig> apiConfig,
|
||||
ILogger<AuthenticationService> logger
|
||||
)
|
||||
{
|
||||
_client = client;
|
||||
_authStateProvider = authStateProvider;
|
||||
|
@ -66,7 +70,7 @@ namespace Wonky.Client.Services
|
|||
IsSuccess = false, ErrorMessage = $"Kontroller indtastning"
|
||||
};
|
||||
|
||||
Console.WriteLine(resContent);
|
||||
_logger.LogDebug("response {}", resContent);
|
||||
|
||||
// process response content
|
||||
var data = JsonSerializer.Deserialize<AuthResponseView>(resContent, _options);
|
||||
|
@ -117,7 +121,6 @@ namespace Wonky.Client.Services
|
|||
((AuthStateProvider)_authStateProvider).NotifyUserLogout();
|
||||
_client.DefaultRequestHeaders.Authorization = null;
|
||||
await _localStorage.RemoveItemsAsync(new List<string> {"_xa", "_xe", "_xr", "_xu"});
|
||||
|
||||
}
|
||||
|
||||
public async Task<UserInfoView> UserInfo(bool write = false)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"appInfo": {
|
||||
"name": "Wonky Client",
|
||||
"version": "0.75.1",
|
||||
"version": "0.77.1",
|
||||
"rc": true,
|
||||
"sandBox": false,
|
||||
"image": "grumpy-coder.png"
|
||||
|
|
|
@ -177,7 +177,7 @@ public class CompanyDto
|
|||
public string HistorySync { get; set; } = "";
|
||||
|
||||
public int IsDirty { get; set; } = 0;
|
||||
|
||||
public string Etag { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Virtual property indicating if timespan is within the defined interval
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in a new issue