improvements, fixes...

This commit is contained in:
Loretta 2024-06-26 17:26:52 +02:00
parent 831935ad1b
commit 632f894c5e
4 changed files with 27 additions and 6 deletions

View File

@ -1,10 +1,17 @@
using AyCode.Interfaces;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using AyCode.Interfaces;
using TIAM.Entities.Users;
namespace TIAM.Models.Dtos.Users
{
public class UserDtoDetail : UserDto, IUserDtoDetail
{
[NotMapped]
[JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
public string? FullName => Profile.FullName;
public string? PhoneNumber { get; set; }
public string? RefreshToken { get; set; }
public Guid? RefferalId { get; set; }

View File

@ -34,8 +34,12 @@
<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" />
<DxGridDataColumn FieldName="ProductId" Width="40%" />
<DxGridDataColumn FieldName="UserId" Caption="UserId" />
@* <DxGridDataColumn FieldName="@nameof(UserProductMapping.User.EmailAddress)" Caption="User name" /> *@
<DxGridDataColumn FieldName="ProductId" Caption="ServiceId" />
@* <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" /> *@
<DxGridDataColumn FieldName="Permissions" />
</Columns>
<DetailRowTemplate>
@ -50,10 +54,10 @@
<EditFormTemplate Context="userEditFormContext">
@{
var transfer2 = (UserProductMapping)userEditFormContext.EditModel;
var userProduct = (UserProductMapping)userEditFormContext.EditModel;
}
<DxFormLayout CssClass="w-100">
<DxFormLayoutItem Caption="UserId" ColSpanMd="4">
<DxFormLayoutItem Caption="User" ColSpanMd="4">
@userEditFormContext.GetEditor("UserId")
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Product:" ColSpanMd="4">

View File

@ -273,7 +273,7 @@ namespace TIAMWebApp.Server.Controllers
{
_logger.Info($@"GetAllUserProductMappings called");
var companyies = (await adminDal.GetAllUserProductMappingsAsync()).OrderBy(x => x.ProductId).ToList();
var companyies = (await adminDal.GetAllUserProductMappingsAsync()).OrderBy(x => x.User.Profile.Name).ToList();
return companyies;
}

View File

@ -8,6 +8,7 @@ using TIAM.Core.Loggers;
using TIAM.Database.Test;
using TIAM.Entities.ServiceProviders;
using TIAM.Entities.Transfers;
using TIAM.Entities.Users;
using TIAM.Services;
using TIAMWebApp.Shared.Application.Services;
using TIAMWebApp.Shared.Application.Utility;
@ -91,6 +92,15 @@ namespace Tiam.Services.Client.Tests
Assert.IsTrue(companies.Count > 0);
}
[TestMethod]
public async Task GetAllUserProductMappingsTest_ReturnProductMappings_WhenHasProductMappings()
{
var userProductMapping = await _signalRClient.GetAllAsync<List<UserProductMapping>>(SignalRTags.GetAllUserProductMappings);
Assert.IsNotNull(userProductMapping);
Assert.IsTrue(userProductMapping.Count > 0);
}
[DataTestMethod]
[DataRow(["cfb27fc2-54c2-4f07-8471-587d6b79b019", "7385c4e3-3c1e-4c5e-9926-8c0ea60dcb38"])]
public async Task TransferDestinationCrudTest(string[] transferDestIdAddressIdStrings)