From a4e9598fa37d85d54a455e774d441eb3e096b20e Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Sat, 31 Dec 2022 13:53:02 +0100 Subject: [PATCH] refactor for country landing pages --- .../CountrySalesRepListComponent.razor | 44 +++++++++++++ ... => CountrySalesRepListComponent.razor.cs} | 2 +- .../Components/LandingComponentAdmin.razor | 45 ++----------- .../OfficeAdvisorTableComponent.razor | 58 ----------------- .../Components/WarehouseListComponent.razor | 15 ++--- Wonky.Client/Models/VatAddress.cs | 2 + ...CatalogCrmPage.razor => CatalogPage.razor} | 0 ...gCrmPage.razor.cs => CatalogPage.razor.cs} | 2 +- ...tryPage.razor => CountryCatalogPage.razor} | 0 ...e.razor.cs => CountryCatalogPage.razor.cs} | 2 +- ...ge.razor => CountryCustomerListPage.razor} | 0 ...or.cs => CountryCustomerListPage.razor.cs} | 2 +- Wonky.Client/Pages/CountryLandingPage.razor | 64 +++++++++++++++++++ .../Pages/CountryLandingPage.razor.cs | 11 ++++ ... => CountrySalesRepCustomerListPage.razor} | 2 +- ... CountrySalesRepCustomerListPage.razor.cs} | 4 +- ...ge.razor => CountrySalesRepListPage.razor} | 2 +- .../Pages/CountrySalesRepListPage.razor.cs | 31 +++++++++ ...> CustomerWorkplaceDocumentListPage.razor} | 0 ...ustomerWorkplaceDocumentListPage.razor.cs} | 2 +- ....razor => CustomerWorkplaceListPage.razor} | 0 ....cs => CustomerWorkplaceListPage.razor.cs} | 2 +- ....razor => CustomerWorkplaceViewPage.razor} | 0 ....cs => CustomerWorkplaceViewPage.razor.cs} | 2 +- Wonky.Client/Pages/Index.razor | 18 +++--- .../Pages/LandingPageAdminAdvisers.razor | 39 ----------- .../Pages/LandingPageAdminCountry.razor | 30 --------- .../Pages/LandingPageAdminUsers.razor | 30 --------- ...cePage.razor => OfficeOrderViewPage.razor} | 2 +- ....razor.cs => OfficeOrderViewPage.razor.cs} | 4 +- ...azor.css => OfficeOrderViewPage.razor.css} | 0 ...age.razor => OfficeSalesRepViewPage.razor} | 2 +- ...zor.cs => OfficeSalesRepViewPage.razor.cs} | 4 +- Wonky.Client/Pages/PrintCatalogPage.razor | 4 +- Wonky.Client/Pages/PrintFrontPage.razor | 2 +- Wonky.Client/Pages/PrintOrderPage.razor | 2 +- Wonky.Client/Pages/QuoteListCrmPage.razor | 20 +++++- Wonky.Client/Pages/ReportListCrmPage.razor | 2 + Wonky.Client/Pages/ReportViewCrmPage.razor | 2 +- Wonky.Client/Pages/ReportViewOfficePage.razor | 2 +- .../Pages/UserListOfficePage.razor.cs | 49 -------------- ...age.razor => WarehouseOrderListPage.razor} | 6 -- .../Pages/WarehouseOrderListPage.razor.cs | 8 +++ ...age.razor => WarehouseOrderViewPage.razor} | 0 ...zor.cs => WarehouseOrderViewPage.razor.cs} | 4 +- Wonky.Client/Program.cs | 7 +- Wonky.Client/Shared/NavMenu.razor | 4 +- 47 files changed, 232 insertions(+), 301 deletions(-) create mode 100644 Wonky.Client/Components/CountrySalesRepListComponent.razor rename Wonky.Client/Components/{OfficeAdvisorTableComponent.razor.cs => CountrySalesRepListComponent.razor.cs} (95%) delete mode 100644 Wonky.Client/Components/OfficeAdvisorTableComponent.razor rename Wonky.Client/Pages/{CatalogCrmPage.razor => CatalogPage.razor} (100%) rename Wonky.Client/Pages/{CatalogCrmPage.razor.cs => CatalogPage.razor.cs} (98%) rename Wonky.Client/Pages/{CatalogCountryPage.razor => CountryCatalogPage.razor} (100%) rename Wonky.Client/Pages/{CatalogCountryPage.razor.cs => CountryCatalogPage.razor.cs} (98%) rename Wonky.Client/Pages/{CustomerListCountryPage.razor => CountryCustomerListPage.razor} (100%) rename Wonky.Client/Pages/{CustomerListCountryPage.razor.cs => CountryCustomerListPage.razor.cs} (98%) create mode 100644 Wonky.Client/Pages/CountryLandingPage.razor create mode 100644 Wonky.Client/Pages/CountryLandingPage.razor.cs rename Wonky.Client/Pages/{UserListSalesRepPage.razor => CountrySalesRepCustomerListPage.razor} (97%) rename Wonky.Client/Pages/{UserListSalesRepPage.razor.cs => CountrySalesRepCustomerListPage.razor.cs} (96%) rename Wonky.Client/Pages/{UserListOfficePage.razor => CountrySalesRepListPage.razor} (94%) create mode 100644 Wonky.Client/Pages/CountrySalesRepListPage.razor.cs rename Wonky.Client/Pages/{WorkplaceDocumentListPage.razor => CustomerWorkplaceDocumentListPage.razor} (100%) rename Wonky.Client/Pages/{WorkplaceDocumentListPage.razor.cs => CustomerWorkplaceDocumentListPage.razor.cs} (95%) rename Wonky.Client/Pages/{WorkplaceListPage.razor => CustomerWorkplaceListPage.razor} (100%) rename Wonky.Client/Pages/{WorkplaceListPage.razor.cs => CustomerWorkplaceListPage.razor.cs} (97%) rename Wonky.Client/Pages/{WorkplaceViewPage.razor => CustomerWorkplaceViewPage.razor} (100%) rename Wonky.Client/Pages/{WorkplaceViewPage.razor.cs => CustomerWorkplaceViewPage.razor.cs} (97%) delete mode 100644 Wonky.Client/Pages/LandingPageAdminAdvisers.razor delete mode 100644 Wonky.Client/Pages/LandingPageAdminCountry.razor delete mode 100644 Wonky.Client/Pages/LandingPageAdminUsers.razor rename Wonky.Client/Pages/{OrderViewOfficePage.razor => OfficeOrderViewPage.razor} (98%) rename Wonky.Client/Pages/{OrderViewOfficePage.razor.cs => OfficeOrderViewPage.razor.cs} (97%) rename Wonky.Client/Pages/{OrderViewOfficePage.razor.css => OfficeOrderViewPage.razor.css} (100%) rename Wonky.Client/Pages/{UserViewOfficePage.razor => OfficeSalesRepViewPage.razor} (100%) rename Wonky.Client/Pages/{UserViewOfficePage.razor.cs => OfficeSalesRepViewPage.razor.cs} (97%) delete mode 100644 Wonky.Client/Pages/UserListOfficePage.razor.cs rename Wonky.Client/Pages/{OrderListWarehousePage.razor => WarehouseOrderListPage.razor} (93%) create mode 100644 Wonky.Client/Pages/WarehouseOrderListPage.razor.cs rename Wonky.Client/Pages/{OrderViewWarehousePage.razor => WarehouseOrderViewPage.razor} (100%) rename Wonky.Client/Pages/{OrderViewWarehousePage.razor.cs => WarehouseOrderViewPage.razor.cs} (96%) diff --git a/Wonky.Client/Components/CountrySalesRepListComponent.razor b/Wonky.Client/Components/CountrySalesRepListComponent.razor new file mode 100644 index 00000000..45fae0fa --- /dev/null +++ b/Wonky.Client/Components/CountrySalesRepListComponent.razor @@ -0,0 +1,44 @@ +@* +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// +*@ + +
+ @if (UserList.Any()) + { + foreach (var user in UserList) + { +
+
+
@user.FullName
+
@user.PhoneNumber
+
+ Rapporter +
+
+ Kunder +
+
+ Rediger +
+
+
+ } + } + else + { +
Ingen data
+ } +
\ No newline at end of file diff --git a/Wonky.Client/Components/OfficeAdvisorTableComponent.razor.cs b/Wonky.Client/Components/CountrySalesRepListComponent.razor.cs similarity index 95% rename from Wonky.Client/Components/OfficeAdvisorTableComponent.razor.cs rename to Wonky.Client/Components/CountrySalesRepListComponent.razor.cs index 5d15be7d..c9048872 100644 --- a/Wonky.Client/Components/OfficeAdvisorTableComponent.razor.cs +++ b/Wonky.Client/Components/CountrySalesRepListComponent.razor.cs @@ -19,7 +19,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Components; -public partial class OfficeAdvisorTableComponent +public partial class CountrySalesRepListComponent { [Parameter] public List UserList { get; set; } = new(); } \ No newline at end of file diff --git a/Wonky.Client/Components/LandingComponentAdmin.razor b/Wonky.Client/Components/LandingComponentAdmin.razor index 62f24364..698e787f 100644 --- a/Wonky.Client/Components/LandingComponentAdmin.razor +++ b/Wonky.Client/Components/LandingComponentAdmin.razor @@ -20,41 +20,10 @@ Innotec Admin -@*
-
-
- -
-
-
- Danmark -
-
-
-
- -
-
-
- -
-
-
- Norge -
-
-
-
- -
-
-
- -
-
-
- Sverige -
-
-
-
*@ \ No newline at end of file +
+
+
+
+
+
+
\ No newline at end of file diff --git a/Wonky.Client/Components/OfficeAdvisorTableComponent.razor b/Wonky.Client/Components/OfficeAdvisorTableComponent.razor deleted file mode 100644 index b645e485..00000000 --- a/Wonky.Client/Components/OfficeAdvisorTableComponent.razor +++ /dev/null @@ -1,58 +0,0 @@ -@* -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] -// -*@ - -@if (UserList.Any()) -{ - - - - - - - - - - - - @foreach (var user in UserList) - { - - - - - - - - - } - -
- Navn - - Telefon - - Email - - - - -
@user.FullName@user.PhoneNumber@user.EmailRapporterKunderRediger
-} -else -{ -
Ingen data
-} \ No newline at end of file diff --git a/Wonky.Client/Components/WarehouseListComponent.razor b/Wonky.Client/Components/WarehouseListComponent.razor index 283e34ee..ecfebb74 100644 --- a/Wonky.Client/Components/WarehouseListComponent.razor +++ b/Wonky.Client/Components/WarehouseListComponent.razor @@ -16,29 +16,26 @@ *@
-
+
- + - + - - - - +
-
+
-
+
@if (ReadyToShip && OrderList.Any()) { diff --git a/Wonky.Client/Models/VatAddress.cs b/Wonky.Client/Models/VatAddress.cs index 5f8bf783..f5bf5049 100644 --- a/Wonky.Client/Models/VatAddress.cs +++ b/Wonky.Client/Models/VatAddress.cs @@ -25,11 +25,13 @@ public class VatAddress /// [Required(ErrorMessage = "Vejnavn skal angives")] public string StreetName { get; set; } = ""; + /// /// House Number /// [Required(ErrorMessage = "Husnummer skal angives")] public string HouseNumber { get; set; } = ""; + /// /// Postal Code /// diff --git a/Wonky.Client/Pages/CatalogCrmPage.razor b/Wonky.Client/Pages/CatalogPage.razor similarity index 100% rename from Wonky.Client/Pages/CatalogCrmPage.razor rename to Wonky.Client/Pages/CatalogPage.razor diff --git a/Wonky.Client/Pages/CatalogCrmPage.razor.cs b/Wonky.Client/Pages/CatalogPage.razor.cs similarity index 98% rename from Wonky.Client/Pages/CatalogCrmPage.razor.cs rename to Wonky.Client/Pages/CatalogPage.razor.cs index d681e3b2..6694e238 100644 --- a/Wonky.Client/Pages/CatalogCrmPage.razor.cs +++ b/Wonky.Client/Pages/CatalogPage.razor.cs @@ -29,7 +29,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Pages; -public partial class CatalogCrmPage : IDisposable +public partial class CatalogPage : IDisposable { [Inject] public ILocalStorageService Storage { get; set; } [Inject] public ICatalogCrmHttpRepository ItemRepo { get; set; } diff --git a/Wonky.Client/Pages/CatalogCountryPage.razor b/Wonky.Client/Pages/CountryCatalogPage.razor similarity index 100% rename from Wonky.Client/Pages/CatalogCountryPage.razor rename to Wonky.Client/Pages/CountryCatalogPage.razor diff --git a/Wonky.Client/Pages/CatalogCountryPage.razor.cs b/Wonky.Client/Pages/CountryCatalogPage.razor.cs similarity index 98% rename from Wonky.Client/Pages/CatalogCountryPage.razor.cs rename to Wonky.Client/Pages/CountryCatalogPage.razor.cs index 3d84f092..91c96104 100644 --- a/Wonky.Client/Pages/CatalogCountryPage.razor.cs +++ b/Wonky.Client/Pages/CountryCatalogPage.razor.cs @@ -29,7 +29,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Pages; -public partial class CatalogCountryPage : IDisposable +public partial class CountryCatalogPage : IDisposable { [Parameter] public string CountryCode { get; set; } = ""; [Inject] public ILocalStorageService Storage { get; set; } diff --git a/Wonky.Client/Pages/CustomerListCountryPage.razor b/Wonky.Client/Pages/CountryCustomerListPage.razor similarity index 100% rename from Wonky.Client/Pages/CustomerListCountryPage.razor rename to Wonky.Client/Pages/CountryCustomerListPage.razor diff --git a/Wonky.Client/Pages/CustomerListCountryPage.razor.cs b/Wonky.Client/Pages/CountryCustomerListPage.razor.cs similarity index 98% rename from Wonky.Client/Pages/CustomerListCountryPage.razor.cs rename to Wonky.Client/Pages/CountryCustomerListPage.razor.cs index 0ce0fddb..39c269e5 100644 --- a/Wonky.Client/Pages/CustomerListCountryPage.razor.cs +++ b/Wonky.Client/Pages/CountryCustomerListPage.razor.cs @@ -28,7 +28,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Pages { - public partial class CustomerListCountryPage : IDisposable + public partial class CountryCustomerListPage : IDisposable { [Parameter] public string CountryCode { get; set; } = ""; [Inject] public ILocalStorageService Storage { get; set; } diff --git a/Wonky.Client/Pages/CountryLandingPage.razor b/Wonky.Client/Pages/CountryLandingPage.razor new file mode 100644 index 00000000..235d2108 --- /dev/null +++ b/Wonky.Client/Pages/CountryLandingPage.razor @@ -0,0 +1,64 @@ +@* +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// +*@ + +@using Microsoft.AspNetCore.Authorization +@attribute [Authorize(Roles = "Admin,Office,Warehouse")] +@page "/office/{CountryCode}" + +
+
+
+
+

+ @CountryCode.ToUpper() Kunder +

+
+ Filtrer og søg kunder +
+ Kundeliste +
+
+
+
+
+
+

+ @CountryCode.ToUpper() Priskatalog +

+
+ Produkter og priser +
+ Priskatalog +
+
+
+ +
+
+
+

+ @CountryCode.ToUpper() Sælgere +

+

+ Filtreret kundeliste, se/udskriv rapporter, rediger stamdata +

+ Sælgere +
+
+
+
+
\ No newline at end of file diff --git a/Wonky.Client/Pages/CountryLandingPage.razor.cs b/Wonky.Client/Pages/CountryLandingPage.razor.cs new file mode 100644 index 00000000..34d4e000 --- /dev/null +++ b/Wonky.Client/Pages/CountryLandingPage.razor.cs @@ -0,0 +1,11 @@ +using Blazored.LocalStorage; +using Microsoft.AspNetCore.Components; +using Wonky.Entity.Views; + +namespace Wonky.Client.Pages; + +public partial class CountryLandingPage +{ + [Parameter] public string CountryCode { get; set; } = ""; + [Inject] private ILocalStorageService Storage { get; set; } +} \ No newline at end of file diff --git a/Wonky.Client/Pages/UserListSalesRepPage.razor b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor similarity index 97% rename from Wonky.Client/Pages/UserListSalesRepPage.razor rename to Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor index ef18369c..62076ef7 100644 --- a/Wonky.Client/Pages/UserListSalesRepPage.razor +++ b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor @@ -18,7 +18,7 @@ @using Wonky.Client.Components @using Microsoft.AspNetCore.Authorization @attribute [Authorize(Roles = "Admin,Office,Warehouse")] -@page "/office/users/advisors/{CountryCode}/{UserId}/companies" +@page "/office/users/advisors/{CountryCode}/{UserId}/customers"
diff --git a/Wonky.Client/Pages/UserListSalesRepPage.razor.cs b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor.cs similarity index 96% rename from Wonky.Client/Pages/UserListSalesRepPage.razor.cs rename to Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor.cs index a7118198..4d095a49 100644 --- a/Wonky.Client/Pages/UserListSalesRepPage.razor.cs +++ b/Wonky.Client/Pages/CountrySalesRepCustomerListPage.razor.cs @@ -22,12 +22,12 @@ using Wonky.Entity.Requests; namespace Wonky.Client.Pages; -public partial class UserListSalesRepPage : IDisposable +public partial class CountrySalesRepCustomerListPage : IDisposable { [Parameter] public string UserId { get; set; } = ""; [Parameter] public string CountryCode { get; set; } = "dk"; - [Inject] public ILogger Logger { get; set; } + [Inject] public ILogger Logger { get; set; } [Inject] public HttpInterceptorService Interceptor { get; set; } [Inject] public ICustomerOfficeHttpRepository CustomerRepo { get; set; } [Inject] public UserProfileService UserProfileService { get; set; } diff --git a/Wonky.Client/Pages/UserListOfficePage.razor b/Wonky.Client/Pages/CountrySalesRepListPage.razor similarity index 94% rename from Wonky.Client/Pages/UserListOfficePage.razor rename to Wonky.Client/Pages/CountrySalesRepListPage.razor index 2c97f745..da79c783 100644 --- a/Wonky.Client/Pages/UserListOfficePage.razor +++ b/Wonky.Client/Pages/CountrySalesRepListPage.razor @@ -25,7 +25,7 @@

Sælgere

- +
diff --git a/Wonky.Client/Pages/CountrySalesRepListPage.razor.cs b/Wonky.Client/Pages/CountrySalesRepListPage.razor.cs new file mode 100644 index 00000000..adb1d571 --- /dev/null +++ b/Wonky.Client/Pages/CountrySalesRepListPage.razor.cs @@ -0,0 +1,31 @@ +using Microsoft.AspNetCore.Components; +using Wonky.Client.HttpInterceptors; +using Wonky.Client.HttpInterfaces; +using Wonky.Entity.Views; + +namespace Wonky.Client.Pages; + +public partial class CountrySalesRepListPage +{ + [Inject] public HttpInterceptorService Interceptor { get; set; } + [Inject] public IUserHttpRepository UserRepo { get; set; } + [Parameter] public string CountryCode { get; set; } = ""; + private List SalesReps { get; set; } = new(); + private bool Working { get; set; } = true; + + protected override async Task OnInitializedAsync() + { + Interceptor.RegisterEvent(); + Interceptor.RegisterBeforeSendEvent(); + var AdvisorList = await UserRepo.GetAdvisors(); + SalesReps = AdvisorList + .Where(x => x.CountryCode.ToLower() == CountryCode && Convert.ToInt32(x.SalesRep) < 100) + .ToList(); + Working = false; + } + + public void Dispose() + { + Interceptor.DisposeEvent(); + } +} \ No newline at end of file diff --git a/Wonky.Client/Pages/WorkplaceDocumentListPage.razor b/Wonky.Client/Pages/CustomerWorkplaceDocumentListPage.razor similarity index 100% rename from Wonky.Client/Pages/WorkplaceDocumentListPage.razor rename to Wonky.Client/Pages/CustomerWorkplaceDocumentListPage.razor diff --git a/Wonky.Client/Pages/WorkplaceDocumentListPage.razor.cs b/Wonky.Client/Pages/CustomerWorkplaceDocumentListPage.razor.cs similarity index 95% rename from Wonky.Client/Pages/WorkplaceDocumentListPage.razor.cs rename to Wonky.Client/Pages/CustomerWorkplaceDocumentListPage.razor.cs index e9eb19a4..b1a93b14 100644 --- a/Wonky.Client/Pages/WorkplaceDocumentListPage.razor.cs +++ b/Wonky.Client/Pages/CustomerWorkplaceDocumentListPage.razor.cs @@ -21,7 +21,7 @@ using Wonky.Client.HttpRepository; namespace Wonky.Client.Pages; -public partial class WorkplaceDocumentListPage +public partial class CustomerWorkplaceDocumentListPage { [Parameter] public string CompanyId { get; set; } = ""; [Parameter] public string WorkplaceId { get; set; } = ""; diff --git a/Wonky.Client/Pages/WorkplaceListPage.razor b/Wonky.Client/Pages/CustomerWorkplaceListPage.razor similarity index 100% rename from Wonky.Client/Pages/WorkplaceListPage.razor rename to Wonky.Client/Pages/CustomerWorkplaceListPage.razor diff --git a/Wonky.Client/Pages/WorkplaceListPage.razor.cs b/Wonky.Client/Pages/CustomerWorkplaceListPage.razor.cs similarity index 97% rename from Wonky.Client/Pages/WorkplaceListPage.razor.cs rename to Wonky.Client/Pages/CustomerWorkplaceListPage.razor.cs index d1367d51..b66ac3b9 100644 --- a/Wonky.Client/Pages/WorkplaceListPage.razor.cs +++ b/Wonky.Client/Pages/CustomerWorkplaceListPage.razor.cs @@ -24,7 +24,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Pages; -public partial class WorkplaceListPage : IDisposable +public partial class CustomerWorkplaceListPage : IDisposable { [Parameter] public string CompanyId { get; set; } = ""; [Inject] public IWorkplaceCrmHttpRepository WorkplaceCrmRepo { get; set; } diff --git a/Wonky.Client/Pages/WorkplaceViewPage.razor b/Wonky.Client/Pages/CustomerWorkplaceViewPage.razor similarity index 100% rename from Wonky.Client/Pages/WorkplaceViewPage.razor rename to Wonky.Client/Pages/CustomerWorkplaceViewPage.razor diff --git a/Wonky.Client/Pages/WorkplaceViewPage.razor.cs b/Wonky.Client/Pages/CustomerWorkplaceViewPage.razor.cs similarity index 97% rename from Wonky.Client/Pages/WorkplaceViewPage.razor.cs rename to Wonky.Client/Pages/CustomerWorkplaceViewPage.razor.cs index c20547c0..c6724959 100644 --- a/Wonky.Client/Pages/WorkplaceViewPage.razor.cs +++ b/Wonky.Client/Pages/CustomerWorkplaceViewPage.razor.cs @@ -25,7 +25,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Pages; -public partial class WorkplaceViewPage : IDisposable +public partial class CustomerWorkplaceViewPage : IDisposable { [Parameter] public string CompanyId { get; set; } = ""; [Parameter] public string WorkplaceId { get; set; } = ""; diff --git a/Wonky.Client/Pages/Index.razor b/Wonky.Client/Pages/Index.razor index 743e4de5..2f522616 100644 --- a/Wonky.Client/Pages/Index.razor +++ b/Wonky.Client/Pages/Index.razor @@ -15,26 +15,24 @@ // *@ +@using Wonky.Client.Components; +@using Microsoft.AspNetCore.Authorization +@attribute [Authorize(Roles = "Advisor,Admin,Office,Supervisor,Warehouse")] @page "/" @page "/index" @page "/home" -@using Wonky.Client.Components; -@using Microsoft.AspNetCore.Authorization - - -@attribute [Authorize(Roles = "Advisor,Admin,Supervisor,Office,Warehouse")] - - - - - + + + + + @code{ } diff --git a/Wonky.Client/Pages/LandingPageAdminAdvisers.razor b/Wonky.Client/Pages/LandingPageAdminAdvisers.razor deleted file mode 100644 index 3c76a205..00000000 --- a/Wonky.Client/Pages/LandingPageAdminAdvisers.razor +++ /dev/null @@ -1,39 +0,0 @@ -@* -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] -// -*@ - -@using Microsoft.AspNetCore.Authorization -@attribute [Authorize(Roles = "Admin")] -@page "/office/users/advisors" - -
-
-
-

Lande

-
-
-
- -
-
- -@code { - -} \ No newline at end of file diff --git a/Wonky.Client/Pages/LandingPageAdminCountry.razor b/Wonky.Client/Pages/LandingPageAdminCountry.razor deleted file mode 100644 index 81b37bf6..00000000 --- a/Wonky.Client/Pages/LandingPageAdminCountry.razor +++ /dev/null @@ -1,30 +0,0 @@ -@* -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] -// -*@ - -@using Microsoft.AspNetCore.Authorization -@attribute [Authorize(Roles = "Admin")] -@page "/office/{CountryCode}" - - - - -@code { - - [Parameter] - public string CountryCode { get; set; } = ""; - -} \ No newline at end of file diff --git a/Wonky.Client/Pages/LandingPageAdminUsers.razor b/Wonky.Client/Pages/LandingPageAdminUsers.razor deleted file mode 100644 index e8863c3e..00000000 --- a/Wonky.Client/Pages/LandingPageAdminUsers.razor +++ /dev/null @@ -1,30 +0,0 @@ -@* -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] -// -*@ - -@using Microsoft.AspNetCore.Authorization -@attribute [Authorize(Roles = "Admin")] -@page "/office/{countryCode}/salesreps" - -
-
-
-
-
- -@code { - -} \ No newline at end of file diff --git a/Wonky.Client/Pages/OrderViewOfficePage.razor b/Wonky.Client/Pages/OfficeOrderViewPage.razor similarity index 98% rename from Wonky.Client/Pages/OrderViewOfficePage.razor rename to Wonky.Client/Pages/OfficeOrderViewPage.razor index ee590b0b..c19d9f44 100644 --- a/Wonky.Client/Pages/OrderViewOfficePage.razor +++ b/Wonky.Client/Pages/OfficeOrderViewPage.razor @@ -17,7 +17,7 @@ @using Microsoft.AspNetCore.Authorization @using Wonky.Client.Components -@attribute [Authorize(Roles = "Admin,Office,Warehouse,Advisor")] +@attribute [Authorize(Roles = "Admin,Advisor,Office,Warehouse")] @page "/office/customers/{CompanyId}/orders/{OrderId}" diff --git a/Wonky.Client/Pages/OrderViewOfficePage.razor.cs b/Wonky.Client/Pages/OfficeOrderViewPage.razor.cs similarity index 97% rename from Wonky.Client/Pages/OrderViewOfficePage.razor.cs rename to Wonky.Client/Pages/OfficeOrderViewPage.razor.cs index ed7d10f8..8dd6173a 100644 --- a/Wonky.Client/Pages/OrderViewOfficePage.razor.cs +++ b/Wonky.Client/Pages/OfficeOrderViewPage.razor.cs @@ -30,7 +30,7 @@ using Wonky.Client.Services; namespace Wonky.Client.Pages; -public partial class OrderViewOfficePage : IDisposable +public partial class OfficeOrderViewPage : IDisposable { [Parameter] public string CompanyId { get; set; } = ""; [Parameter] public string OrderId { get; set; } = ""; @@ -39,7 +39,7 @@ public partial class OrderViewOfficePage : IDisposable [Inject] public ISendMailService MailService { get; set; } [Inject] public ILocalStorageService Storage { get; set; } [Inject] public IUserHttpRepository UserRepo { get; set; } - [Inject] public ILogger Logger { get; set; } + [Inject] public ILogger Logger { get; set; } [Inject] public IToastService Toast { get; set; } private ReportItemView _reportItem { get; set; } = new(); private bool _isNotified { get; set; } diff --git a/Wonky.Client/Pages/OrderViewOfficePage.razor.css b/Wonky.Client/Pages/OfficeOrderViewPage.razor.css similarity index 100% rename from Wonky.Client/Pages/OrderViewOfficePage.razor.css rename to Wonky.Client/Pages/OfficeOrderViewPage.razor.css diff --git a/Wonky.Client/Pages/UserViewOfficePage.razor b/Wonky.Client/Pages/OfficeSalesRepViewPage.razor similarity index 100% rename from Wonky.Client/Pages/UserViewOfficePage.razor rename to Wonky.Client/Pages/OfficeSalesRepViewPage.razor index 39432332..012451f3 100644 --- a/Wonky.Client/Pages/UserViewOfficePage.razor +++ b/Wonky.Client/Pages/OfficeSalesRepViewPage.razor @@ -15,10 +15,10 @@ // *@ -@page "/office/users/advisors/{CountryCode}/{UserId}/view" @using Microsoft.AspNetCore.Authorization @using Wonky.Client.Components @attribute [Authorize(Roles = "Admin")] +@page "/office/users/advisors/{CountryCode}/{UserId}/view"
diff --git a/Wonky.Client/Pages/UserViewOfficePage.razor.cs b/Wonky.Client/Pages/OfficeSalesRepViewPage.razor.cs similarity index 97% rename from Wonky.Client/Pages/UserViewOfficePage.razor.cs rename to Wonky.Client/Pages/OfficeSalesRepViewPage.razor.cs index 98f0e509..55cd69b4 100644 --- a/Wonky.Client/Pages/UserViewOfficePage.razor.cs +++ b/Wonky.Client/Pages/OfficeSalesRepViewPage.razor.cs @@ -26,13 +26,13 @@ using Wonky.Entity.Views; namespace Wonky.Client.Pages; -public partial class UserViewOfficePage : IDisposable +public partial class OfficeSalesRepViewPage : IDisposable { [Parameter] public string UserId { get; set; } = ""; [Parameter] public string CountryCode { get; set; } = ""; [Inject] public HttpInterceptorService _interceptor { get; set; } [Inject] public IUserHttpRepository UserRepo { get; set; } - [Inject] public ILogger _logger { get; set; } + [Inject] public ILogger _logger { get; set; } [Inject] public NavigationManager _navigator { get; set; } [Inject] public IToastService _toast { get; set; } private WebUserInfoView _userInfo { get; set; } = new(); diff --git a/Wonky.Client/Pages/PrintCatalogPage.razor b/Wonky.Client/Pages/PrintCatalogPage.razor index ccced787..51ca3a5f 100644 --- a/Wonky.Client/Pages/PrintCatalogPage.razor +++ b/Wonky.Client/Pages/PrintCatalogPage.razor @@ -15,13 +15,13 @@ // *@ -@page "/print/catalog" @using Wonky.Client.Components @using Microsoft.AspNetCore.Authorization - @attribute [Authorize(Roles = "Admin,Advisor,Office,Warehouse")] +@page "/print/catalog" + @if (Working) { diff --git a/Wonky.Client/Pages/PrintFrontPage.razor b/Wonky.Client/Pages/PrintFrontPage.razor index 49b98e5b..3cd029d0 100644 --- a/Wonky.Client/Pages/PrintFrontPage.razor +++ b/Wonky.Client/Pages/PrintFrontPage.razor @@ -17,8 +17,8 @@ @using Wonky.Client.Components @using Microsoft.AspNetCore.Authorization +@attribute [Authorize(Roles = "Admin,Advisor,Office")] @page "/print/report/{CountryCode}/{UserId}/{ReportDate}" -@attribute [Authorize(Roles = "Admin,Advisor")]
diff --git a/Wonky.Client/Pages/PrintOrderPage.razor b/Wonky.Client/Pages/PrintOrderPage.razor index b8503e6b..f2a89c5b 100644 --- a/Wonky.Client/Pages/PrintOrderPage.razor +++ b/Wonky.Client/Pages/PrintOrderPage.razor @@ -17,8 +17,8 @@ @using Wonky.Client.Components @using Microsoft.AspNetCore.Authorization +@attribute [Authorize(Roles = "Admin,Advisor,Office")] @page "/print/orders/{CountryCode}/{UserId}/{ReportDate}" -@attribute [Authorize(Roles = "Admin,Advisor")]
diff --git a/Wonky.Client/Pages/QuoteListCrmPage.razor b/Wonky.Client/Pages/QuoteListCrmPage.razor index f13e717d..3a053261 100644 --- a/Wonky.Client/Pages/QuoteListCrmPage.razor +++ b/Wonky.Client/Pages/QuoteListCrmPage.razor @@ -1,6 +1,24 @@ -@page "/open-quotes" +@* +// Copyright (C) 2022 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// +*@ @using Wonky.Client.Components @using Wonky.Client.Models +@using Microsoft.AspNetCore.Authorization +@attribute [Authorize(Roles = "Advisor")] +@page "/open-quotes"
diff --git a/Wonky.Client/Pages/ReportListCrmPage.razor b/Wonky.Client/Pages/ReportListCrmPage.razor index 208379c3..55b709b5 100644 --- a/Wonky.Client/Pages/ReportListCrmPage.razor +++ b/Wonky.Client/Pages/ReportListCrmPage.razor @@ -16,6 +16,8 @@ *@ @using Wonky.Client.Components +@using Microsoft.AspNetCore.Authorization +@attribute [Authorize(Roles = "Advisor")] @page "/sales-reports"
diff --git a/Wonky.Client/Pages/ReportViewCrmPage.razor b/Wonky.Client/Pages/ReportViewCrmPage.razor index 76497ca7..df46cc48 100644 --- a/Wonky.Client/Pages/ReportViewCrmPage.razor +++ b/Wonky.Client/Pages/ReportViewCrmPage.razor @@ -18,8 +18,8 @@ @using Wonky.Client.Components @using Microsoft.AspNetCore.Authorization @using Wonky.Client.Models -@page "/sales-reports/view/{ReportDate}" @attribute [Authorize(Roles = "Advisor,Admin,Supervisor")] +@page "/sales-reports/view/{ReportDate}"
diff --git a/Wonky.Client/Pages/ReportViewOfficePage.razor b/Wonky.Client/Pages/ReportViewOfficePage.razor index bc7311bb..3977d043 100644 --- a/Wonky.Client/Pages/ReportViewOfficePage.razor +++ b/Wonky.Client/Pages/ReportViewOfficePage.razor @@ -18,8 +18,8 @@ @using Wonky.Client.Components @using Microsoft.AspNetCore.Authorization @using Wonky.Client.Models -@page "/office/users/advisors/{CountryCode}/{UserId}/reports/{ReportDate}" @attribute [Authorize(Roles = "Admin")] +@page "/office/users/advisors/{CountryCode}/{UserId}/reports/{ReportDate}"
diff --git a/Wonky.Client/Pages/UserListOfficePage.razor.cs b/Wonky.Client/Pages/UserListOfficePage.razor.cs deleted file mode 100644 index bb3a0880..00000000 --- a/Wonky.Client/Pages/UserListOfficePage.razor.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] -// - -using Microsoft.AspNetCore.Components; -using Wonky.Client.HttpInterceptors; -using Wonky.Client.HttpInterfaces; -using Wonky.Client.HttpRepository; -using Wonky.Entity.DTO; -using Wonky.Entity.Views; - -namespace Wonky.Client.Pages; - -public partial class UserListOfficePage : IDisposable -{ - [Parameter] public string CountryCode { get; set; } = ""; - [Inject] public HttpInterceptorService _interceptor { get; set; } - [Inject] public IUserHttpRepository UserRepo { get; set; } - private List _salesReps { get; set; } = new(); - private bool Working { get; set; } = true; - - - protected override async Task OnInitializedAsync() - { - _interceptor.RegisterEvent(); - _interceptor.RegisterBeforeSendEvent(); - var AdvisorList = await UserRepo.GetAdvisors(); - _salesReps = AdvisorList - .Where(x => x.CountryCode.ToLower() == CountryCode && Convert.ToInt32(x.SalesRep) < 100) - .ToList(); - Working = false; - } - - public void Dispose() - { - _interceptor.DisposeEvent(); - } -} \ No newline at end of file diff --git a/Wonky.Client/Pages/OrderListWarehousePage.razor b/Wonky.Client/Pages/WarehouseOrderListPage.razor similarity index 93% rename from Wonky.Client/Pages/OrderListWarehousePage.razor rename to Wonky.Client/Pages/WarehouseOrderListPage.razor index 6a8b8961..67c52ae1 100644 --- a/Wonky.Client/Pages/OrderListWarehousePage.razor +++ b/Wonky.Client/Pages/WarehouseOrderListPage.razor @@ -21,9 +21,3 @@ @page "/warehouse/orders/{Status}" - -@code{ - - [Parameter] public string Status { get; set; } = "none"; - -} diff --git a/Wonky.Client/Pages/WarehouseOrderListPage.razor.cs b/Wonky.Client/Pages/WarehouseOrderListPage.razor.cs new file mode 100644 index 00000000..932c265c --- /dev/null +++ b/Wonky.Client/Pages/WarehouseOrderListPage.razor.cs @@ -0,0 +1,8 @@ +using Microsoft.AspNetCore.Components; + +namespace Wonky.Client.Pages; + +public partial class WarehouseOrderListPage +{ + [Parameter] public string Status { get; set; } = "none"; +} \ No newline at end of file diff --git a/Wonky.Client/Pages/OrderViewWarehousePage.razor b/Wonky.Client/Pages/WarehouseOrderViewPage.razor similarity index 100% rename from Wonky.Client/Pages/OrderViewWarehousePage.razor rename to Wonky.Client/Pages/WarehouseOrderViewPage.razor diff --git a/Wonky.Client/Pages/OrderViewWarehousePage.razor.cs b/Wonky.Client/Pages/WarehouseOrderViewPage.razor.cs similarity index 96% rename from Wonky.Client/Pages/OrderViewWarehousePage.razor.cs rename to Wonky.Client/Pages/WarehouseOrderViewPage.razor.cs index d30fa144..c91753e9 100644 --- a/Wonky.Client/Pages/OrderViewWarehousePage.razor.cs +++ b/Wonky.Client/Pages/WarehouseOrderViewPage.razor.cs @@ -25,14 +25,14 @@ using Wonky.Entity.Views; namespace Wonky.Client.Pages; -public partial class OrderViewWarehousePage : IDisposable +public partial class WarehouseOrderViewPage : IDisposable { [Parameter] public string OrderId { get; set; } = ""; [Inject] public HttpInterceptorService _interceptor { get; set; } [Inject] public IWarehouseHttpRepository _warehouseRepo { get; set; } [Inject] public NavigationManager _navigator { get; set; } [Inject] public IToastService _toast { get; set; } - [Inject] public ILogger _logger { get; set; } + [Inject] public ILogger _logger { get; set; } private WarehouseOrderView _order { get; set; } = new(); private bool Working { get; set; } diff --git a/Wonky.Client/Program.cs b/Wonky.Client/Program.cs index 7ab56879..c0f9c1b5 100644 --- a/Wonky.Client/Program.cs +++ b/Wonky.Client/Program.cs @@ -36,9 +36,9 @@ builder.RootComponents.Add("head::after"); builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging")); builder.Services.AddScoped(sp => - sp.GetService().CreateClient("backend")); + sp.GetService().CreateClient("inno-api")); -builder.Services.AddHttpClient("backend", (sp, cl) => +builder.Services.AddHttpClient("inno-api", (sp, cl) => { var apiConfig = sp.GetRequiredService>(); cl.BaseAddress = new Uri(apiConfig.Value.BaseUrl); @@ -58,12 +58,11 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); // administrative repositories +builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); builder.Services.AddScoped(); // warehouse repository builder.Services.AddScoped(); diff --git a/Wonky.Client/Shared/NavMenu.razor b/Wonky.Client/Shared/NavMenu.razor index 5df0f9d9..eebb17e4 100644 --- a/Wonky.Client/Shared/NavMenu.razor +++ b/Wonky.Client/Shared/NavMenu.razor @@ -52,12 +52,12 @@