imrpovements, fixes

This commit is contained in:
Loretta 2024-06-26 18:55:23 +02:00
parent c9f75b576e
commit 72f1cbb8e1
5 changed files with 63 additions and 53 deletions

View File

@ -12,13 +12,14 @@
@using AyCode.Core.Loggers
@using AyCode.Services.Loggers
@using AyCode.Core
@using AyCode.Core.Extensions
@inject IServiceProviderDataService ServiceProviderDataService
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
@inject AdminSignalRClient AdminSignalRClient
<CarDetailGrid Logger="_logger"
ContextIds="new [] {ContextId}"
ContextIds="@(ContextId.IsNullOrEmpty() ? throw new InvalidDataException($"ContextId.IsNullOrEmpty(); ContextId: {ContextId}") : [ContextId])"
GetAllMessageTag="GetAllTag"
SignalRClient="AdminSignalRClient"
PageSize="10"
@ -29,14 +30,18 @@
CustomizeEditModel="CustomizeEditModel"
EditMode="GridEditMode.EditForm"
ColumnResizeMode="GridColumnResizeMode.NextColumn"
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode"
ShowFilterRow="true">
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
<Columns>
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
<DxGridDataColumn FieldName="Id" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
<DxGridDataColumn FieldName="UserProductMappingId" />
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
<DxGridDataColumn FieldName="UserProductMappingId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
@{
var userEmailFieldName = $"{nameof(Car.UserProductMapping)}.{nameof(UserProductMapping.User)}.{nameof(User.EmailAddress)}";
}
<DxGridDataColumn FieldName="@userEmailFieldName" Caption="User email" SortIndex="0" />
<DxGridDataColumn FieldName="CountryCode"/>
<DxGridDataColumn FieldName="LicencePlate"/>
<DxGridDataColumn FieldName="LicencePlate" SortIndex="0" />
<DxGridDataColumn FieldName="Color"/>
<DxGridDataColumn FieldName="Manufacture"/>
<DxGridDataColumn FieldName="CarModel"/>

View File

@ -12,13 +12,13 @@
@using AyCode.Core.Loggers
@using AyCode.Services.Loggers
@using AyCode.Core
@using AyCode.Core.Extensions
@inject IServiceProviderDataService ServiceProviderDataService
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
@inject AdminSignalRClient AdminSignalRClient
<CarGrid Logger="_logger"
ContextIds="new [] {ContextId}"
GetAllMessageTag="GetAllTag"
SignalRClient="AdminSignalRClient"
PageSize="10"
@ -33,9 +33,13 @@
ShowFilterRow="true">
<Columns>
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
<DxGridDataColumn FieldName="Id" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
<DxGridDataColumn FieldName="UserProductMappingId" />
<DxGridDataColumn FieldName="CountryCode"/>
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
<DxGridDataColumn FieldName="UserProductMappingId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
@{
var userEmailFieldName = $"{nameof(Car.UserProductMapping)}.{nameof(UserProductMapping.User)}.{nameof(User.EmailAddress)}";
}
<DxGridDataColumn FieldName="@userEmailFieldName" Caption="User email" SortIndex="0" />
<DxGridDataColumn FieldName="CountryCode" />
<DxGridDataColumn FieldName="LicencePlate"/>
<DxGridDataColumn FieldName="Color"/>
<DxGridDataColumn FieldName="Manufacture"/>
@ -91,7 +95,6 @@
</CarGrid>
@code {
[Parameter] public Guid ContextId { get; set; }
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
[Parameter] public ICarRelation ParentData { get; set; } = null!;
[Parameter] public int GetAllTag { get; set; } = SignalRTags.GetAllCars;

View File

@ -74,9 +74,16 @@
ShowFilterRow="true">
<Columns>
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
<DxGridDataColumn FieldName="Id" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
<DxGridDataColumn FieldName="UserId" />
<DxGridDataColumn FieldName="ProductId" Width="40%" />
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
@{
var userEmailFieldName = $"{nameof(UserProductMapping.User)}.{nameof(User.EmailAddress)}";
}
<DxGridDataColumn FieldName="@userEmailFieldName" Caption="User email" SortIndex="0" />
<DxGridDataColumn FieldName="ProductId" Caption="ServiceId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
@{
var productNameFieldName = $"{nameof(UserProductMapping.Product)}.{nameof(Product.Name)}";
}
<DxGridDataColumn FieldName="@productNameFieldName" Caption="Service name" />
<DxGridDataColumn FieldName="Permissions" />
</Columns>
<DetailRowTemplate>

View File

@ -19,7 +19,6 @@
<TransferDestinationToProductGrid
Logger="_logger"
SignalRClient="AdminSignalRClient"
ContextIds="@(ContextId.IsNullOrEmpty() ? throw new InvalidDataException($"ContextId.IsNullOrEmpty(); ContextId: {ContextId}") : [ContextId.Value])"
PageSize="10"
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
KeyFieldName="Id"
@ -69,9 +68,7 @@
@code {
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
[Parameter] public Guid? ContextId { get; set; }
private Guid[] ContextIds = new Guid[0];
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
protected override void OnInitialized()
@ -81,17 +78,6 @@
base.OnInitialized();
}
protected override void OnParametersSet()
{
if(ContextId.HasValue)
{
ContextIds = new Guid[1];
ContextIds[0] = (Guid)ContextId!;
}
base.OnParametersSet();
}
// void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
// {
// if (!e.IsNew) return;

View File

@ -33,10 +33,19 @@
ShowFilterRow="true">
<Columns>
<DxGridCommandColumn Width="135" MinWidth="135" DeleteButtonVisible="AcDomain.IsDeveloperVersion" EditButtonVisible="AcDomain.IsDeveloperVersion" FixedPosition="GridColumnFixedPosition.Left" />
<DxGridDataColumn FieldName="Id" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
<DxGridDataColumn FieldName="UserId" Caption="UserId" />
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
<DxGridDataColumn FieldName="UserId" Caption="UserId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
@{
var userEmailFieldName = $"{nameof(UserProductMapping.User)}.{nameof(User.EmailAddress)}";
}
<DxGridDataColumn FieldName="@userEmailFieldName" Caption="User email" SortIndex="0" />
@* <DxGridDataColumn FieldName="@nameof(UserProductMapping.User.EmailAddress)" Caption="User name" /> *@
<DxGridDataColumn FieldName="ProductId" Caption="ServiceId" />
<DxGridDataColumn FieldName="ProductId" Caption="ServiceId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
@{
var productNameFieldName = $"{nameof(UserProductMapping.Product)}.{nameof(Product.Name)}";
}
<DxGridDataColumn FieldName="@productNameFieldName" Caption="Service name" />
@* <DxGridDataColumn FieldName="@nameof(UserProductMapping.Product.Name)" Caption="Service name" /> *@
@* <DxGridDataColumn FieldName="UserProductMapping.Product.Name" Caption="Service name" /> *@
@* <DxGridDataColumn FieldName="@nameof(Product.ServiceProvider.Name)" Caption="Company name" /> *@