WIP user manager create web shop user pick company

This commit is contained in:
Frede Hundewadt 2023-06-07 17:12:39 +02:00
parent 4c8ea61749
commit 7d21b834fc
49 changed files with 229 additions and 135 deletions

View file

@ -0,0 +1,29 @@
using System.Reflection.Metadata.Ecma335;
using Wonky.Client.Models;
using Wonky.Entity.DTO;
namespace Wonky.Client.Helpers;
public class Mapper
{
public static UserManagerCreateView MapCreateUser(CreateUserInputModel model)
{
return new UserManagerCreateView
{
Description = model.Description,
Email = model.Email,
Passwd = model.NewPassword,
AssignedRoles = model.AssignedRoles,
CompanyId = model.CompanyId,
CountryCode = model.CountryCode,
EmailConfirmed = true,
EShop = model.EShop,
FirstName = model.FirstName,
LastName = model.LastName,
LockoutEnabled = false,
PhoneNumber = model.PhoneNumber,
SalesRep = model.SalesRep,
UserId = ""
};
}
}

View file

@ -0,0 +1,46 @@
using System.ComponentModel.DataAnnotations;
using Wonky.Entity.DTO;
namespace Wonky.Client.Models;
public class CreateUserInputModel
{
[MaxLength(128)] public string CompanyId { get; set; } = "";
[Required(ErrorMessage = "Der skal vælges et land")]
public string CountryCode { get; set; } = "";
[MaxLength(128, ErrorMessage = "Kort beskrivelse på højst 128 tegn.")]
public string Description { get; set; } = "";
[Required(ErrorMessage = "Email adresse skal udfyldes")]
[MaxLength(255, ErrorMessage = "Der er afsat 255 tegn til email adressen")]
public string Email { get; set; } = "";
public bool EmailConfirmed { get; set; }
public bool EShop { get; set; }
[Required(ErrorMessage = "Fornavn skal udfyldes")]
[MaxLength(50, ErrorMessage = "Der er afsat 50 tegn til fornavn")]
public string FirstName { get; set; } = "";
[Required(ErrorMessage = "Efternavn skal udfyldes")]
[MaxLength(50, ErrorMessage = "Der er afsat 50 tegn til efternavn")]
public string LastName { get; set; } = "";
public bool LockoutEnabled { get; set; }
[Required(ErrorMessage = "AdgangsKode skal udfyldes")]
public string NewPassword { get; set; } = "";
[Compare(nameof(NewPassword), ErrorMessage = "Adgangskoder er ikke ens.")]
public string ConfirmPassword { get; set; } = "";
[MaxLength(20, ErrorMessage = "Der er afsat 20 tegn til telefon nummber")]
public string PhoneNumber { get; set; } = "";
[MaxLength(20, ErrorMessage = "Der er afsat 20 tegn til Sælger Identifikation")]
public string SalesRep { get; set; } = "";
public List<UserRoleAssignment> AssignedRoles { get; set; } = new();
}

View file

@ -33,4 +33,4 @@
<div class="modal-backdrop fade show"></div>
}
<CustomerInventoryReorderOverlay CompanyId="@CompanyId" SalesItem="SalesItem" OnSelected="OnSelected" @ref="ReorderOverlay" />
<CustomerInventoryReorderOverlay CompanyId="@CompanyId" SalesItem="SalesItem" OnSelected="OnSelected" @ref="@ReorderOverlay" />

View file

@ -34,4 +34,4 @@
<div class="modal-backdrop fade show"></div>
}
<CustomerInvoiceViewOverlay CompanyId="@Company.CompanyId" InvoiceId="@InvoiceId" @ref="CustomerInvoiceView" />
<CustomerInvoiceViewOverlay CompanyId="@Company.CompanyId" InvoiceId="@InvoiceId" @ref="@CustomerInvoiceView" />

View file

@ -23,72 +23,60 @@
<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="sticky-top rounded-2 p-3">
<div class="row mb-2">
<div class="col-sm-2">
<SearchCatalogColumnComponent OnChanged="SetSearchCol"/>
<SearchCustomerColumnComponent OnChanged="SetSearchCol"/>
</div>
<div class="col-sm-6">
<SearchCatalogPhraseComponent OnChanged="SetSearchPhrase"/>
<SearchCustomerPhraseComponent OnChanged="SetSearchPhrase"/>
</div>
<div class="col-sm-2">
<SearchCatalogSortColumnComponent OnChanged="SetSortCol"/>
<SearchCustomerSortColumnComponent 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 class="col-sm-3 fw-bold">Navn</div>
<div class="col-sm-2 fw-bold">Konto</div>
<div class="col-sm-2 fw-bold">Telefon</div>
<div class="col-sm-1 fw-bold">Post Nr.</div>
<div class="col-sm-2 fw-bold">Bynavn</div>
</div>
</div>
@if (Items.Any())
@if (Companies.Any())
{
<ul class="list-group list-group-flush">
@foreach (var item in Items)
@foreach (var company in Companies)
{
<li class="list-group-item">
<li class="list-group-item list-group-item-action action-link-element" @onclick="@(() => SelectCompany(company))">
<div class="row align-middle">
<div class="col-sm-3 text-sm-start">
@item.Name
@company.Name
</div>
<div class="col-sm-2 text-sm-start">
@item.Sku
@company.Account
</div>
<div class="col-sm-2 text-sm-start">
@item.ShortName
@company.Phone
</div>
<div class="col-sm-1 text-center">
@item.BoxSize
@company.ZipCode
</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 class="col-sm-2">
@company.City
</div>
</div>
</li>
}
</ul>

View file

@ -20,38 +20,39 @@ using Wonky.Client.HttpInterceptors;
using Wonky.Client.HttpRepository;
using Wonky.Client.Local.Services;
using Wonky.Client.Models;
using Wonky.Entity.DTO;
using Wonky.Entity.Requests;
using Wonky.Entity.Views;
#pragma warning disable CS8618
namespace Wonky.Client.Overlay.System;
namespace Wonky.Client.OverlaySystem;
public partial class SelectCustomerPagedOverlay : IDisposable
public partial class CustomerSearchOverlay : IDisposable
{
// ##############################################################
[Inject] public ICountryCatalogRepository CatalogRepo { get; set; }
[Inject] public ICountryCustomerRepository CustomerRepo { get; set; }
[Inject] public HttpInterceptorService Interceptor { get; set; }
[Inject] public UserPreferenceService PreferenceService { get; set; }
[Inject] public ILogger<SelectCustomerPagedOverlay> Logger { get; set; }
[Inject] public ILogger<CustomerSearchOverlay> Logger { get; set; }
// ##############################################################
[Parameter] public string CountryCode { get; set; } = "";
[Parameter] public EventCallback<SelectedSku> OnSelected { get; set; }
[Parameter] public EventCallback<CompanyDto> OnSelected { get; set; }
// ##############################################################
private string _modalDisplay = "";
private bool _showBackdrop;
private List<SalesItemView> Items { get; set; } = new();
private List<CompanyDto> Companies { get; set; } = new();
private MetaData? PageData { get; set; } = new();
private CatalogPager _pager = new();
private CustomerPaging _pager = new();
private UserPreference _userPreference = new();
protected override async Task OnParametersSetAsync()
{
Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent();
await GetSalesItems();
await GetCompanies();
}
protected override async Task OnInitializedAsync()
@ -62,58 +63,58 @@ public partial class SelectCustomerPagedOverlay : IDisposable
_pager.PageSize = Convert.ToInt32(_userPreference.PageSize);
}
private async Task GetSalesItems()
private async Task GetCompanies()
{
var pagingResponse = await CatalogRepo.GetSalesItemsPaged(CountryCode, _pager);
if (pagingResponse == null)
Task.Delay(250);
Items = pagingResponse.Items!;
var pagingResponse = await CustomerRepo.GetCompaniesPaged(CountryCode, _pager);
// if (pagingResponse == null)
// Task.Delay(250);
Companies = pagingResponse.Items;
PageData = pagingResponse.MetaData;
Logger.LogDebug("PriceCatalogOverlay => Items <= {}", JsonSerializer.Serialize(Items));
}
private void SelectItem(string itemId, string quantity, string rate)
private async Task SelectCompany(CompanyDto company)
{
OnSelected.InvokeAsync(new SelectedSku { Quantity = quantity, Rate = rate, ItemId = itemId });
Hide();
await OnSelected.InvokeAsync(company);
}
private async Task SetSelectedPage(int page)
{
Items = new List<SalesItemView>();
Companies = new List<CompanyDto>();
_pager.PageNumber = page;
await GetSalesItems();
await GetCompanies();
}
private async Task SetSearchPhrase(string searchTerm)
{
Items = new List<SalesItemView>();
Companies = new List<CompanyDto>();
_pager.PageNumber = 1;
_pager.SearchTerm = searchTerm;
await GetSalesItems();
await GetCompanies();
}
private async Task SetPageSize(string pageSize)
{
Items = new List<SalesItemView>();
Companies = new List<CompanyDto>();
_pager.PageSize = Convert.ToInt32(pageSize);
_pager.PageNumber = 1;
await GetSalesItems();
await GetCompanies();
}
private async Task SetSearchCol(string columnName)
{
Items = new List<SalesItemView>();
Companies = new List<CompanyDto>();
_pager.PageNumber = 1;
_pager.SearchColumn = columnName;
await GetSalesItems();
await GetCompanies();
}
private async Task SetSortCol(string orderBy)
{
Items = new List<SalesItemView>();
Companies = new List<CompanyDto>();
_pager.OrderBy = orderBy;
await GetSalesItems();
await GetCompanies();
}
public void Show()
@ -123,7 +124,7 @@ public partial class SelectCustomerPagedOverlay : IDisposable
StateHasChanged();
}
private void Hide()
public void Hide()
{
_modalDisplay = "none;";
_showBackdrop = false;

View file

@ -16,6 +16,7 @@
@using Microsoft.AspNetCore.Authorization
@using Wonky.Client.Components
@using Wonky.Client.OverlaySystem
@attribute [Authorize(Roles = "Admin")]
@page "/system/users/create"
@ -27,84 +28,68 @@
</div>
</div>
<div class="card-body">
<EditForm EditContext="NewUserContext" OnValidSubmit="CreateUserRequest">
<EditForm EditContext="FormContext" OnValidSubmit="CreateUserRequest">
<DataAnnotationsValidator/>
<div class="row g-3 mb-3">
@* 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>
<InputText id="firstName" class="form-control" @bind-Value="CreateUserInput.FirstName" placeholder="Fornavn"/>
<ValidationMessage For="@(() => CreateUserInput.FirstName)"></ValidationMessage>
<label for="firstName">Fornavn</label>
</div>
</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>
<InputText id="lastName" class="form-control" @bind-Value="CreateUserInput.LastName" placeholder="Efternavn"/>
<ValidationMessage For="@(() => CreateUserInput.LastName)"></ValidationMessage>
<label for="lastName">Efternavn</label>
</div>
</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>
<InputText id="email" class="form-control" @bind-Value="CreateUserInput.Email" placeholder="Email"/>
<ValidationMessage For="@(() => CreateUserInput.Email)"></ValidationMessage>
<label for="email">Email</label>
</div>
</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>
<InputText id="phoneNumber" class="form-control" @bind-Value="CreateUserInput.PhoneNumber" placeholder="Direkte Telefon Nr."/>
<ValidationMessage For="@(() => CreateUserInput.PhoneNumber)"></ValidationMessage>
<label for="phoneNumber">Direkte Telefon Nr.</label>
</div>
</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>
<InputText id="salesRep" class="form-control" @bind-Value="CreateUserInput.SalesRep" placeholder="Sælger"/>
<ValidationMessage For="@(() => CreateUserInput.SalesRep)"></ValidationMessage>
<label for="salesRep">Sælger</label>
</div>
</div>
@* countrycode *@
<div class="col-sm-6">
<div class="form-floating">
<InputSelect id="countryCode" class="form-control" @bind-Value="NewUserInfo.CountryCode" placeholder="Landekode">
<InputSelect id="countryCode" class="form-control" @bind-Value="CreateUserInput.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>
<ValidationMessage For="@(() => CreateUserInput.CountryCode)"></ValidationMessage>
<label for="countryCode">Landekode</label>
</div>
</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">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"/>
<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" @bind-Value="AssignedRoles.Supervisor"/>
<label for="supervisor" class="form-check-label">Supervisor</label>
@ -113,7 +98,35 @@
<InputCheckbox id="advisor" class="form-check-input" @bind-Value="AssignedRoles.Advisor"/>
<label for="advisor" class="form-check-label">Sælger</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="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="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="admin" class="form-check-input" @bind-Value="AssignedRoles.Admin"/>
<label for="admin" class="form-check-label">Administrator</label>
</div>
</div>
<div class="row @(_webShop && !string.IsNullOrWhiteSpace(CreateUserInput.CountryCode) ? "inno-display" : "inno-hidden")">
<div class="col-sm-10">
@_company.Name - @_company.Account - @_company.Phone
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary" @onclick="@ShowSearchOverlay">
Tilknyt kunde ...
</button>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-6">
<a class="btn btn-primary" href="/system/users"><i class="bi-back"></i> Tilbage</a>
@ -130,14 +143,14 @@
<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>
<ValidationMessage For="@(() => CreateUserInput.NewPassword)"></ValidationMessage>
<label for="newPasswd">Ny Adgangskode</label>
</div>
</div>
<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>
<ValidationMessage For="@(() => CreateUserInput.ConfirmPassword)"></ValidationMessage>
<label for="verifyPasswd">Gentag Adgangskode</label>
</div>
</div>
@ -150,4 +163,6 @@
@if (Working)
{
<WorkingThreeDots/>
}
}
<CustomerSearchOverlay CountryCode="@CreateUserInput.CountryCode" OnSelected="@OnSelectCompany" @ref="SearchOverlay" />

View file

@ -22,6 +22,7 @@ using Wonky.Client.Helpers;
using Wonky.Client.HttpInterceptors;
using Wonky.Client.HttpRepository;
using Wonky.Client.Models;
using Wonky.Client.OverlaySystem;
using Wonky.Entity.DTO;
#pragma warning disable CS8618
@ -37,8 +38,9 @@ public partial class SystemUserCreatePage : IDisposable
[Inject] public IToastService Toaster { get; set; }
// #############################################################
private UserManagerCreateView NewUserInfo { get; set; } = new();
private EditContext NewUserContext { get; set; }
private CreateUserInputModel CreateUserInput { get; set; } = new();
private UserManagerCreateView CreateUserDto { get; set; } = new();
private EditContext FormContext { get; set; }
private bool ContextInvalid { get; set; } = true;
private bool Working { get; set; } = true;
private bool ReadOnly { get; set; } = true;
@ -47,16 +49,18 @@ public partial class SystemUserCreatePage : IDisposable
private readonly JsonSerializerOptions _options = new() { PropertyNameCaseInsensitive = true };
private bool _webShop;
private CompanyDto _company = new();
private CustomerSearchOverlay SearchOverlay { get; set; }
protected override void OnParametersSet()
{
Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent();
NewUserContext = new EditContext(NewUserInfo);
FormContext = new EditContext(CreateUserInput);
NewUserContext.OnFieldChanged += ContextHandleFieldChanged!;
NewUserContext.OnValidationStateChanged += ContextValidationChanged;
FormContext.OnFieldChanged += ContextHandleFieldChanged!;
FormContext.OnValidationStateChanged += ContextValidationChanged;
Working = false;
}
@ -66,15 +70,33 @@ public partial class SystemUserCreatePage : IDisposable
ReadOnly = true;
Working = true;
NewUserInfo.AssignedRoles = Utils.MapSaveAssignedRoles(AssignedRoles);
CreateUserInput.AssignedRoles = Utils.MapSaveAssignedRoles(AssignedRoles);
CreateUserInput.EShop = _webShop;
CreateUserInput.CompanyId = !_webShop ? "" : _company.CompanyId;
Toaster.ShowInfo("Sender data til server ...");
await UserRepo.CreateUser(NewUserInfo);
CreateUserDto = Mapper.MapCreateUser(CreateUserInput);
await UserRepo.CreateUser(CreateUserDto);
Working = false;
Toaster.ShowInfo("Bruger er oprettet ...");
}
private void ShowSearchOverlay()
{
SearchOverlay.Show();
}
private void OnSelectCompany(CompanyDto company)
{
_company = company;
CreateUserInput.CompanyId = _company.CompanyId;
SearchOverlay.Hide();
}
private void ContextHandleFieldChanged(object? sender, FieldChangedEventArgs e)
{
Logger.LogDebug("contextHandleFieldChanged => e.FieldIdentifier.FieldName {}", e.FieldIdentifier.FieldName);
@ -102,10 +124,8 @@ public partial class SystemUserCreatePage : IDisposable
{
_webShop = false;
}
NewUserInfo.Passwd = PasswdInput.NewPassword;
ContextInvalid = !NewUserContext.Validate();
ContextInvalid = !FormContext.Validate();
StateHasChanged();
}
@ -114,20 +134,20 @@ public partial class SystemUserCreatePage : IDisposable
{
ContextInvalid = true;
NewUserContext.OnFieldChanged -= ContextHandleFieldChanged;
NewUserContext.OnValidationStateChanged -= ContextValidationChanged;
FormContext.OnFieldChanged -= ContextHandleFieldChanged;
FormContext.OnValidationStateChanged -= ContextValidationChanged;
NewUserContext = new EditContext(NewUserInfo);
FormContext = new EditContext(CreateUserInput);
NewUserContext.OnFieldChanged += ContextHandleFieldChanged;
NewUserContext.OnValidationStateChanged += ContextValidationChanged;
FormContext.OnFieldChanged += ContextHandleFieldChanged;
FormContext.OnValidationStateChanged += ContextValidationChanged;
}
public void Dispose()
{
Interceptor.DisposeEvent();
NewUserContext.OnFieldChanged -= ContextHandleFieldChanged!;
NewUserContext.OnValidationStateChanged -= ContextValidationChanged;
FormContext.OnFieldChanged -= ContextHandleFieldChanged!;
FormContext.OnValidationStateChanged -= ContextValidationChanged;
}
}

View file

@ -114,26 +114,10 @@
<th scope="col">Roller</th>
<td colspan="5">
<div class="row">
<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">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" @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="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" @bind-Value="AssignedRoles.Supervisor"/>
<label for="supervisor" class="form-check-label">Supervisor</label>
@ -142,6 +126,22 @@
<InputCheckbox id="advisor" class="form-check-input" @bind-Value="AssignedRoles.Advisor"/>
<label for="advisor" class="form-check-label">Sælger</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="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="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="admin" class="form-check-input" @bind-Value="AssignedRoles.Admin"/>
<label for="admin" class="form-check-label">Administrator</label>
</div>
</div>
</td>
</tr>

View file

@ -1,5 +1,4 @@
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
body {
body {
font-size: 16px;
}
@ -20,6 +19,7 @@ body {
.action-link-element {
cursor: pointer;
}
.i-larger {
font-size: 1.3rem;
}
@ -118,9 +118,6 @@ a, .btn-link {
.the-dead-bg {
background-color: black;
}
/* end state elements */
/* led elements */

View file

@ -22,10 +22,8 @@ namespace Wonky.Entity.DTO;
public class UserManagerCreateView
{
[MaxLength(128)] public string CompanyId { get; set; } = "";
[MaxLength(128)] public string ContactId { get; set; } = "";
[Required(ErrorMessage = "Landekode skal udfyldes")]
[MaxLength(2, ErrorMessage = "Landekode er 2 bogstaver")]
[Required(ErrorMessage = "Land skal angives")]
public string CountryCode { get; set; } = "";
[MaxLength(128, ErrorMessage = "Kort beskrivelse på højst 128 tegn.")]