rename popup to overlay - empty string bug in call to product check overlay
This commit is contained in:
parent
391aab22d1
commit
950c70e05e
19 changed files with 75 additions and 49 deletions
|
@ -32,7 +32,11 @@
|
||||||
<a class="btn btn-success d-block" href="/office/users/advisors/@user.CountryCode.ToLower()/@user.UserId/customers">Kunder</a>
|
<a class="btn btn-success d-block" href="/office/users/advisors/@user.CountryCode.ToLower()/@user.UserId/customers">Kunder</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<a class="btn btn-info d-block" href="/office/users/advisors/@user.CountryCode.ToLower()/@user.UserId/view">Rediger</a>
|
<AuthorizeView Roles="Admin">
|
||||||
|
<Authorized>
|
||||||
|
<a class="btn btn-info d-block" href="/office/users/advisors/@user.CountryCode.ToLower()/@user.UserId/view">Rediger</a>
|
||||||
|
</Authorized>
|
||||||
|
</AuthorizeView>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -19,7 +19,7 @@ using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Components;
|
namespace Wonky.Client.Components;
|
||||||
|
|
||||||
public partial class OfficeCountrySalesRepListComponent
|
public partial class OfficeCountryAdvisorListComponent
|
||||||
{
|
{
|
||||||
[Parameter] public List<UserListAdminView> UserList { get; set; } = new();
|
[Parameter] public List<UserListAdminView> UserList { get; set; } = new();
|
||||||
}
|
}
|
|
@ -220,7 +220,7 @@ else
|
||||||
<td class="align-middle text-black text-end fw-bold">@($"{DraftProvider.Draft.Total:N2}")</td>
|
<td class="align-middle text-black text-end fw-bold">@($"{DraftProvider.Draft.Total:N2}")</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="align-middle text-end">
|
<td class="align-middle text-end">
|
||||||
<button class="btn btn-primary" type="button" @onclick="CallPriceListModal">
|
<button class="btn btn-primary" type="button" @onclick="ShowPriceListOverlay">
|
||||||
<i class="bi-plus"></i> Ny linje
|
<i class="bi-plus"></i> Ny linje
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
@ -256,7 +256,7 @@ else
|
||||||
<td class="align-middle" style="min-width:200px;">
|
<td class="align-middle" style="min-width:200px;">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="number" class="form-control" @bind-value="@Price"/>
|
<input type="number" class="form-control" @bind-value="@Price"/>
|
||||||
<button class="btn btn-warning" type="button" @onclick="CallPriceHistoryModal">
|
<button class="btn btn-warning" type="button" @onclick="ShowPriceHistoryOverlay">
|
||||||
<i class="bi-list-ul"></i>
|
<i class="bi-list-ul"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -330,20 +330,26 @@ else
|
||||||
<a class="btn btn-warning" href="/advisor/customers/@Company.CompanyId">Kundekort <i class="bi-arrow-left"></i></a>
|
<a class="btn btn-warning" href="/advisor/customers/@Company.CompanyId">Kundekort <i class="bi-arrow-left"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4 text-end">
|
<div class="col-sm-4 text-end">
|
||||||
<button type="button" class="btn btn-warning" @onclick="CallConfirmProductCheckModel" disabled="@(PoFormInvalid || Working)"><i class="bi-cloud-arrow-up"></i> @ButtonText</button>
|
<button type="button" class="btn btn-warning" @onclick="CallConfirmCheckOverlay" disabled="@(PoFormInvalid || Working)"><i class="bi-cloud-arrow-up"></i> @ButtonText</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<ConfirmWorkDateModal BodyMessage="@PromptDateConfirm"
|
<ConfirmWorkDateOverlay BodyMessage="@PromptDateConfirm"
|
||||||
OnOkClicked="WorkDateConfirmCallback" @ref="ConfirmWorkDateModal"/>
|
OnOkClicked="WorkDateConfirmCallback" @ref="WorkDateOverlay"/>
|
||||||
<PriceCatalogModal CountryCode="@Company.CountryCode.ToLower()"
|
|
||||||
OnSelected="PriceListCallback" @ref="PriceCatalogModal"/>
|
<PriceCatalogOverlay CountryCode="@Company.CountryCode.ToLower()"
|
||||||
<ProductHistoryModal CompanyId="@CompanyId" ItemSku="@SelectedItem.Sku" @ref="HistoryModal"/>
|
OnSelected="PriceListCallback" @ref="CatalogOverlay"/>
|
||||||
|
|
||||||
|
<ProductHistoryOverlay CompanyId="@CompanyId" ItemSku="@SelectedItem.Sku" @ref="ProductOverlay"/>
|
||||||
|
|
||||||
<ProductPriceHistoryModal CompanyId="@CompanyId" Sku="@SelectedItem.Sku"
|
<ProductPriceHistoryModal CompanyId="@CompanyId" Sku="@SelectedItem.Sku"
|
||||||
OnSelected="PriceHistoryCallback" @ref="PriceHistoryModal"/>
|
OnSelected="PriceHistoryCallback" @ref="PriceOverlay"/>
|
||||||
<ConfirmProductCheckModal BodyMessage="" CompanyId="@CompanyId" Products="CheckList"
|
|
||||||
OnOkClicked="ConfirmProductCheckCallback" @ref="ConfirmProductCheckModal" />
|
<ConfirmProductCheckOverlay BodyMessage="" CompanyId="@CompanyId" Products="CheckList"
|
||||||
|
OnOkClicked="ConfirmProductCheckCallback" @ref="ProductCheckOverlay" />
|
||||||
|
|
||||||
<CustomerInvoiceOverlay CustomerInvoices="CompanyInvoices" @ref="InvoiceOverlay" />
|
<CustomerInvoiceOverlay CustomerInvoices="CompanyInvoices" @ref="InvoiceOverlay" />
|
||||||
|
|
||||||
<CustomerInventoryOverlay CompanyName="@Company.Name" CompanyId="@CompanyId" CountryCode="@Company.CountryCode"
|
<CustomerInventoryOverlay CompanyName="@Company.Name" CompanyId="@CompanyId" CountryCode="@Company.CountryCode"
|
||||||
OnInventorySelected="OnInventoryCallback" Inventory="Inventory" @ref="InventoryOverlay" />
|
OnInventorySelected="OnInventoryCallback" Inventory="Inventory" @ref="InventoryOverlay" />
|
|
@ -69,21 +69,24 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
private DateTime SelectedDate { get; set; }
|
private DateTime SelectedDate { get; set; }
|
||||||
private string OldPhone { get; set; } = "";
|
private string OldPhone { get; set; } = "";
|
||||||
private string PromptDateConfirm { get; set; } = "";
|
private string PromptDateConfirm { get; set; } = "";
|
||||||
// MODAL DIALOGS
|
|
||||||
private PriceCatalogModal PriceCatalogModal { get; set; } = new();
|
// OVERLAY PAGES
|
||||||
private ProductHistoryModal HistoryModal { get; set; } = new();
|
private PriceCatalogOverlay CatalogOverlay { get; set; } = new();
|
||||||
private ProductPriceHistoryModal PriceHistoryModal { get; set; } = new();
|
private ProductHistoryOverlay ProductOverlay { get; set; } = new();
|
||||||
private ConfirmWorkDateModal ConfirmWorkDateModal { get; set; } = new();
|
private ProductPriceHistoryModal PriceOverlay { get; set; } = new();
|
||||||
private ConfirmProductCheckModal ConfirmProductCheckModal { get; set; } = new();
|
private ConfirmWorkDateOverlay WorkDateOverlay { get; set; } = new();
|
||||||
|
private ConfirmProductCheckOverlay ProductCheckOverlay { get; set; } = new();
|
||||||
|
private CustomerInvoiceOverlay InvoiceOverlay { get; set; } = new();
|
||||||
|
private CustomerInventoryOverlay InventoryOverlay { get; set; } = new();
|
||||||
|
|
||||||
|
private List<ProductInventoryView> Inventory { get; set; } = new();
|
||||||
private List<ProductInventoryView> CheckList { get; set; } = new();
|
private List<ProductInventoryView> CheckList { get; set; } = new();
|
||||||
|
private InvoiceListView CompanyInvoices { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
private string ButtonText { get; set; } = "Gem besøg";
|
private string ButtonText { get; set; } = "Gem besøg";
|
||||||
private bool OrgWarning { get; set; }
|
private bool OrgWarning { get; set; }
|
||||||
private CustomerInvoiceOverlay InvoiceOverlay { get; set; }
|
|
||||||
private InvoiceListView CompanyInvoices { get; set; } = new();
|
|
||||||
private CustomerInventoryOverlay InventoryOverlay { get; set; } = new();
|
|
||||||
private List<ProductInventoryView> Inventory { get; set; } = new();
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Page initialization
|
/// Page initialization
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -146,7 +149,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
if (!UserPrefs.DateConfirmed)
|
if (!UserPrefs.DateConfirmed)
|
||||||
{
|
{
|
||||||
PromptDateConfirm = $"Aktiviteter oprettes med dato {SelectedDate.ToShortDateString()}. Er dette OK?";
|
PromptDateConfirm = $"Aktiviteter oprettes med dato {SelectedDate.ToShortDateString()}. Er dette OK?";
|
||||||
ConfirmWorkDateModal.Show();
|
WorkDateOverlay.Show();
|
||||||
}
|
}
|
||||||
// Lines may already have been added from the company inventory page
|
// Lines may already have been added from the company inventory page
|
||||||
if (DraftProvider.Draft.DraftType == "order")
|
if (DraftProvider.Draft.DraftType == "order")
|
||||||
|
@ -164,6 +167,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
Logger.LogDebug("ShowInventoryOverlay - wait for inventory");
|
Logger.LogDebug("ShowInventoryOverlay - wait for inventory");
|
||||||
|
|
||||||
InventoryOverlay.Show();
|
InventoryOverlay.Show();
|
||||||
|
|
||||||
Inventory = await HistoryRepo.FetchInventory(CompanyId);
|
Inventory = await HistoryRepo.FetchInventory(CompanyId);
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +227,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task CallConfirmProductCheckModel()
|
private async Task CallConfirmCheckOverlay()
|
||||||
{
|
{
|
||||||
// check if new account
|
// check if new account
|
||||||
if (string.IsNullOrWhiteSpace(Company.Account)
|
if (string.IsNullOrWhiteSpace(Company.Account)
|
||||||
|
@ -241,9 +245,10 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
Logger.LogDebug("pStorage => {}", pStorage);
|
Logger.LogDebug("pStorage => {}", pStorage);
|
||||||
// fetch pDate from storage
|
// fetch pDate from storage
|
||||||
var pDate = await Storage.GetItemAsync<string>($"{CompanyId}-pDate");
|
var pDate = await Storage.GetItemAsync<string>($"{CompanyId}-pDate");
|
||||||
|
if (string.IsNullOrWhiteSpace(pDate))
|
||||||
|
pDate = $"{DateTime.Now.AddDays(-1):yyyy-MM-dd}";
|
||||||
Logger.LogDebug("pDate => {}", pDate);
|
Logger.LogDebug("pDate => {}", pDate);
|
||||||
if (string.IsNullOrWhiteSpace(pStorage))
|
|
||||||
await Task.Delay(1000);
|
|
||||||
// check if product data is valid and updated today
|
// check if product data is valid and updated today
|
||||||
if (string.IsNullOrWhiteSpace(pStorage) || pDate.Replace("\"", "") != $"{DateTime.Now:yyyy-MM-dd}")
|
if (string.IsNullOrWhiteSpace(pStorage) || pDate.Replace("\"", "") != $"{DateTime.Now:yyyy-MM-dd}")
|
||||||
{
|
{
|
||||||
|
@ -277,12 +282,12 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show CheckList modal
|
// Show CheckList modal
|
||||||
ConfirmProductCheckModal.Show();
|
ProductCheckOverlay.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ConfirmProductCheckCallback()
|
private async Task ConfirmProductCheckCallback()
|
||||||
{
|
{
|
||||||
ConfirmProductCheckModal.Hide();
|
ProductCheckOverlay.Hide();
|
||||||
await CreateActivity();
|
await CreateActivity();
|
||||||
foreach (var item in CheckList)
|
foreach (var item in CheckList)
|
||||||
{
|
{
|
||||||
|
@ -298,7 +303,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
private async Task WorkDateConfirmCallback()
|
private async Task WorkDateConfirmCallback()
|
||||||
{
|
{
|
||||||
await Profiles.SetDateConfirmed(true);
|
await Profiles.SetDateConfirmed(true);
|
||||||
ConfirmWorkDateModal.Hide();
|
WorkDateOverlay.Hide();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,9 +321,9 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show Price list modal
|
/// Show Price list modal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void CallPriceListModal()
|
private void ShowPriceListOverlay()
|
||||||
{
|
{
|
||||||
PriceCatalogModal.Show();
|
CatalogOverlay.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -340,10 +345,10 @@ public partial class AdvisorActivityCreatePage : IDisposable
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show Price History modal
|
/// Show Price History modal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void CallPriceHistoryModal()
|
private void ShowPriceHistoryOverlay()
|
||||||
{
|
{
|
||||||
if(ShowItem)
|
if(ShowItem)
|
||||||
PriceHistoryModal.Show();
|
PriceOverlay.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -80,13 +80,18 @@ public partial class AdvisorCustomerInvoiceListPage : IDisposable
|
||||||
}
|
}
|
||||||
Logger.LogDebug("pulling invoices from backend");
|
Logger.LogDebug("pulling invoices from backend");
|
||||||
// pull invoices
|
// pull invoices
|
||||||
var invoices = await HistoryRepo.FetchInvoiceList(_companyId);
|
var companyInvoices = await HistoryRepo.FetchInvoiceList(_companyId);
|
||||||
|
if (companyInvoices.Invoices.Any())
|
||||||
|
companyInvoices.Invoices = companyInvoices.Invoices
|
||||||
|
.OrderByDescending(x => x.DocumentDate)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
// send invoices to storage
|
// send invoices to storage
|
||||||
await Storage.SetItemAsync($"{_companyId}-invoices", invoices);
|
await Storage.SetItemAsync($"{_companyId}-invoices", companyInvoices);
|
||||||
await Storage.SetItemAsync($"{_companyId}-iDate", $"{DateTime.Now:yyyy-MM-dd}");
|
await Storage.SetItemAsync($"{_companyId}-iDate", $"{DateTime.Now:yyyy-MM-dd}");
|
||||||
Logger.LogDebug("return invoices from backend");
|
Logger.LogDebug("return invoices from backend");
|
||||||
Working = false;
|
Working = false;
|
||||||
return invoices;
|
return companyInvoices;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|
|
@ -225,4 +225,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<PriceCatalogModal OnSelected="PriceListCallback" @ref="PriceCatalog"/>
|
<PriceCatalogOverlay OnSelected="PriceListCallback" @ref="PriceCatalog"/>
|
|
@ -59,7 +59,7 @@ public partial class OfficeCustomerCreatePhoneOrderPage : IDisposable
|
||||||
private bool ReportClosed { get; set; }
|
private bool ReportClosed { get; set; }
|
||||||
private bool PoFormInvalid { get; set; } = true;
|
private bool PoFormInvalid { get; set; } = true;
|
||||||
private bool Working { get; set; }
|
private bool Working { get; set; }
|
||||||
private PriceCatalogModal PriceCatalog { get; set; } = new();
|
private PriceCatalogOverlay PriceCatalog { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<h3>Sælgere</h3>
|
<h3>Sælgere</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<OfficeCountrySalesRepListComponent UserList="SalesReps" />
|
<OfficeCountryAdvisorListComponent UserList="SalesReps" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,11 @@
|
||||||
<EditForm EditContext="_passwdContext" class="mt-5" >
|
<EditForm EditContext="_passwdContext" class="mt-5" >
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<h3>NULSTIL ADGANGSKODE</h3>
|
<h3>NULSTIL ADGANGSKODE</h3>
|
||||||
|
<div class="alert-info">
|
||||||
|
<h4>Password politik</h4>
|
||||||
|
<p>Mindst 10 tegn bestående af store og små bogstaver samt tal.</p>
|
||||||
|
<p>Du kan teste pasword og danne stærke password på <a href="https://pw.nix.dk">pw.nix.dk</a></p>
|
||||||
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="newPasswd" class="col-md-2 col-form-label">Ny</label>
|
<label for="newPasswd" class="col-md-2 col-form-label">Ny</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|
|
@ -18,7 +18,7 @@ using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Shared;
|
namespace Wonky.Client.Shared;
|
||||||
|
|
||||||
public partial class ConfirmProductCheckModal
|
public partial class ConfirmProductCheckOverlay
|
||||||
{
|
{
|
||||||
private string _modalDisplay = "";
|
private string _modalDisplay = "";
|
||||||
private bool _showBackdrop;
|
private bool _showBackdrop;
|
|
@ -17,7 +17,7 @@ using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace Wonky.Client.Shared;
|
namespace Wonky.Client.Shared;
|
||||||
|
|
||||||
public partial class ConfirmWorkDateModal
|
public partial class ConfirmWorkDateOverlay
|
||||||
{
|
{
|
||||||
private string _modalDisplay = "";
|
private string _modalDisplay = "";
|
||||||
private bool _showBackdrop;
|
private bool _showBackdrop;
|
|
@ -22,7 +22,8 @@ public partial class CustomerInvoiceOverlay
|
||||||
{
|
{
|
||||||
Company = CustomerInvoices.Company;
|
Company = CustomerInvoices.Company;
|
||||||
Logger.LogDebug("company => {}", JsonSerializer.Serialize(Company));
|
Logger.LogDebug("company => {}", JsonSerializer.Serialize(Company));
|
||||||
Invoices = CustomerInvoices.Invoices;
|
if (CustomerInvoices.Invoices.Any())
|
||||||
|
Invoices = CustomerInvoices.Invoices.OrderByDescending(x => x.DocumentDate).ToList();
|
||||||
Logger.LogDebug("invoices => {}", JsonSerializer.Serialize(Invoices));
|
Logger.LogDebug("invoices => {}", JsonSerializer.Serialize(Invoices));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Shared;
|
namespace Wonky.Client.Shared;
|
||||||
|
|
||||||
public partial class PriceCatalogModal : IDisposable
|
public partial class PriceCatalogOverlay : IDisposable
|
||||||
{
|
{
|
||||||
[Parameter] public string CountryCode { get; set; } = "";
|
[Parameter] public string CountryCode { get; set; } = "";
|
||||||
[Parameter] public EventCallback<SelectedSku> OnSelected { get; set; }
|
[Parameter] public EventCallback<SelectedSku> OnSelected { get; set; }
|
|
@ -24,7 +24,7 @@ using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Shared;
|
namespace Wonky.Client.Shared;
|
||||||
|
|
||||||
public partial class ProductHistoryModal
|
public partial class ProductHistoryOverlay
|
||||||
{
|
{
|
||||||
// [Parameter] public EventCallback<decimal> OnSelected { get; set; }
|
// [Parameter] public EventCallback<decimal> OnSelected { get; set; }
|
||||||
[Parameter] public string CompanyId { get; set; } = "";
|
[Parameter] public string CompanyId { get; set; } = "";
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"appInfo": {
|
"appInfo": {
|
||||||
"name": "Wonky Online",
|
"name": "Wonky Online",
|
||||||
"version": "0.106.6",
|
"version": "0.106.13",
|
||||||
"rc": true,
|
"rc": true,
|
||||||
"sandBox": false,
|
"sandBox": false,
|
||||||
"image": "grumpy-coder.png"
|
"image": "grumpy-coder.png"
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Debug",
|
||||||
"System": "Information",
|
"System": "Information",
|
||||||
"Microsoft": "Information"
|
"Microsoft": "Information"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue