diff --git a/Wonky.Client/Components/AdminAdviserCompanyTableComponent.razor b/Wonky.Client/Components/AdminAdviserCompanyTableComponent.razor
new file mode 100644
index 00000000..3246eaf6
--- /dev/null
+++ b/Wonky.Client/Components/AdminAdviserCompanyTableComponent.razor
@@ -0,0 +1,82 @@
+@*
+// 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.Helpers;
+
+@if (Companies.Any())
+{
+
+}
+else
+{
+
+}
\ No newline at end of file
diff --git a/Wonky.Client/Components/AdminAdviserCompanyTableComponent.razor.cs b/Wonky.Client/Components/AdminAdviserCompanyTableComponent.razor.cs
new file mode 100644
index 00000000..8f6df369
--- /dev/null
+++ b/Wonky.Client/Components/AdminAdviserCompanyTableComponent.razor.cs
@@ -0,0 +1,54 @@
+
+// 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 Blazored.LocalStorage;
+using Microsoft.AspNetCore.Components;
+using Wonky.Client.Helpers;
+using Wonky.Client.Services;
+using Wonky.Client.Shared;
+using Wonky.Entity.DTO;
+using Wonky.Entity.Views;
+
+namespace Wonky.Client.Components
+{
+ public partial class AdminAdviserCompanyTableComponent
+ {
+ [Parameter] public List Companies { get; set; } = new();
+ [Parameter] public EventCallback OnDelete { get; set; }
+ [Parameter] public EventCallback OnSelect { get; set; }
+
+ private Confirmation _confirmation = new ();
+ private string _companyId = "";
+ private string _actionUrl = "";
+
+ protected override async Task OnInitializedAsync()
+ {
+ await base.OnInitializedAsync();
+ }
+
+ private void CallConfirmationModal(string companyId)
+ {
+ _companyId = companyId;
+ _confirmation.Show();
+ }
+
+ private async Task DeleteCompany()
+ {
+ _confirmation.Hide();
+ await OnDelete.InvokeAsync(_companyId);
+ }
+ }
+}
diff --git a/Wonky.Client/Components/AdminAdviserTableComponent.razor b/Wonky.Client/Components/AdminAdviserTableComponent.razor
index d17a20e2..8a5d94e1 100644
--- a/Wonky.Client/Components/AdminAdviserTableComponent.razor
+++ b/Wonky.Client/Components/AdminAdviserTableComponent.razor
@@ -29,12 +29,6 @@
Email
|
-
- Land
- |
-
- Nr.
- |
|
@@ -50,10 +44,9 @@
@user.FullName |
@user.PhoneNumber |
@user.Email |
- @user.CountryCode |
- @user.SalesRep |
- Rapporter |
- Rediger |
+ Rapporter |
+ Kunder |
+ Rediger |
}
diff --git a/Wonky.Client/HttpRepository/CompanyHttpRepository.cs b/Wonky.Client/HttpRepository/CompanyHttpRepository.cs
index d2eafea6..71334c7a 100644
--- a/Wonky.Client/HttpRepository/CompanyHttpRepository.cs
+++ b/Wonky.Client/HttpRepository/CompanyHttpRepository.cs
@@ -80,6 +80,31 @@ public class CompanyHttpRepository : ICompanyHttpRepository
return pagingResponse;
}
+ public async Task> GetAdminAdviserCompaniesPaged(string userId, CompanyPagingParams pagingParameters)
+ {
+ var queryString = new Dictionary
+ {
+ ["pageNumber"] = pagingParameters.PageNumber.ToString(),
+ ["pageSize"] = pagingParameters.PageSize.ToString(),
+ ["searchTerm"] = pagingParameters.SearchTerm,
+ ["searchColumn"] = pagingParameters.SearchColumn,
+ ["orderBy"] = pagingParameters.OrderBy,
+ ["isHidden"] = pagingParameters.IsHidden.ToString(),
+ ["hasFolded"] = pagingParameters.HasFolded.ToString()
+ };
+ var response = await _client
+ .GetAsync(QueryHelpers.AddQueryString($"{_apiConfig.AdminAdviserUri}/{userId}/companies", queryString));
+
+ var content = await response.Content.ReadAsStringAsync();
+
+ var pagingResponse = new PagingResponse
+ {
+ Items = JsonSerializer.Deserialize>(content, _options),
+ MetaData = JsonSerializer.Deserialize(response.Headers.GetValues("X-Pagination").First(), _options)
+ };
+ return pagingResponse;
+ }
+
public async Task GetCompanyByAccount(string accountNumber)
{
var company = await _client.GetFromJsonAsync($"{_apiConfig.CompanyUri}/account/{accountNumber}");
diff --git a/Wonky.Client/HttpRepository/ICompanyHttpRepository.cs b/Wonky.Client/HttpRepository/ICompanyHttpRepository.cs
index d660a829..8ec4dce6 100644
--- a/Wonky.Client/HttpRepository/ICompanyHttpRepository.cs
+++ b/Wonky.Client/HttpRepository/ICompanyHttpRepository.cs
@@ -24,6 +24,7 @@ namespace Wonky.Client.HttpRepository;
public interface ICompanyHttpRepository
{
Task> GetCompaniesPaged(CompanyPagingParams pagingParameters);
+ Task> GetAdminAdviserCompaniesPaged(string userId, CompanyPagingParams pagingParameters);
Task GetCompanyByAccount(string accountNumber);
Task GetCompanyById(string companyId);
Task CreateCompany(CompanyDto model);
diff --git a/Wonky.Client/Pages/ActivityToday.razor b/Wonky.Client/Pages/ActivityToday.razor
index de643b44..016d3757 100644
--- a/Wonky.Client/Pages/ActivityToday.razor
+++ b/Wonky.Client/Pages/ActivityToday.razor
@@ -24,7 +24,7 @@