bump sdk 7.0.400 redirect kanvas customer to visit

This commit is contained in:
Frede Hundewadt 2023-08-11 11:56:15 +02:00
parent 7b87fa6b88
commit e30acdb005
5 changed files with 287 additions and 311 deletions

View file

@ -34,8 +34,6 @@
</div> </div>
</div> </div>
<div class="col-sm-6 text-end"> <div class="col-sm-6 text-end">
@if (!_kanvas)
{
@if (_userInfo.CountryCode is "DK") @if (_userInfo.CountryCode is "DK")
{ {
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/workplaces/new"><i class="bi-plus-lg"></i> Arbejdssted</a> <a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/workplaces/new"><i class="bi-plus-lg"></i> Arbejdssted</a>
@ -49,7 +47,6 @@
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/statistic" disabled="@(_company.Account.StartsWith("NY"))"><i class="bi-activity"></i> Statistik</a> <a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/statistic" disabled="@(_company.Account.StartsWith("NY"))"><i class="bi-activity"></i> Statistik</a>
} }
<button class="btn btn-secondary btn-sm me-2" @onclick="@(() => ReloadHistory(true))" disabled="@(_working || _company.Account.StartsWith("NY"))"><i class="bi-repeat"></i> Historik</button> <button class="btn btn-secondary btn-sm me-2" @onclick="@(() => ReloadHistory(true))" disabled="@(_working || _company.Account.StartsWith("NY"))"><i class="bi-repeat"></i> Historik</button>
}
<a class="btn btn-primary btn-sm me-2" href="/advisor/customers"><i class="bi-chevron-left"></i> Tilbage</a> <a class="btn btn-primary btn-sm me-2" href="/advisor/customers"><i class="bi-chevron-left"></i> Tilbage</a>
</div> </div>
</div> </div>
@ -118,8 +115,6 @@
<ValidationMessage For="@(() => _company.EanNumber)"></ValidationMessage> <ValidationMessage For="@(() => _company.EanNumber)"></ValidationMessage>
</div> </div>
@if (!_kanvas)
{
@* entity segment *@ @* entity segment *@
@if (_userInfo.CountryCode.ToLower() == "dk") @if (_userInfo.CountryCode.ToLower() == "dk")
{ {
@ -192,7 +187,7 @@
<div class="col-sm-3 d-grid mx-auto"> <div class="col-sm-3 d-grid mx-auto">
<button type="button" class="btn btn-warning d-block" @onclick="@UpdateVatNumber" disabled="@(_vatEditDisabled)"><i class="bi-cloud-arrow-up"></i> Moms/Org Nr.</button> <button type="button" class="btn btn-warning d-block" @onclick="@UpdateVatNumber" disabled="@(_vatEditDisabled)"><i class="bi-cloud-arrow-up"></i> Moms/Org Nr.</button>
</div> </div>
}
</div> </div>
@ -200,31 +195,22 @@
@* activity buttons *@ @* activity buttons *@
<div class="row mt-3 mb-3"> <div class="row mt-3 mb-3">
<div class="col-sm-3"> <div class="col-sm-3">
@if (!_kanvas)
{
<ActionButton ActionLink="@_invoiceLink" <ActionButton ActionLink="@_invoiceLink"
ButtonText="Faktura" ButtonText="Faktura"
ButtonType="danger" ButtonType="danger"
Enabled="@_enableLink"/> Enabled="@_enableLink"/>
}
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
@if (!_kanvas)
{
<ActionButton ActionLink="@_activitiesLink" <ActionButton ActionLink="@_activitiesLink"
ButtonText="Tidl. Besøg" ButtonText="Tidl. Besøg"
ButtonType="warning" ButtonType="warning"
Enabled="@_enableLink"/> Enabled="@_enableLink"/>
}
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
@if (!_kanvas )
{
<ActionButton ActionLink="@_inventoryLink" <ActionButton ActionLink="@_inventoryLink"
ButtonText="Produkter" ButtonText="Produkter"
ButtonType="success" ButtonType="success"
Enabled="@_enableLink"/> Enabled="@_enableLink"/>
}
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<ActionButton ActionLink="@_newActivityLink" <ActionButton ActionLink="@_newActivityLink"
@ -235,8 +221,6 @@
</div> </div>
</div> </div>
@if (!_kanvas)
{
<hr class="mb-3"/> <hr class="mb-3"/>
@* crm context - OBS note *@ @* crm context - OBS note *@
<div class="row mb-2"> <div class="row mb-2">
@ -320,10 +304,8 @@
<InputTextArea id="crmNotes" class="form-control" @bind-Value="_company.CrmNotes"/> <InputTextArea id="crmNotes" class="form-control" @bind-Value="_company.CrmNotes"/>
</div> </div>
</div> </div>
}
</EditForm> </EditForm>
@if (!_kanvas)
{
<hr class="mb-3"/> <hr class="mb-3"/>
<div class="row pt-3 mb-5"> <div class="row pt-3 mb-5">
<div class="col-sm-4 d-grid"> <div class="col-sm-4 d-grid">
@ -337,7 +319,6 @@
</div> </div>
</div> </div>
} }
}
@if (_working) @if (_working)
{ {

View file

@ -77,7 +77,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
private bool _erpEditDisabled = true; private bool _erpEditDisabled = true;
private bool _vatEditDisabled = true; private bool _vatEditDisabled = true;
private string _toggleButtonText = ""; private string _toggleButtonText = "";
private bool _kanvas;
private string _inventoryLink = ""; private string _inventoryLink = "";
private string _activitiesLink = ""; private string _activitiesLink = "";
private string _invoiceLink = ""; private string _invoiceLink = "";
@ -117,13 +116,23 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
_erpFormContext = new EditContext(_company); _erpFormContext = new EditContext(_company);
_erpFormContext.OnFieldChanged += HandleFieldChanged; _erpFormContext.OnFieldChanged += HandleFieldChanged;
_erpFormContext.OnValidationStateChanged += ValidationChanged!; _erpFormContext.OnValidationStateChanged += ValidationChanged!;
/*
* fetch company
*/
_company = await AdvisorCustomerRepo.GetCompanyById(CompanyId);
/*
* redirect if KANVAS
*/
if (_company.Account.StartsWith("KANVAS"))
{
Navigator.NavigateTo($"/advisor/customers/{CompanyId}/activities/new");
}
/* /*
* fetch user info from local storage * fetch user info from local storage
*/ */
_userInfo = await UserInfoService.GetUserInfo(); _userInfo = await UserInfoService.GetUserInfo();
_countryCode = _userInfo.CountryCode.ToLower(); _countryCode = _userInfo.CountryCode.ToLower();
_countryIsDk = _countryCode == "dk"; _countryIsDk = _countryCode == "dk";
_company = await AdvisorCustomerRepo.GetCompanyById(CompanyId);
_infoDrawer = await DrawerService.GetInfoDrawerAsync(CompanyId); _infoDrawer = await DrawerService.GetInfoDrawerAsync(CompanyId);
_infoDrawer.Content = _company; _infoDrawer.Content = _company;
await DrawerService.StoreInfoDrawerAsync(CompanyId, _infoDrawer); await DrawerService.StoreInfoDrawerAsync(CompanyId, _infoDrawer);
@ -139,16 +148,9 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
{ {
_enableActivity = 1; _enableActivity = 1;
} }
if (_company.Account.StartsWith("KANVAS"))
{
_kanvas = true;
Navigator.NavigateTo($"/advisor/customers/{CompanyId}/activities/new");
}
/* /*
* only execute if the InfoDrawer.Company is not KANVAS * only execute if the InfoDrawer.Company is not KANVAS
*/ */
if (!_kanvas)
{
Logger.LogDebug("_company => {}", JsonSerializer.Serialize(_company)); Logger.LogDebug("_company => {}", JsonSerializer.Serialize(_company));
/* /*
* toggle view button text * toggle view button text
@ -213,7 +215,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
_companyVatAddress = PrepareVatAddress(_company); _companyVatAddress = PrepareVatAddress(_company);
} }
// await GetContacts(CompanyId); // await GetContacts(CompanyId);
}
/* /*
* remove loading image * remove loading image
*/ */
@ -223,9 +224,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
protected override async Task OnAfterRenderAsync(bool firstRender) protected override async Task OnAfterRenderAsync(bool firstRender)
{ {
if (_kanvas)
return;
if (firstRender) if (firstRender)
{ {
await GetContacts(CompanyId); await GetContacts(CompanyId);
@ -240,9 +238,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
private async Task ReloadHistory(bool force = false) private async Task ReloadHistory(bool force = false)
{ {
if (_kanvas)
return;
if (force) if (force)
{ {
Toaster.ShowInfo("Afventer svar fra tjenester ..."); Toaster.ShowInfo("Afventer svar fra tjenester ...");

View file

@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Toolbelt.Blazor;
using Wonky.Client.HttpInterceptors; using Wonky.Client.HttpInterceptors;
using Wonky.Client.HttpRepository; using Wonky.Client.HttpRepository;
using Wonky.Entity.Views; using Wonky.Entity.Views;
@ -16,6 +15,7 @@ public partial class CatalogProductDetailPage
// ############################################################## // ##############################################################
[Parameter] public string SalesItemId { get; set; } = ""; [Parameter] public string SalesItemId { get; set; } = "";
[Parameter] public string CustomerId { get; set; } = "";
// ############################################################## // ##############################################################
private ProductDetailView _item = new(); private ProductDetailView _item = new();

View file

@ -11,11 +11,11 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" /> <PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
<PackageReference Include="Blazored.Toast" Version="4.1.0" /> <PackageReference Include="Blazored.Toast" Version="4.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.0.9" /> <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.9" /> <PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="7.0.9" /> <PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.9" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.9" PrivateAssets="all" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.10" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" />

View file

@ -1,8 +1,8 @@
{ {
"appInfo": { "appInfo": {
"name": "Wonky Online", "name": "Wonky Online",
"version": "211.0", "version": "213.0",
"rc": true, "rc": false,
"sandBox": true, "sandBox": true,
"image": "grumpy-coder.png", "image": "grumpy-coder.png",
"sdk": "dotnet 7.0" "sdk": "dotnet 7.0"
@ -21,7 +21,7 @@
}, },
"apiConfig": { "apiConfig": {
"assetUrl": "https://files.innotec.dk", "assetUrl": "https://files.innotec.dk",
"baseUrl": "https://eta.innotec.dk", "baseUrl": "https://dev.innotec.dk",
"catalog": "api/v2/catalog/country", "catalog": "api/v2/catalog/country",
"crmCustomers": "api/v2/crm/companies", "crmCustomers": "api/v2/crm/companies",
"crmReports": "api/v2/crm/advisors/reports", "crmReports": "api/v2/crm/advisors/reports",