merge
This commit is contained in:
commit
07f905f8b3
|
|
@ -5,6 +5,13 @@ namespace TIAM.Core.Consts;
|
|||
public static class TiamConstClient
|
||||
{
|
||||
public static Guid TransferProductId = Guid.Parse("814b5495-c2e9-4f1d-a73f-37cd5d353078");
|
||||
public static Guid[] DevAdminIds = new Guid[2]{Guid.Parse("dcf451d2-cc4c-4ac2-8c1f-da00041be1fd"), Guid.Parse("4cbaed43-2465-4d99-84f1-c8bc6b7025f7") };
|
||||
public static Guid[] SysAdmins = new Guid[3]
|
||||
{
|
||||
Guid.Parse("dcf451d2-cc4c-4ac2-8c1f-da00041be1fd"),
|
||||
Guid.Parse("4cbaed43-2465-4d99-84f1-c8bc6b7025f7"),
|
||||
Guid.Parse("540271f6-c604-4c16-8160-d5a7cafedf00")
|
||||
};
|
||||
}
|
||||
|
||||
public class TiamConst : AcConst
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.6" />
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace TIAM.Database.Test
|
|||
//_userDal = new UserDal(_mockContext.Object);
|
||||
}
|
||||
|
||||
//[TestMethod]
|
||||
[TestMethod]
|
||||
public async Task ConvertOldPassword()
|
||||
{
|
||||
//var loginService = new LoginService(Dal, AppSettingsConfiguration);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace TIAMMobileApp
|
|||
builder.Services.AddScoped<ISupplierService, SupplierService>();
|
||||
builder.Services.AddScoped<IUserDataService, UserDataServiceMobile>();
|
||||
builder.Services.AddScoped<ISecureStorageHandler, SecureStorageHandler>();
|
||||
builder.Services.AddScoped<ISessionService, SessionServiceMobile>();
|
||||
builder.Services.AddSingleton<ISessionService, SessionServiceMobile>();
|
||||
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceMobile>();
|
||||
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
|
||||
builder.Services.AddScoped<IClientNoticeSenderService, ClientNoticeSenderService>();
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ namespace TIAMMobileApp.Services
|
|||
public string? SessionId { get; set; }
|
||||
public UserSessionModel? User { get; set; }
|
||||
public IPAddress? IPAddress { get; set; }
|
||||
public bool IsAuthenticated { get; set; }
|
||||
public bool IsAuthenticated { get; set; } = false;
|
||||
public bool HasCompany { get; set; } = false;
|
||||
public bool IsDriver { get; set; } = false;
|
||||
public bool IsDevAdmin { get; set; } = false;
|
||||
public bool IsSysAdmin { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
@* @page "/"; *@
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@using TIAM.Core.Consts
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
|
|
@ -107,9 +108,9 @@
|
|||
string _userId = jsontoken.Claims.First(claim => claim.Type == JwtRegisteredClaimNames.NameId).Value;
|
||||
string _email = jsontoken.Claims.First(claim => claim.Type == JwtRegisteredClaimNames.Email).Value;
|
||||
var user = await UserDataService.IsLoggedInAsync(Guid.Parse(_userId));
|
||||
sessionService.User = user;
|
||||
SaveToSessionInfo(user);
|
||||
_logger.Info($"Saved user in db is: {user.DisplayName}, setting autenthicated state");
|
||||
sessionService.IsAuthenticated = true;
|
||||
|
||||
//NavManager.NavigateTo("/");
|
||||
}
|
||||
else
|
||||
|
|
@ -121,6 +122,29 @@
|
|||
|
||||
}
|
||||
|
||||
protected void SaveToSessionInfo(UserSessionModel user)
|
||||
{
|
||||
sessionService.User = user;
|
||||
sessionService.IsAuthenticated = true;
|
||||
sessionService.HasCompany = user.UserModelDto.UserProductMappings.Count > 0;
|
||||
if (user.UserModelDto.UserProductMappings.Any(x => x.ProductId == TiamConstClient.TransferProductId))
|
||||
{
|
||||
sessionService.IsDriver = true;
|
||||
}
|
||||
if (user.UserModelDto.Id == TiamConstClient.DevAdminIds[0] || user.UserModelDto.Id == TiamConstClient.DevAdminIds[1])
|
||||
{
|
||||
sessionService.IsDevAdmin = true;
|
||||
}
|
||||
foreach (var guid in TiamConstClient.SysAdmins)
|
||||
{
|
||||
if (user.UserModelDto.Id == guid)
|
||||
{
|
||||
sessionService.IsSysAdmin = true;
|
||||
}
|
||||
}
|
||||
_logger.Debug($"Saved to session: IsAuthenticated: {sessionService.IsAuthenticated}, HasCompany: {sessionService.HasCompany}, IsDriver: {sessionService.IsDriver}, IsDevAdmin: {sessionService.IsDevAdmin}, IsSysAdmin: {sessionService.IsSysAdmin}");
|
||||
}
|
||||
|
||||
public async Task<(string, string)> GetLocalSettings()
|
||||
{
|
||||
string userDetailsStr = await SecureStorageHandler.GetFromSecureStorageAsync(nameof(Setting.UserBasicDetails));
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ using TIAMSharedUI.Resources;
|
|||
using Microsoft.Extensions.Localization;
|
||||
using AyCode.Services.Loggers;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using TIAM.Core.Consts;
|
||||
|
||||
namespace TIAMSharedUI.Pages
|
||||
{
|
||||
|
|
@ -159,6 +160,23 @@ namespace TIAMSharedUI.Pages
|
|||
{
|
||||
sessionService.User = user;
|
||||
sessionService.IsAuthenticated = true;
|
||||
sessionService.HasCompany = user.UserModelDto.UserProductMappings.Count > 0;
|
||||
if(user.UserModelDto.UserProductMappings.Any(x=>x.ProductId==TiamConstClient.TransferProductId))
|
||||
{
|
||||
sessionService.IsDriver = true;
|
||||
}
|
||||
if (user.UserModelDto.Id == TiamConstClient.DevAdminIds[0] || user.UserModelDto.Id == TiamConstClient.DevAdminIds[1])
|
||||
{
|
||||
sessionService.IsDevAdmin = true;
|
||||
}
|
||||
foreach (var guid in TiamConstClient.SysAdmins)
|
||||
{
|
||||
if (user.UserModelDto.Id == guid)
|
||||
{
|
||||
sessionService.IsSysAdmin = true;
|
||||
}
|
||||
}
|
||||
BrowserConsoleLogWriter.Debug($"Saved to session: IsAuthenticated: {sessionService.IsAuthenticated}, HasCompany: {sessionService.HasCompany}, IsDriver: {sessionService.IsDriver}, IsDevAdmin: {sessionService.IsDevAdmin}, IsSysAdmin: {sessionService.IsSysAdmin}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
@using BlazorAnimation
|
||||
@using TIAMSharedUI.Shared.Components.Cards
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@inject IServiceProviderDataService ServiceProviderDataService
|
||||
|
||||
<div class=" col-12 col-xl-3">
|
||||
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
|
||||
<div class="card glass card-admin" style="border-radius: 16px;">
|
||||
<div class="card-header py-2 px-4">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span class="fw-bold text-body">Transfers</span>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<!--h6 class="mb-0"> <a href="#">All settings</a> </h6-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body card-admin-body py-2 px-4">
|
||||
|
||||
</div>
|
||||
<div class="card-footer py-2 px-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
<a href="#!">Modify</a>
|
||||
<div class="border-start h-100"></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Animation>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid ContextID { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
@page "/user/hoteladmin"
|
||||
@page "/user/hoteladmin/{id}"
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||
@layout AdminLayout
|
||||
@inject IPopulationStructureDataProvider DataProvider
|
||||
@inject ISupplierService SupplierService
|
||||
@inject IUserDataService UserDataService
|
||||
@inject ISessionService SessionService
|
||||
<PageTitle>HotelAdmin</PageTitle>
|
||||
|
||||
<div class="text-center m-5">
|
||||
|
|
@ -16,179 +15,31 @@
|
|||
|
||||
<div class="container">
|
||||
|
||||
<HotelComponent Id="@Id"></HotelComponent>
|
||||
<HotelComponent Id="@id"></HotelComponent>
|
||||
|
||||
<!-- Stats admin-->
|
||||
<hr />
|
||||
|
||||
|
||||
@* <div class="row py-3">
|
||||
<div class=" col-12 col-xl-3">
|
||||
<div class="card glass card-admin" style="border-radius: 16px;">
|
||||
<div class="card-header py-2 px-4">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span class="fw-bold text-body">Panel title</span>
|
||||
<p class="text-muted mb-0">Subtitle</p>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="mb-0"> <a href="#">All details</a> </h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body card-admin-body py-2 px-4">
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
<div class="flex-fill">
|
||||
<h5 class="bold">Some info</h5>
|
||||
<p class="text-muted"> Budapest, Dózsa György út 35, 1146</p>
|
||||
</div>
|
||||
<div>
|
||||
<!--img class="align-self-center img-fluid"
|
||||
src="https://mdbcdn.b-cdn.net/img/Photos/Horizontal/E-commerce/Products/6.webp" width="250"-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul id="progressbar-1" class="mx-0 mt-0 mb-5 px-0 pt-0 pb-4">
|
||||
<li class="step0 active" id="step1">
|
||||
<span style="margin-left: 22px; margin-top: 12px;">PLACED</span>
|
||||
</li>
|
||||
<li class="step0 active text-center" id="step2"><span>WAITING FOR PICK UP</span></li>
|
||||
<li class="step0 text-muted text-end" id="step3">
|
||||
<span style="margin-right: 22px;">FINISHED</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
<h4> Some <span class="small text-muted"> conclusion </span></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer py-2 px-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
<a href="#!">Modify</a>
|
||||
<div class="border-start h-100"></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-12 col-xl-3">
|
||||
<div class="card glass card-admin" style="border-radius: 16px;">
|
||||
<div class="card-header py-2 px-4">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span class="fw-bold text-body">Panel title</span>
|
||||
<p class="text-muted mb-0">Subtitle</p>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="mb-0"> <a href="#">All details</a> </h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body card-admin-body py-2 px-4">
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
<div class="flex-fill">
|
||||
<h5 class="bold">Some info</h5>
|
||||
<p class="text-muted"> Budapest, Dózsa György út 35, 1146</p>
|
||||
</div>
|
||||
<div>
|
||||
<!--img class="align-self-center img-fluid"
|
||||
src="https://mdbcdn.b-cdn.net/img/Photos/Horizontal/E-commerce/Products/6.webp" width="250"-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul id="progressbar-1" class="mx-0 mt-0 mb-5 px-0 pt-0 pb-4">
|
||||
<li class="step0 active" id="step1">
|
||||
<span style="margin-left: 22px; margin-top: 12px;">PLACED</span>
|
||||
</li>
|
||||
<li class="step0 active text-center" id="step2"><span>WAITING FOR PICK UP</span></li>
|
||||
<li class="step0 text-muted text-end" id="step3">
|
||||
<span style="margin-right: 22px;">FINISHED</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
<h4> Some <span class="small text-muted"> conclusion </span></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer py-2 px-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
<a href="#!">Modify</a>
|
||||
<div class="border-start h-100"></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-12 col-xl-3">
|
||||
<div class="card glass card-admin" style="border-radius: 16px;">
|
||||
<div class="card-header py-2 px-4">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span class="fw-bold text-body">Panel title</span>
|
||||
<p class="text-muted mb-0">Subtitle</p>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="mb-0"> <a href="#">All details</a> </h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body card-admin-body py-2 px-4">
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
<div class="flex-fill">
|
||||
<h5 class="bold">Some info</h5>
|
||||
<p class="text-muted"> Budapest, Dózsa György út 35, 1146</p>
|
||||
</div>
|
||||
<div>
|
||||
<!--img class="align-self-center img-fluid"
|
||||
src="https://mdbcdn.b-cdn.net/img/Photos/Horizontal/E-commerce/Products/6.webp" width="250"-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul id="progressbar-1" class="mx-0 mt-0 mb-5 px-0 pt-0 pb-4">
|
||||
<li class="step0 active" id="step1">
|
||||
<span style="margin-left: 22px; margin-top: 12px;">PLACED</span>
|
||||
</li>
|
||||
<li class="step0 active text-center" id="step2"><span>WAITING FOR PICK UP</span></li>
|
||||
<li class="step0 text-muted text-end" id="step3">
|
||||
<span style="margin-right: 22px;">FINISHED</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
<h4> Some <span class="small text-muted"> conclusion </span></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer py-2 px-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
<a href="#!">Modify</a>
|
||||
<div class="border-start h-100"></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-12 col-xl-3">
|
||||
|
||||
</div>
|
||||
|
||||
</div> *@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
string Id = "2312-32132121-32123";
|
||||
[Parameter] public Guid id { get; set; }
|
||||
bool isUserLoggedIn;
|
||||
int userType = 0;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
//check if Id matches with userproductmapping
|
||||
if (!SessionService.IsAuthenticated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var check = SessionService.User.UserModelDto.UserProductMappings.Any(x => x.ProductId == id);
|
||||
if (!check)
|
||||
{
|
||||
return;
|
||||
}
|
||||
base.OnInitialized();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
namespace TIAMSharedUI.Pages.User
|
||||
{
|
||||
public partial class Home
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ namespace TIAMSharedUI.Pages.User.Hotels
|
|||
{
|
||||
|
||||
[Parameter]
|
||||
public string? Id { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Inject]
|
||||
ISupplierService SupplierService { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
@page "/user/properties"
|
||||
@using BlazorAnimation
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
@using TIAM.Resources
|
||||
@using TIAM.Services
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
|
|
@ -15,62 +17,37 @@
|
|||
@inject ISessionService SessionService
|
||||
@inject IServiceProviderDataService ServiceProviderDataService
|
||||
@inject AdminSignalRClient AdminSignalRClient;
|
||||
<PageTitle>User permissions</PageTitle>
|
||||
|
||||
<h3>Properties</h3>
|
||||
<div class="text-center m-5">
|
||||
<h1>Drivers</h1>
|
||||
<h2 style="font-size:small">Manage drivers here!</h2>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class=" col-12 col-xl-6">
|
||||
<div class="card glass card-admin" style="border-radius: 16px;">
|
||||
<div class="card-header py-2 px-4">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span class="fw-bold text-body">Service providers list</span>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class=" col-12">
|
||||
<Animation Effect="@Effect.FadeInUp" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
|
||||
<div class="card">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
<div class="align-self-end pl-2 pb-2">
|
||||
<DxButton Text="Column Chooser"
|
||||
RenderStyle="ButtonRenderStyle.Secondary"
|
||||
IconCssClass="btn-column-chooser"
|
||||
Click="ColumnChooserButton_Click" />
|
||||
</div>
|
||||
<div>
|
||||
<!--div class="target-container" @onclick="@(() => EulaVisible = true)">
|
||||
<button class="btn btn-primary">Create</button>
|
||||
</div-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body card-admin-body py-2 px-4">
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
|
||||
|
||||
|
||||
@*<DxPopup CssClass="popup-demo-events"
|
||||
@bind-Visible="@EulaVisible"
|
||||
ShowFooter="true"
|
||||
CloseOnEscape="false"
|
||||
CloseOnOutsideClick="false"
|
||||
ShowCloseButton="true"
|
||||
HeaderText="@localizer.GetString(ResourceKeys.ServiceProviderTitle)"
|
||||
Closing="EulaPopupClosing"
|
||||
Closed="EulaPopupClosed">
|
||||
<BodyContentTemplate>
|
||||
<InputWizard Data=@myModel OnSubmit="SubmitForm" SubmitButtonText=@ResourceKeys.ButtonSave TitleResourceString=@ResourceKeys.ServiceProviderTitle></InputWizard>
|
||||
</BodyContentTemplate>
|
||||
<FooterContentTemplate Context="Context">
|
||||
<div class="popup-demo-events-footer">
|
||||
<!--DxCheckBox CssClass="popup-demo-events-checkbox" @bind-Checked="@EulaAccepted">I accept the terms of the EULA</!--DxCheckBox-->
|
||||
<!--DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="Context.CloseCallback" /-->
|
||||
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text=@localizer.GetString(ResourceKeys.ButtonCancel) Click="CancelCreateClick" />
|
||||
</div>
|
||||
</FooterContentTemplate>
|
||||
</DxPopup>*@
|
||||
|
||||
<CompanyGrid @ref="_gridCompany"
|
||||
Logger="_logger"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
|
||||
PageSize="12"
|
||||
ContextIds="contextIds"
|
||||
GetAllMessageTag="SignalRTags.GetCompaniesByContextId"
|
||||
PageSize="12"
|
||||
ValidationEnabled="false"
|
||||
DetailRowDisplayMode="GridDetailRowDisplayMode.Always"
|
||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditRow">
|
||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditRow">
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="160px" />
|
||||
<DxGridDataColumn FieldName="Id" MinWidth="80">
|
||||
|
|
@ -78,30 +55,22 @@
|
|||
<a class="d-block text-left" href="user/serviceprovider/@context.Value.ToString()">@context.Value</a>
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="Name" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="OwnerId" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" />
|
||||
<DxGridDataColumn Caption="Address" FieldName="Profile.Address.AddressText" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="Name" MinWidth="80" />
|
||||
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
<text>@(((Company)context.DataItem).Profile.Address.AddressText)</text>
|
||||
<p>@(((Company)context.DataItem).Profile.Address.AddressText)</p>
|
||||
}
|
||||
</DetailRowTemplate>
|
||||
</CompanyGrid>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-row mb-4 pb-2">
|
||||
<h4> Some <span class="small text-muted"> conclusion </span></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</Animation>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=" col-12 col-xl-6">
|
||||
</div>
|
||||
|
||||
|
|
@ -119,11 +88,10 @@
|
|||
bool EulaAccepted { get; set; }
|
||||
bool EulaVisible { get; set; }
|
||||
|
||||
private Guid[] contextIds = new Guid[0];
|
||||
|
||||
void CancelCreateClick()
|
||||
{
|
||||
|
||||
|
||||
EulaVisible = false;
|
||||
}
|
||||
void EulaPopupClosed()
|
||||
|
|
@ -161,12 +129,18 @@
|
|||
_logger = new LoggerClient<MyServiceProviders>(LogWriters.ToArray());
|
||||
|
||||
var myId = SessionService.User.UserId;
|
||||
|
||||
ServiceProviderDataService.GetPropertiesByOwnerIdAsync(myId, companyPropertiesByOwner =>
|
||||
{
|
||||
_logger.DetailConditional($"companyPropertiesByOwner count: {companyPropertiesByOwner?.Count.ToString() ?? "NULL"}");
|
||||
}).Forget();
|
||||
contextIds = new Guid[1];
|
||||
contextIds[0] = myId;
|
||||
// ServiceProviderDataService.GetPropertiesByOwnerIdAsync(myId, companyPropertiesByOwner =>
|
||||
// {
|
||||
// _logger.DetailConditional($"companyPropertiesByOwner count: {companyPropertiesByOwner?.Count.ToString() ?? "NULL"}");
|
||||
// }).Forget();
|
||||
|
||||
return base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
void ColumnChooserButton_Click()
|
||||
{
|
||||
_gridCompany.ShowColumnChooser();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<PageTitle>Admin - Companies</PageTitle>
|
||||
|
||||
<div class="text-center m-5">
|
||||
<h1>Company: @Id</h1>
|
||||
<h1>Company</h1>
|
||||
<h2 style="font-size:small">Manage your service provider details</h2>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@
|
|||
@{
|
||||
var a = ((LogItemViewerModel)context.DataItem);
|
||||
}
|
||||
<div>@($"{a.CategoryName}->{a.CallerName}")</div>
|
||||
<p>@($"{a.Text}")</p>
|
||||
<div><p>@($"{a.CategoryName}->{a.CallerName}")</p></div>
|
||||
<div><p>@($"{a.Text}")</p></div><br />
|
||||
<div style="font-weight: bold;">Exception:</div>
|
||||
<p style="word-wrap: break-word;">@a.Exception</p>
|
||||
<div><p style="text-wrap: wrap;">@a.Exception</p></div>
|
||||
</DetailRowTemplate>
|
||||
<ToolbarTemplate>
|
||||
<DxGridLayout>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Services;
|
||||
|
||||
namespace TIAMSharedUI.Shared.Components.Cards;
|
||||
|
||||
public class AddressCard : CardBase<Address>
|
||||
{
|
||||
public AddressCard() : base()
|
||||
{
|
||||
GetAllMessageTag = SignalRTags.GetAddressesByContextId;
|
||||
//AddMessageTag = SignalRTags.AddAddress;
|
||||
UpdateMessageTag = SignalRTags.UpdateAddress;
|
||||
//RemoveMessageTag = SignalRTags.RemoveAddress; - nem törlünk címet - J.
|
||||
}
|
||||
|
||||
protected override Task OnParametersSetAsync()
|
||||
{
|
||||
if (!IsFirstInitializeParameters)
|
||||
{
|
||||
//ShowFilterRow = true;
|
||||
//ShowGroupPanel = true;
|
||||
//AllowSort = false;
|
||||
|
||||
//etc...
|
||||
}
|
||||
|
||||
return base.OnParametersSetAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
using AyCode.Blazor.Components.Services;
|
||||
using AyCode.Core.Enums;
|
||||
using AyCode.Core.Helpers;
|
||||
using AyCode.Core.Interfaces;
|
||||
using AyCode.Core;
|
||||
using AyCode.Services.SignalRs;
|
||||
using DevExpress.Blazor;
|
||||
using DevExpress.ClipboardSource.SpreadsheetML;
|
||||
using DevExpress.Data.Design;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TIAMSharedUI.Shared.Components.Grids;
|
||||
using TIAMWebApp.Shared.Application.Utility;
|
||||
using AyCode.Core.Extensions;
|
||||
using AyCode.Utils.Extensions;
|
||||
|
||||
namespace TIAMSharedUI.Shared.Components.Cards
|
||||
{
|
||||
public class CardBase<TDataItem> : ComponentBase where TDataItem : class, IId<Guid>
|
||||
{
|
||||
public CardBase() { }
|
||||
|
||||
protected bool IsFirstInitializeParameters;
|
||||
private SignalRDataSource<TDataItem> _dataSource = null!;
|
||||
private IList<TDataItem> _dataSourceParam = [];
|
||||
private string _cardLogName;
|
||||
|
||||
|
||||
[Parameter] public LoggerClient Logger { get; set; }
|
||||
[Parameter] public string CardName { get; set; }
|
||||
[Parameter] public Guid[]? ContextIds { get; set; }
|
||||
|
||||
private string? _filterText = null;
|
||||
|
||||
[Parameter]
|
||||
public string? FilterText
|
||||
{
|
||||
get => _filterText;
|
||||
set
|
||||
{
|
||||
_filterText = value;
|
||||
|
||||
if (_dataSource != null! && _dataSource.FilterText != value)
|
||||
{
|
||||
_dataSource.FilterText = value;
|
||||
LoadDataSourceAsync().Forget();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter] public AcSignalRClientBase SignalRClient { get; set; }
|
||||
|
||||
[Parameter] public int GetAllMessageTag { get; set; }
|
||||
[Parameter] public int GetItemMessageTag { get; set; }
|
||||
[Parameter] public int AddMessageTag { get; set; }
|
||||
[Parameter] public int UpdateMessageTag { get; set; }
|
||||
[Parameter] public int RemoveMessageTag { get; set; }
|
||||
|
||||
[Parameter] public EventCallback<IList<TDataItem>> OnDataSourceChanged { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// After the server has responded!
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<TDataItem> OnCardItemChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
[DefaultValue(null)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "BL0007:Component parameters should be auto properties", Justification = "<Pending>")]
|
||||
public IList<TDataItem> DataSource
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_dataSource == null)
|
||||
{
|
||||
Logger.Error($"{_cardLogName} Use the DataSource parameter instead of Data!");
|
||||
throw new NullReferenceException($"{_cardLogName} Use the DataSource parameter instead of Data!");
|
||||
}
|
||||
|
||||
return _dataSource!;
|
||||
}
|
||||
set => _dataSourceParam = value;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Logger == null)
|
||||
throw new NullReferenceException($"[{GetType().Name}] Logger == null");
|
||||
|
||||
if (SignalRClient == null)
|
||||
{
|
||||
Logger.Error($"[{GetType().Name}] SignalRClient == null");
|
||||
throw new NullReferenceException($"[{GetType().Name}] SignalRClient == null");
|
||||
}
|
||||
|
||||
var crudTags = new SignalRCrudTags(GetAllMessageTag, GetItemMessageTag, AddMessageTag, UpdateMessageTag, RemoveMessageTag);
|
||||
_dataSource = new SignalRDataSource<TDataItem>(SignalRClient, crudTags, ContextIds);
|
||||
_dataSource.FilterText = FilterText;
|
||||
|
||||
//Data = _dataSource;
|
||||
|
||||
_dataSource.OnDataSourceLoaded += OnDataSourceLoaded;
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
|
||||
private Task OnDataSourceLoaded()
|
||||
{
|
||||
Logger.Debug($"{_cardLogName} OnDataSourceLoaded; Count: {_dataSource.Count}");
|
||||
|
||||
//_dataSource.LoadItem(_dataSource.First().Id).Forget();
|
||||
return OnDataSourceChanged.InvokeAsync(_dataSource);
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
|
||||
if (firstRender)
|
||||
{
|
||||
if (_dataSourceParam.Count > 0) await _dataSource.LoadDataSource(_dataSourceParam);
|
||||
else _dataSource.LoadDataSourceAsync(true).Forget();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override Task OnParametersSetAsync()
|
||||
|
||||
{
|
||||
if (!IsFirstInitializeParameters)
|
||||
{
|
||||
//if (typeof(TDataItem) is IId<Guid> || typeof(TDataItem) is IId<int>)
|
||||
|
||||
|
||||
IsFirstInitializeParameters = true;
|
||||
}
|
||||
|
||||
return Task.FromResult(base.OnParametersSetAsync);
|
||||
}
|
||||
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
base.OnParametersSet();
|
||||
|
||||
if (CardName.IsNullOrWhiteSpace()) CardName = $"{typeof(TDataItem).Name}Card";
|
||||
|
||||
_cardLogName = $"[{CardName}]";
|
||||
|
||||
}
|
||||
|
||||
public Task AddOrUpdateDataItem(TDataItem dataItem) => _dataSource.AddOrUpdate(dataItem, true);
|
||||
|
||||
public Task RemoveDataItem(TDataItem dataItem) => _dataSource.Remove(dataItem, true);
|
||||
//public Task RemoveDataItem(TDataItem dataItem, int messageTag) => PostDataToServerAsync(dataItem, messageTag, TrackingState.Remove);
|
||||
|
||||
public Task RemoveDataItem(Guid id) => RemoveDataItem(id, RemoveMessageTag);
|
||||
|
||||
public Task RemoveDataItem(Guid id, int messageTag)
|
||||
{
|
||||
var dataItem = _dataSource.FirstOrDefault(x => x.Id == id);
|
||||
if (dataItem == null) return Task.CompletedTask;
|
||||
|
||||
return _dataSource.Remove(dataItem, true);
|
||||
}
|
||||
|
||||
public Task LoadDataSourceAsync()
|
||||
{
|
||||
return _dataSource.LoadDataSourceAsync(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Services;
|
||||
using TIAMSharedUI.Shared.Components.Cards;
|
||||
|
||||
namespace TIAMSharedUI.Shared.Components.Cards;
|
||||
|
||||
public class TransferCard : CardBase<Transfer>
|
||||
{
|
||||
public TransferCard() : base()
|
||||
{
|
||||
GetAllMessageTag = SignalRTags.GetTransfersByCompanyId;
|
||||
|
||||
}
|
||||
|
||||
protected override Task OnParametersSetAsync()
|
||||
{
|
||||
if (!IsFirstInitializeParameters)
|
||||
{
|
||||
//ShowFilterRow = true;
|
||||
//ShowGroupPanel = true;
|
||||
//AllowSort = false;
|
||||
|
||||
//etc...
|
||||
}
|
||||
|
||||
return base.OnParametersSetAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,16 @@
|
|||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using AyCode.Services.Loggers
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@using Newtonsoft.Json
|
||||
@using TIAM.Core.Loggers
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using AyCode.Interfaces.StorageHandlers;
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@inject ISecureStorageHandler SecureStorageHandler
|
||||
@inject ISessionService SessionService
|
||||
@inject IUserDataService UserDataService
|
||||
@inject AuthenticationStateProvider AuthStateProvider
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
||||
|
||||
<div class="w-100" style="height:40px; position:fixed;">
|
||||
|
|
@ -12,23 +22,29 @@
|
|||
<DxMenuItem NavigateUrl="user/properties" Text="My companies" IconCssClass="menu-icon-home menu-icon" />
|
||||
<DxMenuItem NavigateUrl="user/media" Text="Media" IconCssClass="menu-icon-home menu-icon" />
|
||||
<DxMenuItem NavigateUrl="user/messages" Text="Media" IconCssClass="menu-icon-home menu-icon" />
|
||||
|
||||
<DxMenuItem Text="SysAdmin" IconCssClass="menu-icon-products menu-icon">
|
||||
<Items>
|
||||
<DxMenuItem NavigateUrl="user/sysadmin" Text="Dashboard" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/transfers" Text="Transfers" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/destinations" Text="Destinations" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/companies" Text="Companies" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/prices" Text="Partner prices" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/products" Text="Services" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/drivers" Text="Drivers" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/cars" Text="Cars" />
|
||||
|
||||
<DxMenuItem Text="SysAdmin" Visible="@IsSysAdmin" IconCssClass="menu-icon-products menu-icon">
|
||||
<Items>
|
||||
<DxMenuItem NavigateUrl="user/sysadmin" Text="Dashboard" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/transfers" Text="Transfers" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/destinations" Text="Destinations" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/companies" Text="Companies" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/prices" Text="Partner prices" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/products" Text="Services" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/drivers" Text="Drivers" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/cars" Text="Cars" />
|
||||
|
||||
<DxMenuItem NavigateUrl="sysadmin/userproductmappings" Text="Permissions" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/users" Text="Users" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/logs" Text="Logs" />
|
||||
</Items>
|
||||
</DxMenuItem>
|
||||
<DxMenuItem NavigateUrl="sysadmin/userproductmappings" Text="Permissions" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/users" Text="Users" />
|
||||
</Items>
|
||||
</DxMenuItem>
|
||||
|
||||
<DxMenuItem Text="DevAdmin" Visible="@IsDevAdmin" IconCssClass="menu-icon-products menu-icon">
|
||||
<Items>
|
||||
<DxMenuItem NavigateUrl="sysadmin/logs" Text="Logs" />
|
||||
</Items>
|
||||
</DxMenuItem>
|
||||
|
||||
<DxMenuItem Text="HotelAdmin" IconCssClass="menu-icon-support menu-icon">
|
||||
<Items>
|
||||
<DxMenuItem NavigateUrl="user/hoteladmin" Text="Dashboard" />
|
||||
|
|
@ -184,9 +200,29 @@
|
|||
private bool expandHotelAdminNav = false;
|
||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
|
||||
private bool IsDevAdmin;
|
||||
private bool IsSysAdmin;
|
||||
private bool IsDriver;
|
||||
|
||||
private ILogger _logger;
|
||||
|
||||
MenuDisplayMode DisplayMode { get; set; } = MenuDisplayMode.Auto;
|
||||
Orientation Orientation { get; set; } = Orientation.Horizontal;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_logger = new LoggerClient<AdminNavMenu>(LogWriters.ToArray());
|
||||
_logger.Debug($"UserId: {SessionService.User.UserModelDto.Id}");
|
||||
IsDevAdmin = SessionService.IsDevAdmin;
|
||||
_logger.Debug($"UserId: {SessionService.IsDevAdmin}");
|
||||
IsSysAdmin = SessionService.IsSysAdmin;
|
||||
_logger.Debug($"UserId: {SessionService.IsSysAdmin}");
|
||||
IsDriver = SessionService.IsDriver;
|
||||
_logger.Debug($"UserId: {SessionService.IsDriver}");
|
||||
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
||||
private void ToggleNavMenu()
|
||||
{
|
||||
collapseNavMenu = !collapseNavMenu;
|
||||
|
|
@ -197,9 +233,22 @@
|
|||
|
||||
}
|
||||
|
||||
private void SignOut()
|
||||
private async Task SignOut()
|
||||
{
|
||||
SecureStorageHandler.ClearAllSecureStorageAsync();
|
||||
bool serverResult;
|
||||
string userDetailsStr = await SecureStorageHandler.GetFromSecureStorageAsync(nameof(Setting.UserBasicDetails));
|
||||
if (!string.IsNullOrEmpty(userDetailsStr))
|
||||
{
|
||||
var userBasicDetail = JsonConvert.DeserializeObject<UserBasicDetails>(userDetailsStr);
|
||||
serverResult = await UserDataService.Logout(userBasicDetail.RefreshToken);
|
||||
}
|
||||
await SecureStorageHandler.ClearAllSecureStorageAsync();
|
||||
var result = await AuthStateProvider.GetAuthenticationStateAsync();
|
||||
|
||||
SessionService.User = null;
|
||||
SessionService.IsAuthenticated = false;
|
||||
NavigationManager.NavigateTo("/");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Folder Include="Pages\User\Guides\" />
|
||||
<Folder Include="Pages\User\Drivers\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ builder.Services.AddScoped<ISupplierService, SupplierService>();
|
|||
builder.Services.AddScoped<IUserDataService, UserDataServiceWeb>();
|
||||
builder.Services.AddScoped<ISecureStorageHandler, SecureStorageHandler>();
|
||||
builder.Services.AddBlazoredLocalStorage();
|
||||
builder.Services.AddScoped<ISessionService, SessionServiceWeb>();
|
||||
builder.Services.AddSingleton<ISessionService, SessionServiceWeb>();
|
||||
|
||||
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceWeb>();
|
||||
|
||||
|
|
|
|||
|
|
@ -10,5 +10,9 @@ namespace TIAMWebApp.Client.Services
|
|||
public UserSessionModel? User { get; set; }
|
||||
public IPAddress? IPAddress { get; set; }
|
||||
public bool IsAuthenticated { get; set; } = false;
|
||||
public bool HasCompany { get; set; } = false;
|
||||
public bool IsDriver { get; set; } = false;
|
||||
public bool IsDevAdmin { get; set; } = false;
|
||||
public bool IsSysAdmin { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,12 @@ namespace TIAMWebApp.Shared.Application.Interfaces
|
|||
public UserSessionModel? User { get; set; }
|
||||
public IPAddress? IPAddress { get; set; }
|
||||
public bool IsAuthenticated { get; set; }
|
||||
|
||||
public bool HasCompany { get; set; }
|
||||
public bool IsDriver { get; set; }
|
||||
|
||||
public bool IsDevAdmin { get; set; }
|
||||
|
||||
public bool IsSysAdmin { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Services.Server.Tests"
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Models.Server", "TIAM.Models.Server\TIAM.Models.Server.csproj", "{D21032B0-B25F-495E-B784-1D3166FE720C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiam.Services.Client.Tests", "Tiam.Services.Client.Tests\Tiam.Services.Client.Tests.csproj", "{EF40BC68-945A-47ED-8739-2D0BCD415019}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tiam.Services.Client.Tests", "Tiam.Services.Client.Tests\Tiam.Services.Client.Tests.csproj", "{EF40BC68-945A-47ED-8739-2D0BCD415019}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
|
|||
Loading…
Reference in New Issue