WIP
renew password navigation helper basepagecomponent further improvements in user admin
This commit is contained in:
parent
332c0a2d56
commit
23203d6fbf
|
|
@ -72,6 +72,7 @@ namespace TIAMMobileApp
|
|||
builder.Services.AddScoped<ExchangeRateService>();
|
||||
builder.Services.AddScoped<SmartyStreetsService>();
|
||||
builder.Services.AddScoped<GooglePlacesService>();
|
||||
builder.Services.AddSingleton<PageHistoryState>();
|
||||
builder.Services.AddAuthorizationCore();
|
||||
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });
|
||||
return builder.Build();
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using AyCode.Core.Helpers
|
||||
@using AyCode.Core.Consts
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@inject NavigationManager NavManager
|
||||
@inject IUserDataService UserDataService;
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
@page "/"
|
||||
@using AyCode.Interfaces.StorageHandlers;
|
||||
@using BlazorAnimation
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
@using AyCode.Services.Loggers
|
||||
|
|
@ -8,6 +9,7 @@
|
|||
@using TIAMSharedUI.Shared
|
||||
@using TIAM.Resources;
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@inherits BasePageComponent
|
||||
@inject NavigationManager NavManager
|
||||
@inject IUserDataService UserDataService;
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
@page "/login"
|
||||
@inherits BasePageComponent
|
||||
@using BlazorAnimation
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels;
|
||||
@using TIAMSharedUI.Pages.Components;
|
||||
@using TIAMSharedUI.Pages.Components
|
||||
|
||||
|
||||
<PageTitle>Login</PageTitle>
|
||||
|
|
@ -23,7 +25,7 @@
|
|||
<img src="_content/TIAMSharedUI/images/png-logo-0.png" alt="">
|
||||
</div>
|
||||
<div class="text-center mt-4 name">
|
||||
@localizer["LoginTitleText"]
|
||||
@_localizer["LoginTitleText"]
|
||||
</div>
|
||||
<form class="p-3 mt-3">
|
||||
<div>
|
||||
|
|
@ -49,7 +51,7 @@
|
|||
{
|
||||
<div>
|
||||
|
||||
<p>@localizer["LoginEmail"]: @_loginModel.Email</p>
|
||||
<p>@_localizer["LoginEmail"]: @_loginModel.Email</p>
|
||||
|
||||
<p>@_loginModel.Password</p>
|
||||
</div>
|
||||
|
|
@ -58,6 +60,9 @@
|
|||
<div class="text-center fs-6">
|
||||
No account yet? <a href="register">Sign up here!</a>
|
||||
</div>
|
||||
<div class="text-center fs-6">
|
||||
Forgot your password? <a href="renewpassword">Click here!</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Animation>
|
||||
|
|
|
|||
|
|
@ -13,10 +13,11 @@ using Microsoft.AspNetCore.Components.Authorization;
|
|||
using TIAM.Core.Consts;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAMWebApp.Shared.Application.Services;
|
||||
using TIAMSharedUI.Shared.Components.BaseComponents;
|
||||
|
||||
namespace TIAMSharedUI.Pages
|
||||
{
|
||||
public partial class Login : ComponentBase
|
||||
public partial class Login : BasePageComponent
|
||||
{
|
||||
|
||||
[Inject]
|
||||
|
|
@ -28,11 +29,7 @@ namespace TIAMSharedUI.Pages
|
|||
[Inject]
|
||||
public IJSRuntime jsRuntime { get; set; }
|
||||
[Inject]
|
||||
public ISecureStorageHandler secureStorageHandler { get; set; }
|
||||
[Inject]
|
||||
public IStringLocalizer<MyResources> localizer { get; set; }
|
||||
[Inject]
|
||||
public ISessionService sessionService { get; set; }
|
||||
public ISecureStorageHandler secureStorageHandler { get; set; }
|
||||
|
||||
[Inject]
|
||||
public AuthenticationStateProvider AuthStateProvider { get; set; }
|
||||
|
|
@ -141,7 +138,7 @@ namespace TIAMSharedUI.Pages
|
|||
{
|
||||
|
||||
base.OnInitialized();
|
||||
if(sessionService.IsAuthenticated)
|
||||
if(_sessionService.IsAuthenticated)
|
||||
{
|
||||
navManager.NavigateTo("index");
|
||||
}
|
||||
|
|
@ -160,22 +157,22 @@ namespace TIAMSharedUI.Pages
|
|||
/// <param name="user"></param>
|
||||
protected async Task SaveToSessionInfo(UserSessionModel user)
|
||||
{
|
||||
sessionService.User = user;
|
||||
sessionService.IsAuthenticated = true;
|
||||
sessionService.HasCompany = user.UserModelDto.UserProductMappings.Count > 0;
|
||||
sessionService.IsDriver = await CheckIfDriver(user.UserModelDto.UserProductMappings);
|
||||
_sessionService.User = user;
|
||||
_sessionService.IsAuthenticated = true;
|
||||
_sessionService.HasCompany = user.UserModelDto.UserProductMappings.Count > 0;
|
||||
_sessionService.IsDriver = await CheckIfDriver(user.UserModelDto.UserProductMappings);
|
||||
if (user.UserModelDto.Id == TiamConstClient.DevAdminIds[0] || user.UserModelDto.Id == TiamConstClient.DevAdminIds[1])
|
||||
{
|
||||
sessionService.IsDevAdmin = true;
|
||||
_sessionService.IsDevAdmin = true;
|
||||
}
|
||||
foreach (var guid in TiamConstClient.SysAdmins)
|
||||
{
|
||||
if (user.UserModelDto.Id == guid)
|
||||
{
|
||||
sessionService.IsSysAdmin = true;
|
||||
_sessionService.IsSysAdmin = true;
|
||||
}
|
||||
}
|
||||
BrowserConsoleLogWriter.Debug($"Saved to session: IsAuthenticated: {sessionService.IsAuthenticated}, HasCompany: {sessionService.HasCompany}, IsDriver: {sessionService.IsDriver}, IsDevAdmin: {sessionService.IsDevAdmin}, IsSysAdmin: {sessionService.IsSysAdmin}");
|
||||
BrowserConsoleLogWriter.Debug($"Saved to session: IsAuthenticated: {_sessionService.IsAuthenticated}, HasCompany: {_sessionService.HasCompany}, IsDriver: {_sessionService.IsDriver}, IsDevAdmin: {_sessionService.IsDevAdmin}, IsSysAdmin: {_sessionService.IsSysAdmin}");
|
||||
}
|
||||
|
||||
public async Task<bool> CheckIfDriver(List<UserProductMapping> Permissions)
|
||||
|
|
@ -190,7 +187,7 @@ namespace TIAMSharedUI.Pages
|
|||
if (driverPermissionResult)
|
||||
{
|
||||
_isDriver = true;
|
||||
sessionService.DriverPersmissionId = Permission.Id;
|
||||
_sessionService.DriverPersmissionId = Permission.Id;
|
||||
}
|
||||
}
|
||||
return _isDriver;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels;
|
||||
@using TIAMSharedUI.Pages.Components;
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@inject NavigationManager navManager
|
||||
@inject IUserDataService UserDataservice
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
@page "/renewpassword"
|
||||
@inherits BasePageComponent
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@using BlazorAnimation
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels;
|
||||
@using TIAMSharedUI.Pages.Components;
|
||||
@using TIAMSharedUI.Pages.User.CardComponents
|
||||
|
||||
<PageTitle>Login</PageTitle>
|
||||
|
||||
<div class="text-center m-5">
|
||||
<h1>Login</h1>
|
||||
<h2 style="font-size:small">Good to see you again!</h2>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container mt-3">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col-12 col-sm-6 px-5">
|
||||
<Animation Effect="@Effect.FadeIn" Speed="@Speed.Slow" Delay="@TimeSpan.FromMilliseconds(250)">
|
||||
<div class="card glass inputwizardwrapper my-5">
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="my-logo">
|
||||
<img src="_content/TIAMSharedUI/images/png-logo-0.png" alt="">
|
||||
</div>
|
||||
<div class="text-center mt-4 name">
|
||||
@_localizer["LoginTitleText"]
|
||||
</div>
|
||||
<UserCardComponent IsForgotten="true" />
|
||||
<div class="text-center fs-6">
|
||||
No account yet? <a href="register">Sign up here!</a>
|
||||
</div>
|
||||
<div class="text-center fs-6">
|
||||
Figured it out? <a href="login">Back to login!</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Animation>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 px-5">
|
||||
<Animation Effect="@Effect.FadeIn" Speed="@Speed.Fast" Delay="@TimeSpan.FromMilliseconds(250)">
|
||||
<p>
|
||||
|
||||
Welcome back to Budapest Airport Transfer Services! We're delighted to have you return to our platform. Please sign in to access your account and manage your bookings effortlessly. If you're new here, feel free to create an account to unlock exclusive benefits and enjoy a seamless booking experience.
|
||||
|
||||
</p>
|
||||
</Animation>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public string renewToken { get; set; }
|
||||
|
||||
private UserModelDto user;
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
return base.OnInitializedAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
@using Microsoft.AspNetCore.Authorization
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IPopulationStructureDataProvider DataProvider
|
||||
@inject ISupplierService SupplierService
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
namespace TIAMSharedUI.Pages.User
|
||||
{
|
||||
public partial class Home
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<div class="col-12 col-md-6">
|
||||
<h4>Information</h4>
|
||||
@RenderDetailsItem("fa-solid fa-user", "Contact Name", companyProfile.FullName)
|
||||
|
||||
@RenderDetailsItem("fa-solid fa-circle-info", "Description", companyProfile.Description)
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-6">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
@using BlazorAnimation
|
||||
@using TIAM.Core.Enums
|
||||
@using TIAM.Entities.Addresses
|
||||
@using TIAM.Entities.Products
|
||||
@using TIAM.Entities.Profiles
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
|
|
@ -16,6 +17,7 @@
|
|||
@inject IUserDataService UserDataService;
|
||||
@inject AdminSignalRClient AdminSignalRClient;
|
||||
@inject IJSRuntime JsRuntime;
|
||||
@inject NavigationManager NavManager;
|
||||
|
||||
<div class="e-card cw-480">
|
||||
<div class="e-main d-flex align-items-center">
|
||||
|
|
@ -41,34 +43,65 @@
|
|||
<hr class="hr" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-12 col-md-3">
|
||||
<h4>Information</h4>
|
||||
|
||||
@RenderDetailsItem("fa-solid fa-user", "Contact Name", productProfile.FullName)
|
||||
|
||||
@RenderDetailsItem("fa-solid fa-circle-info", "Description", Context.Description)
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-12 col-md-9">
|
||||
<h4>Affiliate information</h4>
|
||||
@{
|
||||
if (Context.ServiceProviderId != null)
|
||||
{
|
||||
var _url = $"{Setting.BaseUrl}/public/transfer/{Context.ServiceProvider.AffiliateId}/{Context.Id}";
|
||||
<p>Use this link to send it in an email to the client</p>
|
||||
<a href="@_url" target="_blank">@_url</a>
|
||||
<DxButton Context="ButtonContext" CssClass="btn-primary" Click="() => CopyUrl(_url)"><i class="fa-solid fa-copy"></i></DxButton>
|
||||
// <DxButton CssClass="btn btn-primary" Click="() => CopyUrl(_url)">Copy referral url</DxButton>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-6">
|
||||
|
||||
</div>
|
||||
<div class="col-3 col-md-2">
|
||||
<DxButton CssClass="btn btn-primary" Click="ChangeName" Enabled="@isSaveActive"> Save</DxButton>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row py-3">
|
||||
<div class="col-4">
|
||||
@{
|
||||
if (Context.ProductType == TIAM.Core.Enums.ProductType.Hotel)
|
||||
{
|
||||
string url = $"user/hoteladmin/{Context.Id}";
|
||||
<DxButton class="btn-primary" Click="() => NavManager.NavigateTo(url)">Manage</DxButton>
|
||||
}
|
||||
else if (Context.ProductType == TIAM.Core.Enums.ProductType.Transfer)
|
||||
{
|
||||
string url = $"user/transferadmin/{Context.Id}";
|
||||
<DxButton class="btn btn-primary" Click="() => NavManager.NavigateTo(url)">Manage</DxButton>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@{
|
||||
|
||||
if (!isAddressTransferDestination)
|
||||
{
|
||||
// <p>Address:</p>
|
||||
// <p>@(((Product)context.DataItem).Profile.Address.AddressText)</p>
|
||||
<DxButton Click="() => SaveAsDestination(productProfile.Address, Context)" Text="Save as destination" RenderStyle="ButtonRenderStyle.Primary" />
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="col-4"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p>@msg</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -93,9 +126,10 @@
|
|||
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
||||
|
||||
private Profile productProfile = new Profile();
|
||||
|
||||
private List<TransferDestination> destinations = [];
|
||||
string msg;
|
||||
private bool isSaveActive = false;
|
||||
private bool isAddressTransferDestination = false;
|
||||
|
||||
private async Task CopyUrl(string url)
|
||||
{
|
||||
|
|
@ -103,35 +137,22 @@
|
|||
await JsRuntime.InvokeVoidAsync("copyToClipboard", url);
|
||||
}
|
||||
|
||||
void OnPasswordConfirmed(string password)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected async Task ChangeName()
|
||||
{
|
||||
|
||||
isSaveActive = false;
|
||||
|
||||
|
||||
await DataChanged.InvokeAsync(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var productOwner = await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesById, Context.ServiceProviderId);
|
||||
var ProductProfiles = await AdminSignalRClient.GetByIdAsync<List<Profile>>(SignalRTags.GetProfileById, Context.ProfileId);
|
||||
await AdminSignalRClient.GetAllIntoAsync<TransferDestination>(destinations, SignalRTags.GetAllTransferDestinations);
|
||||
if (productOwner != null)
|
||||
{
|
||||
ImageSource = await ServiceProviderDataService.GetQRCodeByProductIdAndOwnerAffiliateIdAsync(new Guid[] { productOwner[0].AffiliateId, Context.Id });
|
||||
}
|
||||
var ProductProfiles = await AdminSignalRClient.GetByIdAsync<List<Profile>>(SignalRTags.GetProfileById, Context.ProfileId);
|
||||
if (ProductProfiles != null)
|
||||
{
|
||||
productProfile = ProductProfiles[0];
|
||||
var AddressId = productProfile.AddressId;
|
||||
isAddressTransferDestination = CheckDestinations(AddressId);
|
||||
}
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
|
|
@ -154,8 +175,44 @@
|
|||
</div>;
|
||||
}
|
||||
|
||||
private void RefreshComponent()
|
||||
private bool CheckDestinations(Guid addressId)
|
||||
{
|
||||
StateHasChanged();
|
||||
|
||||
|
||||
if (destinations != null)
|
||||
{
|
||||
if (destinations.Any(d => d.AddressId == addressId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task SaveAsDestination(Address address, Product product)
|
||||
{
|
||||
TransferDestination transferDestination = new TransferDestination();
|
||||
transferDestination.Id = Guid.NewGuid();
|
||||
transferDestination.Name = product.Name;
|
||||
if (!string.IsNullOrEmpty(product.Profile.Description))
|
||||
{
|
||||
transferDestination.Description = product.Profile.Description;
|
||||
}
|
||||
else
|
||||
{
|
||||
transferDestination.Description = "No description available";
|
||||
}
|
||||
transferDestination.AddressId = address.Id;
|
||||
transferDestination.AddressString = address.AddressText;
|
||||
var result = await AdminSignalRClient.PostDataAsync<TransferDestination>(SignalRTags.CreateTransferDestination, transferDestination);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
|
||||
<div class="col-9 col-md-4">
|
||||
<DxTextBox @bind-Text="@OldPassword"
|
||||
<DxTextBox hidden="@IsForgotten" @bind-Text="@OldPassword"
|
||||
NullText="Old password"
|
||||
Password="true"
|
||||
CssClass="form-field" />
|
||||
|
|
@ -64,6 +64,8 @@
|
|||
|
||||
[Parameter] public EventCallback<string> DataChanged { get; set; }
|
||||
|
||||
[Parameter] public bool IsForgotten { get; set; } = false;
|
||||
|
||||
private bool PasswordNotSet = true;
|
||||
private bool PasswordNotConfirmed = true;
|
||||
|
||||
|
|
@ -124,21 +126,42 @@
|
|||
|
||||
protected async Task SetPassword()
|
||||
{
|
||||
|
||||
isSaveActive = false;
|
||||
|
||||
var changePasswordDto = new ChangePasswordDto(Context.Id, OldPassword, NewPassword);
|
||||
//var changePasswordDto = new ChangePasswordDto(Context.Id, "Asdasd123456", NewPassword);
|
||||
var result = await AdminSignalRClient.PostDataAsync(SignalRTags.UserChangePassword, changePasswordDto);
|
||||
|
||||
if (result != null)
|
||||
if (!IsForgotten)
|
||||
{
|
||||
msg = $"Password saved";
|
||||
StateHasChanged();
|
||||
|
||||
isSaveActive = false;
|
||||
|
||||
var changePasswordDto = new ChangePasswordDto(Context.Id, OldPassword, NewPassword);
|
||||
//var changePasswordDto = new ChangePasswordDto(Context.Id, "Asdasd123456", NewPassword);
|
||||
var result = await AdminSignalRClient.PostDataAsync(SignalRTags.UserChangePassword, changePasswordDto);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
msg = $"Password saved";
|
||||
StateHasChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "Some error occured during saving, please try again later";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "Some error occured during saving, please try again later";
|
||||
isSaveActive = false;
|
||||
|
||||
var forgotPasswordDto = new ForgotPasswordDto(Context.UserDto.EmailAddress, NewPassword);
|
||||
//var changePasswordDto = new ChangePasswordDto(Context.Id, "Asdasd123456", NewPassword);
|
||||
var result = await AdminSignalRClient.PostDataAsync(SignalRTags.UserForgotPassword, forgotPasswordDto);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
msg = $"Password saved";
|
||||
StateHasChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "Some error occured during saving, please try again later";
|
||||
}
|
||||
}
|
||||
await DataChanged.InvokeAsync(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
@using AyCode.Core.Helpers
|
||||
@using DevExpress.Data.Filtering
|
||||
@using TIAM.Entities.Emails
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Models;
|
||||
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IPopulationStructureDataProvider DataProvider
|
||||
@inject ISupplierService SupplierService
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IPopulationStructureDataProvider DataProvider
|
||||
@inject ISessionService SessionService
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
@page "/user/hoteladmin/{id:guid}"
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Interfaces;
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IUserDataService UserDataService
|
||||
@inject ISessionService SessionService
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
@using AyCode.Core.Helpers
|
||||
@using DevExpress.Data.Filtering
|
||||
@using TIAM.Entities.Emails
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
@using AyCode.Core
|
||||
@using AyCode.Core.Helpers
|
||||
@using DevExpress.Data.Filtering
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject NavigationManager navigationManager
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
@using TIAM.Services
|
||||
@using TIAMSharedUI.Pages.User.SysAdmins
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
|
|
@ -14,6 +15,7 @@
|
|||
@using AyCode.Core.Helpers
|
||||
@using TIAMSharedUI.Shared.Components.Grids
|
||||
@using TIAMSharedUI.Pages.User.CardComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<h3>ManageMessages</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
|
|
@ -9,11 +9,13 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
|
||||
@using AyCode.Core.Helpers
|
||||
@using AyCode.Core.Consts
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
||||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
@inject ISessionService SessionService
|
||||
@inject IWizardProcessor WizardProcessor
|
||||
|
|
@ -60,7 +62,7 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_logger = new LoggerClient<ManageUserProductMappings>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageUserProductMappings>(_logWriters.ToArray());
|
||||
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAM.Core.Consts
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
@inject ISessionService SessionService
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
|
||||
<PageTitle>User permissions</PageTitle>
|
||||
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_logger = new LoggerClient<ManageDrivers>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageDrivers>(_logWriters.ToArray());
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
@using TIAMSharedUI.Shared.Components.Grids
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IServiceProviderDataService ServiceProviderDataService
|
||||
|
||||
<div class="text-center m-5">
|
||||
|
|
@ -171,7 +171,7 @@
|
|||
{
|
||||
base.OnInitialized();
|
||||
|
||||
_logger = new LoggerClient<ManageProducts>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageProducts>(_logWriters.ToArray());
|
||||
|
||||
await FillGridDataSource();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@using AyCode.Core.Extensions;
|
||||
@using TIAM.Entities.Addresses
|
||||
|
|
@ -17,8 +16,9 @@
|
|||
@using TIAM.Entities.Products
|
||||
@using TIAM.Entities.Users
|
||||
@using TIAM.Services
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
@inject IWizardProcessor wizardProcessor
|
||||
@inject IServiceProviderDataService serviceProviderDataService
|
||||
|
|
@ -305,7 +305,7 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_logger = new LoggerClient<ManageServiceProviders>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageServiceProviders>(_logWriters.ToArray());
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
@using AyCode.Core.Helpers
|
||||
@using AyCode.Core.Consts
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
@inject ISessionService SessionService
|
||||
@inject IWizardProcessor WizardProcessor
|
||||
|
|
@ -139,7 +139,7 @@
|
|||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_logger = new LoggerClient<ManageTransferDestinationToProducts>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageTransferDestinationToProducts>(_logWriters.ToArray());
|
||||
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
@using TIAM.Services
|
||||
@using TIAMSharedUI.Shared
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ using Microsoft.AspNetCore.Components;
|
|||
using TIAMWebApp.Shared.Application.Utility;
|
||||
using AyCode.Services.Loggers;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAMSharedUI.Shared.Components.BaseComponents;
|
||||
|
||||
|
||||
namespace TIAMSharedUI.Pages.User.SysAdmins
|
||||
{
|
||||
public partial class ManageTransferDestinations : ComponentBase
|
||||
public partial class ManageTransferDestinations : BasePageComponent
|
||||
{
|
||||
|
||||
IGrid Grid { get; set; }
|
||||
|
|
@ -24,9 +26,6 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
|
|||
[Inject]
|
||||
public ITransferDataService TransferDataService { get; set; }
|
||||
|
||||
[Inject]
|
||||
public IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||
|
||||
/*object? TransferData = new TransferDestinationWizardModel[]
|
||||
{
|
||||
new TransferDestinationWizardModel(Guid.NewGuid(), "Liszt Ferenc Airport", "International airport of Budapest", "1185, Budapest, Liszt Ferenc Repülőtér" ),
|
||||
|
|
@ -92,7 +91,7 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
|
|||
{
|
||||
base.OnInitialized();
|
||||
|
||||
_logger = new LoggerClient<ManageTransferDestinations>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageTransferDestinations>(_logWriters.ToArray());
|
||||
|
||||
//await FillGridDataSource();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using AyCode.Services.Loggers
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@using TIAMSharedUI.Shared.Components.Grids
|
||||
@using AyCode.Core.Enums
|
||||
|
|
@ -21,8 +20,9 @@
|
|||
@using AyCode.Core.Helpers
|
||||
@using DevExpress.Data.Filtering
|
||||
@using TIAM.Entities.Emails
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
@inject IWizardProcessor wizardProcessor
|
||||
@inject ITransferDataService transferDataService
|
||||
|
|
@ -454,7 +454,7 @@
|
|||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
_logger = new LoggerClient<ManageTransfers>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageTransfers>(_logWriters.ToArray());
|
||||
|
||||
return base.OnInitializedAsync();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,9 @@
|
|||
@using AyCode.Services.Loggers
|
||||
@using AyCode.Core.Helpers
|
||||
@using AyCode.Core.Consts
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
@inject ISessionService SessionService
|
||||
@inject IWizardProcessor WizardProcessor
|
||||
|
|
@ -158,7 +159,7 @@
|
|||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_logger = new LoggerClient<ManageUserProductMappings>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageUserProductMappings>(_logWriters.ToArray());
|
||||
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
@using AyCode.Core.Extensions
|
||||
@using AyCode.Core.Helpers
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
@inject ISessionService SessionService
|
||||
@inject IWizardProcessor WizardProcessor
|
||||
@inject IUserDataService UserDataService
|
||||
@inject AdminSignalRClient AdminSignalRClient;
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
|
||||
MessageWizardModel.ReceiverId = item.Id;
|
||||
MessageWizardModel.ReceiverEmailAddress = item.UserDto.EmailAddress;
|
||||
MessageWizardModel.SenderId = SessionService.User?.UserId ?? throw new NullReferenceException("SessionService.User == null");
|
||||
MessageWizardModel.SenderId = _sessionService.User?.UserId ?? throw new NullReferenceException("SessionService.User == null");
|
||||
MessageWizardModel.SenderEmailAddress = "info@anataworld.com";
|
||||
|
||||
// _logger.Info($"Sending mail to {MessageWizardModel.ReceiverEmailAddress} from {MessageWizardModel.SenderId}");
|
||||
|
|
@ -317,7 +317,7 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_logger = new LoggerClient<ManageUsers>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<ManageUsers>(_logWriters.ToArray());
|
||||
|
||||
await UpdateDataAsync();
|
||||
base.OnInitialized();
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@
|
|||
<div class="page">
|
||||
<TiamErrorBoundaryComponent LoggerCategory="AdminLayout" OnError="HandleError">
|
||||
<AdminNavMenu />
|
||||
@* <div class="my-sidebar">
|
||||
<AdminNavMenu />
|
||||
</div> *@
|
||||
<NavHelperComponent />
|
||||
|
||||
<main>
|
||||
<article class="content">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
using AyCode.Services.Loggers;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TIAM.Resources;
|
||||
using TIAMSharedUI.Pages.User;
|
||||
using TIAMSharedUI.Resources;
|
||||
using TIAMWebApp.Shared.Application.Interfaces;
|
||||
using TIAMWebApp.Shared.Application.Utility;
|
||||
|
||||
namespace TIAMSharedUI.Shared.Components.BaseComponents
|
||||
{
|
||||
public class BasePageComponent : ComponentBase
|
||||
{
|
||||
[Inject]
|
||||
protected NavigationManager _navManager { get; set; }
|
||||
[Inject]
|
||||
protected PageHistoryState _pageState { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected IEnumerable<IAcLogWriterClientBase> _logWriters { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected IStringLocalizer<TIAMResources> _localizer { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected ISessionService _sessionService { get; set; }
|
||||
|
||||
private LoggerClient<BasePageComponent> _logger = null!;
|
||||
public BasePageComponent(NavigationManager navManager, PageHistoryState pageState, IEnumerable<IAcLogWriterClientBase> logWriters, IStringLocalizer<TIAMResources> localizer,ISessionService sessionService)
|
||||
{
|
||||
_navManager = navManager;
|
||||
_pageState = pageState;
|
||||
_logWriters = logWriters;
|
||||
_localizer = localizer;
|
||||
_sessionService = sessionService;
|
||||
}
|
||||
|
||||
public BasePageComponent()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
base.OnInitialized();
|
||||
_logger = new LoggerClient<BasePageComponent>(_logWriters.ToArray());
|
||||
var currentUrl = _navManager.ToBaseRelativePath(_navManager.Uri);
|
||||
_pageState.AddPageToHistory(currentUrl);
|
||||
_logger.Debug(_pageState.GetGoBackPage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@inject NavigationManager NavManager
|
||||
@inject PageHistoryState pageHistoryState
|
||||
|
||||
<div class="container-fluid fixed-top pt-5">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<DxButton Click="() => GoBack()"><i class="fa-solid fa-chevron-left"></i></DxButton>
|
||||
</div>
|
||||
<div class="col-10"></div>
|
||||
<div class="col-1">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
private string _previousUrl;
|
||||
private bool isBackVisible = false;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
if(pageHistoryState.CanGoBack())
|
||||
{
|
||||
isBackVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void GoBack()
|
||||
{
|
||||
@if (pageHistoryState.CanGoBack())
|
||||
{
|
||||
NavManager.NavigateTo(pageHistoryState.GetGoBackPage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,22 +13,22 @@
|
|||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
||||
|
||||
<div class="w-100" style="height:40px; position:fixed;">
|
||||
<DxMenu Title="Tour I Am" ItemsPosition="ItemPosition.End" CollapseItemsToHamburgerMenu="true"
|
||||
Orientation="Orientation"
|
||||
DisplayMode="DisplayMode">
|
||||
<Items>
|
||||
<DxMenuItem NavigateUrl="/" Text="Home" IconCssClass="menu-icon-home menu-icon" />
|
||||
<DxMenuItem NavigateUrl="user/properties" Text="My companies" IconCssClass="fa-solid fa-building" />
|
||||
<div class="w-100" style="height:40px; position:fixed; z-index: 10000;">
|
||||
<DxMenu Title="Tour I Am" ItemsPosition="ItemPosition.End" CollapseItemsToHamburgerMenu="true"
|
||||
Orientation="Orientation"
|
||||
DisplayMode="DisplayMode">
|
||||
<Items>
|
||||
<DxMenuItem NavigateUrl="/" Text="Home" IconCssClass="menu-icon-home menu-icon" />
|
||||
<DxMenuItem NavigateUrl="user/properties" Text="My companies" IconCssClass="fa-solid fa-building" />
|
||||
<DxMenuItem NavigateUrl="user/createAndManageTransfer" IconCssClass="fa-solid fa-route" Text="Transfer" />
|
||||
<DxMenuItem NavigateUrl="user/media" Text="Media" IconCssClass="menu-icon-home menu-icon" />
|
||||
<DxMenuItem NavigateUrl="user/messages" Text="Messages" IconCssClass="fa-solid fa-envelope" />
|
||||
<DxMenuItem NavigateUrl="user/media" Text="Media" IconCssClass="menu-icon-home menu-icon" />
|
||||
<DxMenuItem NavigateUrl="user/messages" Text="Messages" IconCssClass="fa-solid fa-envelope" />
|
||||
|
||||
<DxMenuItem Text="Driver" Visible="@IsDriver" IconCssClass="fa-solid fa-id-card">
|
||||
<Items>
|
||||
<DxMenuItem NavigateUrl="driver/dashboard" Text="Dashboard" />
|
||||
|
||||
|
||||
|
||||
|
||||
@{
|
||||
string url1 = $"driver/transfers/{SessionService.DriverPersmissionId}";
|
||||
string url2 = $"driver/cars/{SessionService.DriverPersmissionId}";
|
||||
|
|
@ -39,35 +39,35 @@
|
|||
</Items>
|
||||
</DxMenuItem>
|
||||
|
||||
<DxMenuItem Text="SysAdmin" Visible="@IsSysAdmin" IconCssClass="fa-solid fa-unlock-keyhole">
|
||||
<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="fa-solid fa-unlock-keyhole">
|
||||
<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" />
|
||||
</Items>
|
||||
</DxMenuItem>
|
||||
<DxMenuItem NavigateUrl="sysadmin/userproductmappings" Text="Permissions" />
|
||||
<DxMenuItem NavigateUrl="sysadmin/users" Text="Users" />
|
||||
</Items>
|
||||
</DxMenuItem>
|
||||
|
||||
<DxMenuItem Text="DevAdmin" Visible="@IsDevAdmin" IconCssClass="fa-solid fa-shield-halved">
|
||||
<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" />
|
||||
<DxMenuItem NavigateUrl="user/createAndManageTransfer" Text="Transfers" />
|
||||
<DxMenuItem NavigateUrl="user/serviceprovider/5453-a87f77787d-khj899" Text="Manage hotel" />
|
||||
</Items>
|
||||
</DxMenuItem-->
|
||||
<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" />
|
||||
<DxMenuItem NavigateUrl="user/createAndManageTransfer" Text="Transfers" />
|
||||
<DxMenuItem NavigateUrl="user/serviceprovider/5453-a87f77787d-khj899" Text="Manage hotel" />
|
||||
</Items>
|
||||
</DxMenuItem-->
|
||||
<DxMenuItem CssClass="notoggle" Position="ItemPosition.End">
|
||||
<TextTemplate>
|
||||
<div class="fa-solid fa-user" />
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
<div class="w-100 user-profile p-3">
|
||||
<div class="flex-column align-items-center justify-content-center">
|
||||
<div class="logo-container d-flex align-items-center justify-content-center">
|
||||
<div class="menu-icon-large">
|
||||
<div class="menu-icon-large">
|
||||
<i class="fa-solid fa-user"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -91,148 +91,11 @@
|
|||
</div>
|
||||
</SubMenuTemplate>
|
||||
</DxMenuItem>
|
||||
</Items>
|
||||
</DxMenu>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@* <div class="top-row ps-3 navbar navbar-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand my-navbar-brand" href=""></a>
|
||||
<button title="Navigation menu" class="navbar-toggler my-navbar-toggler" @onclick="ToggleNavMenu">
|
||||
<img src="_content/TIAMSharedUI/images/navbar-toggler.png" width="40" />
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</Items>
|
||||
</DxMenu>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
|
||||
<div style="display: flex; align-content: center; justify-content:center" class="my-navbar-hero">
|
||||
|
||||
<a class="navbar-brand my-navbar-brand" href=""><img src="_content/TIAMSharedUI/images/logo_wide.png" alt="TourIam Logo" title="TourIAm Logo" /></a>
|
||||
|
||||
</div>
|
||||
<nav class="flex-column">
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="">
|
||||
Home
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/properties">
|
||||
My companies
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/products">
|
||||
Services
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/media">
|
||||
Media
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" @onclick="()=>expandSysAdminNav = !expandSysAdminNav">
|
||||
<span class="oi oi-list-rich" aria-hidden="true"></span> System Admin
|
||||
</NavLink>
|
||||
</div>
|
||||
@if (expandSysAdminNav)
|
||||
{
|
||||
<hr />
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/sysadmin">
|
||||
Dashboard
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/transfers">
|
||||
Transfers
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/companies">
|
||||
Partners
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/users">
|
||||
Users
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/destinations">
|
||||
Destinations
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
}
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" @onclick="()=>expandHotelAdminNav = !expandHotelAdminNav">
|
||||
<span class="oi oi-list-rich" aria-hidden="true"></span> Hotel Admin
|
||||
</NavLink>
|
||||
</div>
|
||||
@if (expandHotelAdminNav)
|
||||
{
|
||||
<hr />
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/hoteladmin">
|
||||
Hotel Dashboard
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/createAndManageTransfer">
|
||||
Transfer
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/serviceprovider/5453-a87f77787d-khj899">
|
||||
Manage
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="serviceprovider">
|
||||
Public profile
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="counter">
|
||||
My earnings
|
||||
</NavLink>
|
||||
</div>
|
||||
<hr />
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="user/profile">
|
||||
Profile
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="#" @onclick="SignOut">
|
||||
Signout
|
||||
</NavLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div> *@
|
||||
|
||||
@code {
|
||||
private bool collapseNavMenu = true;
|
||||
private bool expandSysAdminNav = false;
|
||||
|
|
@ -293,7 +156,7 @@
|
|||
SessionService.User = null;
|
||||
SessionService.IsAuthenticated = false;
|
||||
NavigationManager.NavigateTo("/");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
@inject NavigationManager NavManager
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<div class="container-fluid fixed-top pt-5">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<DxButton Click="() => GoBack()"><i class="fa-solid fa-chevron-left"></i></DxButton>
|
||||
</div>
|
||||
<div class="col-10"></div>
|
||||
<div class="col-1">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.historyHelper = {
|
||||
getPreviousUrl: function () {
|
||||
return document.referrer;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@code {
|
||||
|
||||
private string _previousUrl;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_previousUrl = await JsRuntime.InvokeAsync<string>("historyHelper.getPreviousUrl");
|
||||
Console.Write("");
|
||||
}
|
||||
|
||||
private void GoBack()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_previousUrl) && _previousUrl != NavManager.Uri)
|
||||
{
|
||||
NavManager.NavigateTo(_previousUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
NavManager.NavigateTo("/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Content Remove="Pages\Utility\DynamicForm.razor" />
|
||||
<Content Remove="Shared\Users\NavigationHelperComponent.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
|
@ -91,14 +92,20 @@
|
|||
|
||||
<ItemGroup>
|
||||
<_ContentIncludedByDefault Remove="Pages\Utility\DynamicForm.razor" />
|
||||
<_ContentIncludedByDefault Remove="Shared\Users\NavigationHelperComponent.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Pages\Utility\DynamicForm.razor" />
|
||||
<None Include="Shared\Users\NavigationHelperComponent.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<UpToDateCheckInput Remove="Pages\Utility\DynamicForm.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<UpToDateCheckInput Remove="Shared\Users\NavigationHelperComponent.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ builder.Services.AddAuthorizationCore();
|
|||
builder.Services.AddScoped<ExchangeRateService>();
|
||||
builder.Services.AddScoped<SmartyStreetsService>();
|
||||
builder.Services.AddScoped<GooglePlacesService>();
|
||||
builder.Services.AddSingleton<PageHistoryState>();
|
||||
//builder.Services.AddScoped<BrowserConsoleLogWriter>();
|
||||
|
||||
//WebSpecific end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TIAMWebApp.Shared.Application.Utility
|
||||
{
|
||||
public class PageHistoryState
|
||||
{
|
||||
private List<string> previousPages;
|
||||
|
||||
public PageHistoryState()
|
||||
{
|
||||
previousPages = new List<string>();
|
||||
}
|
||||
public void AddPageToHistory(string pageName)
|
||||
{
|
||||
previousPages.Add(pageName);
|
||||
}
|
||||
|
||||
public string GetGoBackPage()
|
||||
{
|
||||
if (previousPages.Count > 1)
|
||||
{
|
||||
// You add a page on initialization, so you need to return the 2nd from the last
|
||||
return previousPages.ElementAt(previousPages.Count - 2);
|
||||
}
|
||||
|
||||
// Can't go back because you didn't navigate enough
|
||||
return previousPages.FirstOrDefault();
|
||||
}
|
||||
|
||||
public bool CanGoBack()
|
||||
{
|
||||
return previousPages.Count > 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue