WIP
This commit is contained in:
parent
6d15a7e88a
commit
4c8ea61749
53 changed files with 456 additions and 166 deletions
115
Wonky.Client/Overlay.System/SelectCustomerPagedOverlay.razor
Normal file
115
Wonky.Client/Overlay.System/SelectCustomerPagedOverlay.razor
Normal file
|
@ -0,0 +1,115 @@
|
|||
@* 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
|
||||
<div class="modal" tabindex="-1" role="dialog" style="display:@_modalDisplay">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Pris Katalog</h5>
|
||||
<button type="button" class="btn btn-danger" @onclick="@Hide" data-bs-dismiss="modal" aria-label="Luk"><i class="bi-x-lg"></i></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="sticky-top bg-dark rounded-2 p-3">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-2">
|
||||
<SearchCatalogColumnComponent OnChanged="SetSearchCol"/>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<SearchCatalogPhraseComponent OnChanged="SetSearchPhrase"/>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<SearchCatalogSortColumnComponent OnChanged="SetSortCol"/>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<PageSizeComponent OnChanged="SetPageSize"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-12 text-center">
|
||||
<PagerPagesComponent MetaData="PageData" Spread="2" SelectedPage="SetSelectedPage" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-white">
|
||||
<div class="col-sm-3 fw-bold">Vare</div>
|
||||
<div class="col-sm-2 fw-bold">Varenr</div>
|
||||
<div class="col-sm-2 fw-bold">Fork</div>
|
||||
<div class="col-sm-1 text-center fw-bold">Colli</div>
|
||||
<div class="col-sm-4 text-center fw-bold">Stk / Pris</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Items.Any())
|
||||
{
|
||||
<ul class="list-group list-group-flush">
|
||||
@foreach (var item in Items)
|
||||
{
|
||||
<li class="list-group-item">
|
||||
<div class="row align-middle">
|
||||
<div class="col-sm-3 text-sm-start">
|
||||
@item.Name
|
||||
</div>
|
||||
<div class="col-sm-2 text-sm-start">
|
||||
@item.Sku
|
||||
</div>
|
||||
<div class="col-sm-2 text-sm-start">
|
||||
@item.ShortName
|
||||
</div>
|
||||
<div class="col-sm-1 text-center">
|
||||
@item.BoxSize
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<ul class="list-group">
|
||||
@foreach (var rate in item.Rates)
|
||||
{
|
||||
<li class="list-group-item d-flex justify-content-between align-items-end">
|
||||
<div class="text-sm-end me-1">@rate.Quantity</div>
|
||||
<div class="text-sm-end me-1">@rate.Rate</div>
|
||||
<div>
|
||||
<a class="btn btn-primary btn-sm" data-bs-dismiss="modal" @onclick="@(() => SelectItem(item.SalesItemId, rate.Quantity, rate.Rate))">
|
||||
<i class="bi-plus-lg"></i>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
@if (_pager.PageSize > 10)
|
||||
{
|
||||
<div class="row mt-5 pb-5">
|
||||
<div class="col-sm-12">
|
||||
<PagerSimpleComponent MetaData="PageData" Spread="2" SelectedPage="SetSelectedPage" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>Der er ingen data</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (_showBackdrop)
|
||||
{
|
||||
<div class="modal-backdrop fade show"></div>
|
||||
}
|
134
Wonky.Client/Overlay.System/SelectCustomerPagedOverlay.razor.cs
Normal file
134
Wonky.Client/Overlay.System/SelectCustomerPagedOverlay.razor.cs
Normal file
|
@ -0,0 +1,134 @@
|
|||
// 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 System.Text.Json;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Wonky.Client.HttpInterceptors;
|
||||
using Wonky.Client.HttpRepository;
|
||||
using Wonky.Client.Local.Services;
|
||||
using Wonky.Client.Models;
|
||||
using Wonky.Entity.Requests;
|
||||
using Wonky.Entity.Views;
|
||||
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace Wonky.Client.Overlay.System;
|
||||
|
||||
public partial class SelectCustomerPagedOverlay : IDisposable
|
||||
{
|
||||
// ##############################################################
|
||||
[Inject] public ICountryCatalogRepository CatalogRepo { get; set; }
|
||||
[Inject] public HttpInterceptorService Interceptor { get; set; }
|
||||
[Inject] public UserPreferenceService PreferenceService { get; set; }
|
||||
[Inject] public ILogger<SelectCustomerPagedOverlay> Logger { get; set; }
|
||||
|
||||
// ##############################################################
|
||||
[Parameter] public string CountryCode { get; set; } = "";
|
||||
[Parameter] public EventCallback<SelectedSku> OnSelected { get; set; }
|
||||
|
||||
// ##############################################################
|
||||
private string _modalDisplay = "";
|
||||
private bool _showBackdrop;
|
||||
private List<SalesItemView> Items { get; set; } = new();
|
||||
private MetaData? PageData { get; set; } = new();
|
||||
private CatalogPager _pager = new();
|
||||
private UserPreference _userPreference = new();
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
Interceptor.RegisterEvent();
|
||||
Interceptor.RegisterBeforeSendEvent();
|
||||
await GetSalesItems();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_userPreference = await PreferenceService.GetProfile();
|
||||
_pager.OrderBy = _userPreference.ItemSort;
|
||||
_pager.SearchColumn = _userPreference.ItemSearch;
|
||||
_pager.PageSize = Convert.ToInt32(_userPreference.PageSize);
|
||||
}
|
||||
|
||||
private async Task GetSalesItems()
|
||||
{
|
||||
var pagingResponse = await CatalogRepo.GetSalesItemsPaged(CountryCode, _pager);
|
||||
if (pagingResponse == null)
|
||||
Task.Delay(250);
|
||||
Items = pagingResponse.Items!;
|
||||
PageData = pagingResponse.MetaData;
|
||||
Logger.LogDebug("PriceCatalogOverlay => Items <= {}", JsonSerializer.Serialize(Items));
|
||||
}
|
||||
|
||||
private void SelectItem(string itemId, string quantity, string rate)
|
||||
{
|
||||
OnSelected.InvokeAsync(new SelectedSku { Quantity = quantity, Rate = rate, ItemId = itemId });
|
||||
Hide();
|
||||
}
|
||||
|
||||
private async Task SetSelectedPage(int page)
|
||||
{
|
||||
Items = new List<SalesItemView>();
|
||||
_pager.PageNumber = page;
|
||||
await GetSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetSearchPhrase(string searchTerm)
|
||||
{
|
||||
Items = new List<SalesItemView>();
|
||||
_pager.PageNumber = 1;
|
||||
_pager.SearchTerm = searchTerm;
|
||||
await GetSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetPageSize(string pageSize)
|
||||
{
|
||||
Items = new List<SalesItemView>();
|
||||
_pager.PageSize = Convert.ToInt32(pageSize);
|
||||
_pager.PageNumber = 1;
|
||||
await GetSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetSearchCol(string columnName)
|
||||
{
|
||||
Items = new List<SalesItemView>();
|
||||
_pager.PageNumber = 1;
|
||||
_pager.SearchColumn = columnName;
|
||||
await GetSalesItems();
|
||||
}
|
||||
|
||||
private async Task SetSortCol(string orderBy)
|
||||
{
|
||||
Items = new List<SalesItemView>();
|
||||
_pager.OrderBy = orderBy;
|
||||
await GetSalesItems();
|
||||
}
|
||||
|
||||
public void Show()
|
||||
{
|
||||
_modalDisplay = "block;";
|
||||
_showBackdrop = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
{
|
||||
_modalDisplay = "none;";
|
||||
_showBackdrop = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
public void Dispose() => Interceptor.DisposeEvent();
|
||||
}
|
|
@ -33,5 +33,9 @@
|
|||
@* TODO Supervisor landing page *@
|
||||
</AuthorizeView>
|
||||
|
||||
<AuthorizeView Roles="Management">
|
||||
@* TODO Supervisor landing page *@
|
||||
</AuthorizeView>
|
||||
|
||||
@code{
|
||||
}
|
||||
|
|
6
Wonky.Client/Pages/ManagementPage.razor
Normal file
6
Wonky.Client/Pages/ManagementPage.razor
Normal file
|
@ -0,0 +1,6 @@
|
|||
@page "/manager"
|
||||
<h3>Manager</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
|
@ -28,7 +28,7 @@
|
|||
<a class="btn btn-primary" href="/supervisor" ><i class="bi-chevron-left"></i> Supervisor</a>
|
||||
</div>
|
||||
<div class="col-sm-2 text-end">
|
||||
<a class="btn btn-primary" href="/supervisor/advisors/@AdvisorId/documents/new" ><i class="bi-plus-lg"></i> Ny dokument</a>
|
||||
<a class="btn btn-primary" href="/supervisor/advisors/@AdvisorId/documents/new" ><i class="bi-plus-lg"></i> Dokument</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -34,19 +34,21 @@
|
|||
<div class="col-sm-8">
|
||||
<h3>@Document.AdvisorName</h3>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@* placeholder *@
|
||||
</div>
|
||||
<div class="col-sm-2 text-end">
|
||||
<AuthorizeView Roles="Management">
|
||||
<button type="button" class="btn btn-warning" @onclick="@RemoveDocument"><i class="bi-trash"></i> Slet</button>
|
||||
</AuthorizeView>
|
||||
</div>
|
||||
<div class="col-sm-1 text-end">
|
||||
<div class="busy-signal @(Working ? "inno-visible" : "inno-hidden")">
|
||||
<div class="spinner-grow text-info" role="status">
|
||||
<div class="spinner-grow inno" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<EditForm EditContext="FormContext" OnValidSubmit="SubmitDocument">
|
||||
<div class="card">
|
||||
<EditForm EditContext="FormContext" OnValidSubmit="SubmitDocument">
|
||||
<div class="card-body">
|
||||
<div class="row d-flex g-3">
|
||||
<label for="supervisor" class="col-sm-1 col-form-label-sm">Supervisor</label>
|
||||
|
@ -79,17 +81,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<Authorized Context="Management">
|
||||
<div class="col text-start">
|
||||
<button type="button" class="btn btn-warning" @onclick="@RemoveDocument"><i class="bi-trash"></i> Slet</button>
|
||||
</div>
|
||||
</Authorized>
|
||||
<div class="col text-end">
|
||||
<button type="submit" class="btn btn-primary"><i class="bi-cloud-upload"></i> Gem</button>
|
||||
<button type="submit" class="btn btn-primary"><i class="bi-cloud-arrow-up"></i> Gem</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
|
@ -30,65 +30,76 @@
|
|||
<EditForm EditContext="NewUserContext" OnValidSubmit="CreateUserRequest">
|
||||
<DataAnnotationsValidator/>
|
||||
<div class="row g-3 mb-3">
|
||||
<label for="firstName" class="col-sm-2 col-form-label">Fornavn</label>
|
||||
<div class="col-sm-4">
|
||||
<InputText id="firstName" class="form-control" @bind-Value="NewUserInfo.FirstName"/>
|
||||
@* firstName *@
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputText id="firstName" class="form-control" @bind-Value="NewUserInfo.FirstName" placeholder="Fornavn"/>
|
||||
<ValidationMessage For="@(() => NewUserInfo.FirstName)"></ValidationMessage>
|
||||
<label for="firstName">Fornavn</label>
|
||||
</div>
|
||||
|
||||
<label for="lastName" class="col-sm-2 col-form-label">Efternavn</label>
|
||||
<div class="col-sm-4">
|
||||
<InputText id="lastName" class="form-control" @bind-Value="NewUserInfo.LastName"/>
|
||||
</div>
|
||||
@* lastName *@
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputText id="lastName" class="form-control" @bind-Value="NewUserInfo.LastName" placeholder="Efternavn"/>
|
||||
<ValidationMessage For="@(() => NewUserInfo.LastName)"></ValidationMessage>
|
||||
<label for="lastName">Efternavn</label>
|
||||
</div>
|
||||
|
||||
<label for="email" class="col-sm-2 col-form-label">Email</label>
|
||||
<div class="col-sm-4">
|
||||
<InputText id="email" class="form-control" @bind-Value="NewUserInfo.Email"/>
|
||||
</div>
|
||||
@* email *@
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputText id="email" class="form-control" @bind-Value="NewUserInfo.Email" placeholder="Email"/>
|
||||
<ValidationMessage For="@(() => NewUserInfo.Email)"></ValidationMessage>
|
||||
<label for="email">Email</label>
|
||||
</div>
|
||||
|
||||
<label for="phoneNumber" class="col-sm-2 col-form-label">Mobil</label>
|
||||
<div class="col-sm-4">
|
||||
<InputText id="phoneNumber" class="form-control" @bind-Value="NewUserInfo.PhoneNumber"/>
|
||||
</div>
|
||||
@* phoneNumber *@
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputText id="phoneNumber" class="form-control" @bind-Value="NewUserInfo.PhoneNumber" placeholder="Direkte Telefon Nr."/>
|
||||
<ValidationMessage For="@(() => NewUserInfo.PhoneNumber)"></ValidationMessage>
|
||||
<label for="phoneNumber">Direkte Telefon Nr.</label>
|
||||
</div>
|
||||
|
||||
<label for="salesRep" class="col-sm-2 col-form-label">Sælgernr</label>
|
||||
<div class="col-sm-4">
|
||||
<InputText id="salesRep" class="form-control" @bind-Value="NewUserInfo.SalesRep"/>
|
||||
</div>
|
||||
@* salesRep *@
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputText id="salesRep" class="form-control" @bind-Value="NewUserInfo.SalesRep" placeholder="Sælger"/>
|
||||
<ValidationMessage For="@(() => NewUserInfo.SalesRep)"></ValidationMessage>
|
||||
<label for="salesRep">Sælger</label>
|
||||
</div>
|
||||
|
||||
<label for="countryCode" class="col-sm-2 col-form-label">Landekode</label>
|
||||
<div class="col-sm-4">
|
||||
<InputText id="countryCode" class="form-control" @bind-Value="NewUserInfo.CountryCode"/>
|
||||
</div>
|
||||
@* countrycode *@
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputSelect id="countryCode" class="form-control" @bind-Value="NewUserInfo.CountryCode" placeholder="Landekode">
|
||||
<option value="" disabled>Klik for valg</option>
|
||||
<option value="DK">Danmark</option>
|
||||
<option value="NO">Norge</option>
|
||||
<option value="SE">Sverige</option>
|
||||
</InputSelect>
|
||||
<ValidationMessage For="@(() => NewUserInfo.CountryCode)"></ValidationMessage>
|
||||
<label for="countryCode">Landekode</label>
|
||||
</div>
|
||||
|
||||
@*
|
||||
<div class="ms-2 col-sm-4 form-check form-switch">
|
||||
<label for="lockoutEnabled" class="form-check-label">Spærret</label>
|
||||
<InputCheckbox id="lockoutEnabled" class="form-check-input" @bind-Value="NewUserInfo.LockoutEnabled"/>
|
||||
<ValidationMessage For="@(() => NewUserInfo.LockoutEnabled)"></ValidationMessage>
|
||||
</div>
|
||||
*@
|
||||
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="admin" class="form-check-input" @bind-Value="AssignedRoles.Admin"/>
|
||||
<label for="admin" class="form-check-label">Administrator</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="warehouse" class="form-check-input" @bind-Value="AssignedRoles.Warehouse"/>
|
||||
<label for="warehouse" class="form-check-label">Forsendelse</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="office" class="form-check-input" @bind-Value="AssignedRoles.Office"/>
|
||||
<label for="office" class="form-check-label">Kontor</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="eshop" class="form-check-input" @bind-Value="AssignedRoles.EShop"/>
|
||||
<label for="eshop" class="form-check-label">Kunde (EShop)</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="warehouse" class="form-check-input" @bind-Value="AssignedRoles.Warehouse"/>
|
||||
<label for="warehouse" class="form-check-label">Forsendelse</label>
|
||||
<label for="eshop" class="form-check-label">WebShop Kunde</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="management" class="form-check-input" @bind-Value="AssignedRoles.Management"/>
|
||||
|
@ -104,12 +115,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<div class="col-sm-6">
|
||||
<a class="btn btn-primary" href="/system/users"><i class="bi-back"></i> Tilbage</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a class="btn btn-primary" href="/system/users">Tilbage</a>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<div class="col-sm-6 text-end">
|
||||
<button type="submit" class="btn btn-primary" disabled="@ContextInvalid">Gem</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -118,17 +127,19 @@
|
|||
<p>Mindst 10 tegn bestående af store og små bogstaver samt tal. Password generator <a href="https://pw.nix.dk">pw.nix.dk</a></p>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="newPasswd" class="col-md-2 col-form-label">Ny</label>
|
||||
<div class="col-md-10">
|
||||
<InputText id="newPasswd" class="form-control" @bind-Value="@PasswdInput.NewPassword"/>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputText id="newPasswd" class="form-control" @bind-Value="@PasswdInput.NewPassword" placeholder="Ny Adgangskode"/>
|
||||
<ValidationMessage For="@(() => PasswdInput.NewPassword)"></ValidationMessage>
|
||||
<label for="newPasswd">Ny Adgangskode</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="verifyPasswd" class="col-md-2 col-form-label">Bekræft</label>
|
||||
<div class="col-md-10">
|
||||
<InputText id="verifyPasswd" class="form-control" @bind-Value="@PasswdInput.ConfirmPassword"/>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-floating">
|
||||
<InputText id="verifyPasswd" class="form-control" @bind-Value="@PasswdInput.ConfirmPassword" placeholder="Gentag Adgangskode"/>
|
||||
<ValidationMessage For="@(() => PasswdInput.ConfirmPassword)"></ValidationMessage>
|
||||
<label for="verifyPasswd">Gentag Adgangskode</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
|
|
|
@ -45,11 +45,8 @@ public partial class SystemUserCreatePage : IDisposable
|
|||
private PasswordInput PasswdInput { get; set; } = new();
|
||||
private RoleAssignment AssignedRoles { get; set; } = new();
|
||||
|
||||
private readonly JsonSerializerOptions _options = new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
private readonly JsonSerializerOptions _options = new() { PropertyNameCaseInsensitive = true };
|
||||
private bool _webShop;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
|
@ -90,6 +87,23 @@ public partial class SystemUserCreatePage : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
if (AssignedRoles.EShop)
|
||||
{
|
||||
AssignedRoles.Admin = false;
|
||||
AssignedRoles.Advisor = false;
|
||||
AssignedRoles.EDoc = false;
|
||||
AssignedRoles.Management = false;
|
||||
AssignedRoles.Office = false;
|
||||
AssignedRoles.Supervisor = false;
|
||||
AssignedRoles.Warehouse = false;
|
||||
_webShop = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_webShop = false;
|
||||
}
|
||||
|
||||
|
||||
NewUserInfo.Passwd = PasswdInput.NewPassword;
|
||||
ContextInvalid = !NewUserContext.Validate();
|
||||
StateHasChanged();
|
||||
|
|
|
@ -21,10 +21,13 @@
|
|||
|
||||
<PageTitle>System Bruger Oversigt</PageTitle>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="col-sm-8">
|
||||
<h3>System Bruger Oversigt</h3>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="col-sm-3 text-end">
|
||||
<a class="btn btn-primary" href="/system/users/create"><i class="bi-plus-lg"></i>Opret bruger</a>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<div class="text-end">
|
||||
<div class="busy-signal" style="display:@(Working ? "block" : "none")">
|
||||
<div class="spinner-grow text-info" role="status">
|
||||
|
@ -35,27 +38,24 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-5">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-1 mt-3">
|
||||
<div class="col-sm-3">
|
||||
<div class="fw-bold">Navn</div>
|
||||
</div>
|
||||
<div class="col-sm-4 mt-3">
|
||||
<div class="h4">Navn</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="fw-bold">Email</div>
|
||||
</div>
|
||||
<div class="col-sm-3 mt-3">
|
||||
<div class="h4">Email</div>
|
||||
</div>
|
||||
<div class="col-sm-2 mt-3">
|
||||
<div class="h4">Telefon</div>
|
||||
</div>
|
||||
<div class="col-sm-2 text-end mt-1">
|
||||
<a class="btn btn-primary" href="/system/users/create"><i class="bi-plus-lg"></i>Opret bruger</a>
|
||||
<div class="col-sm-2">
|
||||
<div class="fw-bold">Telefon</div>
|
||||
</div>
|
||||
<div class="col-sm-4 text-end">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (UserList.Any())
|
||||
{
|
||||
|
@ -63,10 +63,7 @@
|
|||
{
|
||||
<a class="list-group-item list-group-item-action" href="/system/users/@user.UserId">
|
||||
<div class="row">
|
||||
<div class="col-sm-1">
|
||||
@user.CountryCode @user.SalesRep
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
@user.FullName
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
|
@ -75,7 +72,7 @@
|
|||
<div class="col-sm-2">
|
||||
@user.PhoneNumber
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="col-sm-4">
|
||||
@user.Description
|
||||
</div>
|
||||
</div>
|
||||
|
@ -83,3 +80,4 @@
|
|||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
|
@ -30,6 +30,7 @@ public partial class SystemUserListPage : IDisposable
|
|||
|
||||
// #############################################################
|
||||
private List<UserInfoListView> UserList { get; set; } = new();
|
||||
private List<UserInfoListView> DisplayList { get; set; } = new();
|
||||
private bool Working { get; set; } = true;
|
||||
|
||||
|
||||
|
@ -39,6 +40,12 @@ public partial class SystemUserListPage : IDisposable
|
|||
Interceptor.RegisterBeforeSendEvent();
|
||||
|
||||
UserList = await UserRepo.GetUsers();
|
||||
if (UserList.Any())
|
||||
{
|
||||
UserList = UserList.Where(x => !x.LockoutEnabled).ToList();
|
||||
}
|
||||
DisplayList = UserList;
|
||||
|
||||
Working = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -112,35 +112,37 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th scope="col">Roller</th>
|
||||
<td>
|
||||
<td colspan="5">
|
||||
<div class="row">
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="admin" class="form-check-input" disabled="@ReadOnly" @bind-Value="AssignedRoles.Admin"/>
|
||||
<InputCheckbox id="admin" class="form-check-input" @bind-Value="AssignedRoles.Admin"/>
|
||||
<label for="admin" class="form-check-label">Administrator</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="office" class="form-check-input" disabled="@ReadOnly" @bind-Value="AssignedRoles.Office"/>
|
||||
<InputCheckbox id="warehouse" class="form-check-input" @bind-Value="AssignedRoles.Warehouse"/>
|
||||
<label for="warehouse" class="form-check-label">Lager</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="office" class="form-check-input" @bind-Value="AssignedRoles.Office"/>
|
||||
<label for="office" class="form-check-label">Kontor</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="eshop" class="form-check-input" disabled="@ReadOnly" @bind-Value="AssignedRoles.EShop"/>
|
||||
<label for="eshop" class="form-check-label">Kunde</label>
|
||||
<InputCheckbox id="eshop" class="form-check-input" @bind-Value="AssignedRoles.EShop"/>
|
||||
<label for="eshop" class="form-check-label">WebShop Kunde</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="warehouse" class="form-check-input" disabled="@ReadOnly" @bind-Value="AssignedRoles.Warehouse"/>
|
||||
<label for="warehouse" class="form-check-label">Forsendelse</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="management" class="form-check-input" disabled="@ReadOnly" @bind-Value="AssignedRoles.Management"/>
|
||||
<InputCheckbox id="management" class="form-check-input" @bind-Value="AssignedRoles.Management"/>
|
||||
<label for="management" class="form-check-label">Ledelse</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="supervisor" class="form-check-input" disabled="@ReadOnly" @bind-Value="AssignedRoles.Supervisor"/>
|
||||
<InputCheckbox id="supervisor" class="form-check-input" @bind-Value="AssignedRoles.Supervisor"/>
|
||||
<label for="supervisor" class="form-check-label">Supervisor</label>
|
||||
</div>
|
||||
<div class="ms-2 col-sm-2 form-check form-switch">
|
||||
<InputCheckbox id="advisor" class="form-check-input" disabled="@ReadOnly" @bind-Value="AssignedRoles.Advisor"/>
|
||||
<InputCheckbox id="advisor" class="form-check-input" @bind-Value="AssignedRoles.Advisor"/>
|
||||
<label for="advisor" class="form-check-label">Sælger</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -149,16 +151,16 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button type="button" class="btn btn-danger" disabled="@ReadOnly" @onclick="@SendDeleteRequest">SLET</button>
|
||||
<button type="button" class="btn btn-danger" disabled="@ReadOnly" @onclick="@SendDeleteRequest"><i class="bi-trash"></i> SLET</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="button" class="btn btn-warning" @onclick="@(() => ReadOnly = !ReadOnly)">Rediger</button>
|
||||
<button type="button" class="btn btn-warning" @onclick="@(() => ReadOnly = !ReadOnly)"><i class="bi-pencil"></i> Rediger</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-primary" disabled="@ReadOnly">Gem</button>
|
||||
<button type="submit" class="btn btn-primary" disabled="@ReadOnly"><i class="bi-cloud-arrow-up"></i> Gem</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a class="btn btn-primary" href="/system/users">Tilbage</a>
|
||||
<a class="btn btn-primary" href="/system/users"><i class="bi-back-lg"></i> Tilbage</a>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
|
|
|
@ -131,8 +131,8 @@
|
|||
<AuthorizeView Roles="Management">
|
||||
<Authorized>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link ps-2" href="/management">
|
||||
<i class="bi-people pe-2" style="font-size:1.3em;" aria-hidden="true"></i> Management
|
||||
<NavLink class="nav-link ps-2" href="/manager">
|
||||
<i class="bi-people pe-2" style="font-size:1.3em;" aria-hidden="true"></i> Manager
|
||||
</NavLink>
|
||||
</div>
|
||||
</Authorized>
|
||||
|
|
|
@ -26,6 +26,8 @@ public class UserInfoListView
|
|||
|
||||
public string FullName { get; set; } = "";
|
||||
|
||||
public bool LockoutEnabled { get; set; }
|
||||
|
||||
public string PhoneNumber { get; set; } = "";
|
||||
|
||||
public string SalesRep { get; set; } = "";
|
||||
|
|
Loading…
Reference in a new issue