Te is basszódj meg!!!!
This commit is contained in:
parent
5f1853927a
commit
ee0792ca50
|
|
@ -246,7 +246,7 @@ namespace TIAM.Database.Test
|
||||||
|
|
||||||
Assert.IsNotNull(userModel);
|
Assert.IsNotNull(userModel);
|
||||||
Assert.IsNotNull(userModel.UserDto);
|
Assert.IsNotNull(userModel.UserDto);
|
||||||
Assert.IsNotNull(userModel.Profile);
|
Assert.IsNotNull(userModel.ProfileDto);
|
||||||
|
|
||||||
Assert.IsTrue(userModel.Id == userId, "userModel.Id != userId");
|
Assert.IsTrue(userModel.Id == userId, "userModel.Id != userId");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,11 @@ namespace TIAM.Database.Test
|
||||||
Assert.IsTrue(user.UserToServiceProviders.Count > 0);
|
Assert.IsTrue(user.UserToServiceProviders.Count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DataTestMethod]
|
||||||
|
[DataRow("540271F6-C604-4C16-8160-D5A7CAFEDF00")]
|
||||||
|
public override void AcBase_GetUserModelDtoDetailById_ReturnsUser_WhenUserExists(string userIdString)
|
||||||
|
=> base.AcBase_GetUserModelDtoDetailById_ReturnsUser_WhenUserExists(userIdString);
|
||||||
|
|
||||||
[DataTestMethod]
|
[DataTestMethod]
|
||||||
[DataRow("540271F6-C604-4C16-8160-D5A7CAFEDF00")]
|
[DataRow("540271F6-C604-4C16-8160-D5A7CAFEDF00")]
|
||||||
[DataRow("dcf451d2-cc4c-4ac2-8c1f-da00041be1fd")]
|
[DataRow("dcf451d2-cc4c-4ac2-8c1f-da00041be1fd")]
|
||||||
|
|
@ -171,7 +176,7 @@ namespace TIAM.Database.Test
|
||||||
|
|
||||||
Assert.IsNotNull(userModel);
|
Assert.IsNotNull(userModel);
|
||||||
Assert.IsNotNull(userModel.UserDto);
|
Assert.IsNotNull(userModel.UserDto);
|
||||||
Assert.IsNotNull(userModel.Profile);
|
Assert.IsNotNull(userModel.ProfileDto);
|
||||||
|
|
||||||
if (userId != Guid.Parse("540271F6-C604-4C16-8160-D5A7CAFEDF00")) return; //csak az "540271F6.."-nek van product-ja! - J.
|
if (userId != Guid.Parse("540271F6-C604-4C16-8160-D5A7CAFEDF00")) return; //csak az "540271F6.."-nek van product-ja! - J.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using TIAM.Entities.Addresses;
|
||||||
|
|
||||||
namespace TIAM.Entities.Profiles;
|
namespace TIAM.Entities.Profiles;
|
||||||
|
|
||||||
public interface IProfile<TAddress> : IAcProfile<TAddress>, IProfileDto where TAddress : class, IAddress
|
public interface IProfile<TAddress> : IAcProfile<TAddress>, IProfileDto<TAddress> where TAddress : class, IAddress
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
using AyCode.Interfaces.Profiles.Dtos;
|
using AyCode.Interfaces.Profiles.Dtos;
|
||||||
|
using TIAM.Entities.Addresses;
|
||||||
|
|
||||||
namespace TIAM.Entities.Profiles;
|
namespace TIAM.Entities.Profiles;
|
||||||
|
|
||||||
public interface IProfileDto : IAcProfileDtoBase
|
public interface IProfileDto : IAcProfileDtoBase
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IProfileDto<TAddress> : IProfileDto, IAcProfileDtoBase<TAddress> where TAddress : class, IAddressDto
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -6,7 +6,7 @@ using TIAM.Entities.ServiceProviders;
|
||||||
|
|
||||||
namespace TIAM.Entities.Users;
|
namespace TIAM.Entities.Users;
|
||||||
|
|
||||||
public interface IUser : IAcUser<Profile, Company, UserToCompany, Address>, IUserDto<Profile, Company, UserToCompany, Address>, IUserBase
|
public interface IUser : IAcUser<Profile, Company, UserToCompany, Address>, IUserDto<Profile, Company, UserToCompany>, IUserBase
|
||||||
{
|
{
|
||||||
public List<Product> Products { get; }
|
public List<Product> Products { get; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,8 @@ using TIAM.Entities.ServiceProviders;
|
||||||
|
|
||||||
namespace TIAM.Entities.Users;
|
namespace TIAM.Entities.Users;
|
||||||
|
|
||||||
public interface IUserDto<TProfile, TCompany, TUserToServiceProvider, TProfileAddress> : IAcUserDtoBase<TProfile, TCompany, TUserToServiceProvider, TProfileAddress>
|
public interface IUserDto<TProfile, TCompany, TUserToServiceProvider> : IAcUserDtoBase<TProfile, TCompany, TUserToServiceProvider>
|
||||||
where TProfile : class, IProfile<TProfileAddress>
|
where TProfile : class, IProfileDto
|
||||||
where TCompany : class, ICompanyBase
|
where TCompany : class, ICompanyBase
|
||||||
where TUserToServiceProvider : class, IUserToCompanyBase
|
where TUserToServiceProvider : class, IUserToCompanyBase
|
||||||
where TProfileAddress : class, IAddress
|
|
||||||
{ }
|
{ }
|
||||||
|
|
@ -14,7 +14,7 @@ using TIAM.Entities.ServiceProviders;
|
||||||
namespace TIAM.Entities.Users
|
namespace TIAM.Entities.Users
|
||||||
{
|
{
|
||||||
[Table("Users")]
|
[Table("Users")]
|
||||||
public class User : AcUser<Profile, Company, UserToCompany, Address>, IUser
|
public class User : AcUser<Profile, Company, UserToCompany, Address>, IUser, IUserDtoDetail
|
||||||
{
|
{
|
||||||
public virtual List<Product> Products { get; } = new();
|
public virtual List<Product> Products { get; } = new();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,14 @@
|
||||||
using TIAM.Entities.Profiles;
|
using AyCode.Interfaces.Profiles.Dtos;
|
||||||
|
using TIAM.Entities.Addresses;
|
||||||
|
using TIAM.Entities.Profiles;
|
||||||
|
|
||||||
namespace TIAM.Models.Dtos.Profiles;
|
namespace TIAM.Models.Dtos.Profiles;
|
||||||
|
|
||||||
|
public class ProfileDto<TAddress> : ProfileDto, IProfileDto<TAddress> where TAddress : class, IAddressDto
|
||||||
|
{
|
||||||
|
public TAddress Address { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class ProfileDto : IProfileDto //TODO: AcProfileDtoBase - J.
|
public class ProfileDto : IProfileDto //TODO: AcProfileDtoBase - J.
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using TIAM.Entities.Users;
|
||||||
|
|
||||||
namespace TIAM.Models.Dtos.Users;
|
namespace TIAM.Models.Dtos.Users;
|
||||||
|
|
||||||
public class UserDto : IUserDto<Profile, Company, UserToCompany, Address>
|
public class UserDto : IUserDto<Profile, Company, UserToCompany>
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ using TIAM.Models.Dtos.Profiles;
|
||||||
|
|
||||||
namespace TIAM.Models.Dtos.Users;
|
namespace TIAM.Models.Dtos.Users;
|
||||||
|
|
||||||
public class UserModelDto : AcUserModelDtoBase<UserDto, Profile, ProfileDto, Company, UserToCompany, Address>, IProductsRelation, IUserModelDtoMinBase
|
public class UserModelDto : AcUserModelDtoBase<UserDto, Profile, Company, UserToCompany>, IProductsRelation, IUserModelDtoMinBase
|
||||||
{
|
{
|
||||||
public List<UserProductMapping> UserProductMappings { get; set; }
|
public List<UserProductMapping> UserProductMappings { get; set; }
|
||||||
public List<Product> Products { get; set; }
|
public List<Product> Products { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using TIAM.Models.Dtos.Profiles;
|
||||||
|
|
||||||
namespace TIAM.Models.Dtos.Users
|
namespace TIAM.Models.Dtos.Users
|
||||||
{
|
{
|
||||||
public class UserModelDtoDetail : AcUserModelDtoDetailBase<UserDtoDetail, Profile, ProfileDto, Company, UserToCompany, Address>, IProductsRelation, IUserModelDtoMinBase
|
public class UserModelDtoDetail : AcUserModelDtoDetailBase<UserDtoDetail, Profile, Company, UserToCompany, Address>, IProductsRelation, IUserModelDtoMinBase
|
||||||
{
|
{
|
||||||
public List<UserProductMapping> UserProductMappings { get; set; }
|
public List<UserProductMapping> UserProductMappings { get; set; }
|
||||||
public List<Product> Products { get; set; }
|
public List<Product> Products { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ else
|
||||||
@foreach (var dest in Users)
|
@foreach (var dest in Users)
|
||||||
{
|
{
|
||||||
<p>
|
<p>
|
||||||
@(dest.Profile.Name.IsNullOrWhiteSpace() ? dest.Id.ToString() : dest.Profile.Name)
|
@(dest.ProfileDto.Name.IsNullOrWhiteSpace() ? dest.Id.ToString() : dest.ProfileDto.Name)
|
||||||
</p>
|
</p>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
@using AyCode.Services.Loggers
|
@using AyCode.Services.Loggers
|
||||||
@using TIAM.Core.Loggers
|
@using TIAM.Core.Loggers
|
||||||
|
@using TIAM.Entities.Addresses
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
@inject IStringLocalizer<TIAMResources> Localizer
|
@inject IStringLocalizer<TIAMResources> Localizer
|
||||||
|
|
@ -244,7 +245,7 @@
|
||||||
PhoneNumber = ""
|
PhoneNumber = ""
|
||||||
};
|
};
|
||||||
|
|
||||||
userEditModel.Profile = new TIAM.Entities.Profiles.Profile
|
userEditModel.ProfileDto = new TIAM.Entities.Profiles.Profile
|
||||||
{
|
{
|
||||||
Name = "New user"
|
Name = "New user"
|
||||||
};
|
};
|
||||||
|
|
@ -311,7 +312,7 @@
|
||||||
async Task UpdateDataAsync()
|
async Task UpdateDataAsync()
|
||||||
{
|
{
|
||||||
//refresh grid
|
//refresh grid
|
||||||
UserData = (await UserDataService.GetUsersWithDetailsAsync()).OrderBy(x => x.Profile?.Name).ToList();
|
UserData = (await UserDataService.GetUsersWithDetailsAsync()).OrderBy(x => x.ProfileDto?.Name).ToList();
|
||||||
_logger.Info("orderData grid refreshed");
|
_logger.Info("orderData grid refreshed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,7 +320,7 @@
|
||||||
{
|
{
|
||||||
_logger = new LoggerClient<ManageUsers>(LogWriters.ToArray());
|
_logger = new LoggerClient<ManageUsers>(LogWriters.ToArray());
|
||||||
|
|
||||||
UserData = (await UserDataService.GetUsersWithDetailsAsync()).OrderBy(x => x.Profile?.Name).ToList();
|
UserData = (await UserDataService.GetUsersWithDetailsAsync()).OrderBy(x => x.ProfileDto?.Name).ToList();
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
|
|
||||||
public string Email => UserModelDto.UserDto.EmailAddress;
|
public string Email => UserModelDto.UserDto.EmailAddress;
|
||||||
public UserType UserType { get; set; }
|
public UserType UserType { get; set; }
|
||||||
public string? UserName => UserModelDto?.Profile?.Name;
|
public string? UserName => UserModelDto?.ProfileDto?.Name;
|
||||||
public string DisplayName => string.IsNullOrWhiteSpace(UserName) ? UserId.ToString() : UserName;
|
public string DisplayName => string.IsNullOrWhiteSpace(UserName) ? UserId.ToString() : UserName;
|
||||||
|
|
||||||
public Dictionary<Guid, string>? HasProperties { get; set; }
|
public Dictionary<Guid, string>? HasProperties { get; set; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue