From c523e9a4757c9d3e92b4145c601c9767340cf0be Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Mon, 5 Jun 2023 07:15:39 +0200 Subject: [PATCH] Rename ActivityButton to ActionButton - implement action button Rename RPC variable to sync Added force parameter to sync URL (TODO - make it work) Add headers to modals to ensure the close button is pushed to the right Make ConfirmDeleteModal a generic ConfirmActionModel --- ...ctivityButton.razor => ActionButton.razor} | 0 ...yButton.razor.cs => ActionButton.razor.cs} | 2 +- .../AdvisorCustomerListComponent.razor | 2 +- .../CountryCustomerHistoryRepository.cs | 2 +- .../CrmCustomerHistoryRepository.cs | 9 ++-- .../ICrmCustomerHistoryRepository.cs | 3 +- .../CustomerActivityViewOverlay.razor | 3 +- .../CustomerInvoiceListOverlay.razor | 5 +- .../CustomerInvoiceViewOverlay.razor | 5 +- .../Pages/AdvisorActivityCreatePage.razor.cs | 2 +- .../Pages/AdvisorCustomerViewEditPage.razor | 43 ++++++++++------- .../AdvisorCustomerViewEditPage.razor.cs | 47 +++++++++++++++++-- ...AdvisorCustomerWorkplaceViewEditPage.razor | 4 +- ...isorCustomerWorkplaceViewEditPage.razor.cs | 10 ++-- ...teModal.razor => ConfirmActionModal.razor} | 6 +-- ...l.razor.cs => ConfirmActionModal.razor.cs} | 2 +- Wonky.Client/wwwroot/appsettings.json | 6 +-- Wonky.Entity/Configuration/ApiConfig.cs | 4 +- 18 files changed, 99 insertions(+), 56 deletions(-) rename Wonky.Client/Components/{ActivityButton.razor => ActionButton.razor} (100%) rename Wonky.Client/Components/{ActivityButton.razor.cs => ActionButton.razor.cs} (97%) rename Wonky.Client/Shared/{ConfirmDeleteModal.razor => ConfirmActionModal.razor} (89%) rename Wonky.Client/Shared/{ConfirmDeleteModal.razor.cs => ConfirmActionModal.razor.cs} (97%) diff --git a/Wonky.Client/Components/ActivityButton.razor b/Wonky.Client/Components/ActionButton.razor similarity index 100% rename from Wonky.Client/Components/ActivityButton.razor rename to Wonky.Client/Components/ActionButton.razor diff --git a/Wonky.Client/Components/ActivityButton.razor.cs b/Wonky.Client/Components/ActionButton.razor.cs similarity index 97% rename from Wonky.Client/Components/ActivityButton.razor.cs rename to Wonky.Client/Components/ActionButton.razor.cs index 6ff76580..53d379e2 100644 --- a/Wonky.Client/Components/ActivityButton.razor.cs +++ b/Wonky.Client/Components/ActionButton.razor.cs @@ -17,7 +17,7 @@ using Microsoft.AspNetCore.Components; namespace Wonky.Client.Components; -public partial class ActivityButton +public partial class ActionButton { [Parameter]public string CompanyId { get; set; } = ""; [Parameter] public int Enabled { get; set; } diff --git a/Wonky.Client/Components/AdvisorCustomerListComponent.razor b/Wonky.Client/Components/AdvisorCustomerListComponent.razor index fcd71d04..10cb1357 100644 --- a/Wonky.Client/Components/AdvisorCustomerListComponent.razor +++ b/Wonky.Client/Components/AdvisorCustomerListComponent.razor @@ -56,7 +56,7 @@ @company.City - diff --git a/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs b/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs index f9ed4f9a..3f071bf7 100644 --- a/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs +++ b/Wonky.Client/HttpRepository/CountryCustomerHistoryRepository.cs @@ -133,7 +133,7 @@ public class CountryCustomerHistoryRepository : ICountryCustomerHistoryRepositor public async Task RequestErpToCrmSync(string countryCode, string companyId, string syncDate) { var response = await _client - .GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.SyncRpcInvoiceExt}/{syncDate}"); + .GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.SyncInvoice}/{syncDate}"); var content = await response.Content.ReadAsStringAsync(); diff --git a/Wonky.Client/HttpRepository/CrmCustomerHistoryRepository.cs b/Wonky.Client/HttpRepository/CrmCustomerHistoryRepository.cs index c6348a7d..55298c30 100644 --- a/Wonky.Client/HttpRepository/CrmCustomerHistoryRepository.cs +++ b/Wonky.Client/HttpRepository/CrmCustomerHistoryRepository.cs @@ -112,13 +112,14 @@ public class CrmCustomerHistoryRepository : ICrmCustomerHistoryRepository } - public async Task InvoiceErpToCrmRpc(string companyId, string syncDate) + public async Task GetRecycledInvoiceList(string companyId, string syncDate, bool force) { - var x = await _client.GetAsync($"{_api.SyncRpc}/companies/{companyId}/invoices/{syncDate}"); - if (!x.IsSuccessStatusCode) + var x = await _client.GetAsync($"{_api.SyncInvoice}/{companyId}/{syncDate}?force={force}"); + var content = await x.Content.ReadAsStringAsync(); + if (!x.IsSuccessStatusCode || string.IsNullOrWhiteSpace(content)) { return string.Empty; } - return await x.Content.ReadAsStringAsync(); + return content.Trim('"'); } } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/ICrmCustomerHistoryRepository.cs b/Wonky.Client/HttpRepository/ICrmCustomerHistoryRepository.cs index 8bfb2ef1..71e880f4 100644 --- a/Wonky.Client/HttpRepository/ICrmCustomerHistoryRepository.cs +++ b/Wonky.Client/HttpRepository/ICrmCustomerHistoryRepository.cs @@ -72,6 +72,7 @@ public interface ICrmCustomerHistoryRepository /// /// /// + /// /// - Task InvoiceErpToCrmRpc(string companyId, string syncDate); + Task GetRecycledInvoiceList(string companyId, string syncDate, bool force); } \ No newline at end of file diff --git a/Wonky.Client/OverlayCustomer/CustomerActivityViewOverlay.razor b/Wonky.Client/OverlayCustomer/CustomerActivityViewOverlay.razor index 251a71b9..e3beada5 100644 --- a/Wonky.Client/OverlayCustomer/CustomerActivityViewOverlay.razor +++ b/Wonky.Client/OverlayCustomer/CustomerActivityViewOverlay.razor @@ -17,13 +17,14 @@