Compare commits
3 Commits
d7c33c451b
...
23203d6fbf
| Author | SHA1 | Date |
|---|---|---|
|
|
23203d6fbf | |
|
|
332c0a2d56 | |
|
|
3805590383 |
|
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
@using BlazorAnimation
|
||||
@using TIAM.Core.Enums
|
||||
@using TIAM.Entities.Profiles
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Entities.Users
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAM.Services
|
||||
@using TIAMSharedUI.Shared.Components.Cards
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@inject IServiceProviderDataService ServiceProviderDataService
|
||||
@inject IUserDataService UserDataService
|
||||
@inject AdminSignalRClient AdminSignalRClient
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<div class="e-card cw-480">
|
||||
<div class="e-main d-flex align-items-center">
|
||||
<div class="flex-shrink-0">
|
||||
<img class="e-photo" src="_content/TIAMSharedUI/images/defaultavatar_60.png" alt="" />
|
||||
</div>
|
||||
<div class="e-info flex-grow-1 ms-3">
|
||||
<div class="e-name">@($"{Context.Name}")</div>
|
||||
<p class="e-title"><i class="fa-solid fa-at"></i> @Context.Profile.EmailAddress</p>
|
||||
<p class="e-title"><i class="fa-solid fa-location-dot"></i> @Context.Profile.Address.AddressText</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="hr" />
|
||||
|
||||
<div class="row">
|
||||
<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">
|
||||
<h4>Services in this company</h4>
|
||||
@{
|
||||
if (Context.Products.Count() > 0)
|
||||
{
|
||||
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var item in Context.Products)
|
||||
{
|
||||
<DxAccordionItem Text=@($"{item.Name}")>
|
||||
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<ProductCardComponent DataChanged="RefreshComponent" Context="@item" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
</Items>
|
||||
</DxAccordion>
|
||||
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<p>@msg</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter] public Company Context { get; set; }
|
||||
|
||||
[Parameter] public EventCallback<string> DataChanged { get; set; }
|
||||
|
||||
AccordionExpandMode ExpandMode { get; set; } = AccordionExpandMode.SingleOrNone;
|
||||
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
||||
|
||||
string msg;
|
||||
private bool isSaveActive = false;
|
||||
|
||||
private Profile companyProfile = new Profile();
|
||||
|
||||
void OnPasswordConfirmed(string password)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected async Task ChangeName()
|
||||
{
|
||||
|
||||
isSaveActive = false;
|
||||
|
||||
|
||||
await DataChanged.InvokeAsync(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var CompanyProfiles = await AdminSignalRClient.GetByIdAsync<List<Profile>>(SignalRTags.GetProfileById, Context.ProfileId);
|
||||
if (CompanyProfiles != null)
|
||||
{
|
||||
companyProfile = CompanyProfiles[0];
|
||||
}
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
RenderFragment RenderDetailsItem(string iconCssClass, string caption, string value)
|
||||
{
|
||||
|
||||
return @<div class="d-flex m-1 align-items-center">
|
||||
<div class="icon-container flex-shrink-0">
|
||||
<span class="dxbl-image m-1 @iconCssClass"></span>
|
||||
</div>
|
||||
<div class="text-container m-1 flex-grow-1 ms-2">
|
||||
<label>@caption:</label>
|
||||
<div>@value</div>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
private void RefreshComponent()
|
||||
{
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
.e-name {
|
||||
margin-bottom: 0.25rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.e-email {
|
||||
font-size: 0.75rem;
|
||||
text-decoration: underline;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.e-title {
|
||||
font-size: 0.875rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.e-details .text-container label {
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
|
||||
.e-details .text-container {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.125rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
@using BlazorAnimation
|
||||
@using TIAM.Core.Enums
|
||||
@using TIAM.Entities.Addresses
|
||||
@using TIAM.Entities.Products
|
||||
@using TIAM.Entities.Profiles
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Entities.Users
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAM.Services
|
||||
@using TIAMSharedUI.Shared.Components.Cards
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@inject IServiceProviderDataService ServiceProviderDataService
|
||||
@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">
|
||||
@* <div class="flex-shrink-0">
|
||||
<img class="e-photo" src="_content/TIAMSharedUI/images/defaultavatar_60.png" alt="" />
|
||||
</div> *@
|
||||
|
||||
<div class="flex-shrink-0">
|
||||
<a href="api/pictures/1" download="data:image/png;base64,@ImageSource" target="_top">
|
||||
|
||||
<img class="align-self-center img-fluid"
|
||||
src="data:image/png;base64,@ImageSource" width="128" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="e-info flex-grow-1 ms-3">
|
||||
<div class="e-name">@($"{Context.Name}")</div>
|
||||
<p class="e-title"><i class="fa-solid fa-at"></i> @Context.Profile.EmailAddress</p>
|
||||
<p class="e-title"><i class="fa-solid fa-location-dot"></i> @Context.Profile.Address.AddressText</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="hr" />
|
||||
|
||||
<div class="row">
|
||||
<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-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-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>
|
||||
|
||||
<script>
|
||||
function copyToClipboard(text) {
|
||||
navigator.clipboard.writeText(text).then(function () {
|
||||
console.log('Copied to clipboard successfully!');
|
||||
}, function (err) {
|
||||
alert('Could not copy text: ' + err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@code {
|
||||
[Parameter] public Product Context { get; set; }
|
||||
|
||||
[Parameter] public EventCallback<string> DataChanged { get; set; }
|
||||
|
||||
public string ImageSource { get; set; } = "";
|
||||
AccordionExpandMode ExpandMode { get; set; } = AccordionExpandMode.SingleOrNone;
|
||||
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)
|
||||
{
|
||||
|
||||
await JsRuntime.InvokeVoidAsync("copyToClipboard", url);
|
||||
}
|
||||
|
||||
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 });
|
||||
}
|
||||
if (ProductProfiles != null)
|
||||
{
|
||||
productProfile = ProductProfiles[0];
|
||||
var AddressId = productProfile.AddressId;
|
||||
isAddressTransferDestination = CheckDestinations(AddressId);
|
||||
}
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
RenderFragment RenderDetailsItem(string iconCssClass, string caption, string value)
|
||||
{
|
||||
return @<div class="d-flex m-1 align-items-center">
|
||||
<div class="icon-container flex-shrink-0">
|
||||
<span class="dxbl-image m-1 @iconCssClass"></span>
|
||||
</div>
|
||||
<div class="text-container m-1 flex-grow-1 ms-2">
|
||||
<label>@caption:</label>
|
||||
<div>@value</div>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
private bool CheckDestinations(Guid addressId)
|
||||
{
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
.e-name {
|
||||
margin-bottom: 0.25rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.e-email {
|
||||
font-size: 0.75rem;
|
||||
text-decoration: underline;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.e-title {
|
||||
font-size: 0.875rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.e-details .text-container label {
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
|
||||
.e-details .text-container {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.125rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
@page "/user/properties"
|
||||
@using BlazorAnimation
|
||||
@using TIAM.Core.Enums
|
||||
@using TIAM.Entities.ServiceProviders
|
||||
@using TIAM.Resources
|
||||
@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
|
||||
|
|
@ -12,6 +14,8 @@
|
|||
@using TIAMWebApp.Shared.Application.Services
|
||||
@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
|
||||
|
|
@ -29,60 +33,72 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class=" col-12">
|
||||
<Animation Effect="@Effect.FadeIn" 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>
|
||||
|
||||
<CompanyGrid @ref="_gridCompany"
|
||||
Logger="_logger"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
ContextIds="_contextIds.Cast<object>().ToArray()"
|
||||
GetAllMessageTag="SignalRTags.GetCompaniesByContextId"
|
||||
PageSize="12"
|
||||
ValidationEnabled="false"
|
||||
DetailRowDisplayMode="GridDetailRowDisplayMode.Auto"
|
||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditRow">
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="160px" />
|
||||
<DxGridDataColumn FieldName="Id" Visible="false" MinWidth="130" />
|
||||
<DxGridDataColumn FieldName="Name" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="AffiliateId" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="Id" Width="130">
|
||||
<CellDisplayTemplate>
|
||||
<a class="btn btn-primary" href="user/serviceprovider/@context.Value.ToString()">Manage</a>
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn Caption="Address" FieldName="Profile.Address.AddressText" Width="280" />
|
||||
|
||||
<DxTabs>
|
||||
<DxTabPage Text="Cards">
|
||||
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
<p>Address: @(((Company)context.DataItem).Profile.Address.AddressText)</p>
|
||||
}
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var company in companies)
|
||||
{
|
||||
|
||||
<DxTabs>
|
||||
<DxTabPage Text="Products">
|
||||
<ProductDetailGridComponent ShowManageButtons="true" DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto" ParentData="(Company)context.DataItem" ContextId="((Company)context.DataItem).Id" />
|
||||
</DxTabPage>
|
||||
<DxAccordionItem CssClass="" Text=@($"{company.Name}")>
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<CompanyCardComponent DataChanged="RefreshComponent" Context="@company" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
</Items>
|
||||
</DxAccordion>
|
||||
|
||||
</DxTabs>
|
||||
</DxTabPage>
|
||||
<DxTabPage Text="Grid">
|
||||
<CompanyGrid @ref="_gridCompany"
|
||||
Logger="_logger"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
ContextIds="_contextIds.Cast<object>().ToArray()"
|
||||
GetAllMessageTag="SignalRTags.GetCompaniesByContextId"
|
||||
PageSize="12"
|
||||
ValidationEnabled="false"
|
||||
DetailRowDisplayMode="GridDetailRowDisplayMode.Auto"
|
||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditRow">
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="160px" />
|
||||
<DxGridDataColumn FieldName="Id" Visible="false" MinWidth="130" />
|
||||
<DxGridDataColumn FieldName="Name" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="AffiliateId" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="Id" Width="130">
|
||||
<CellDisplayTemplate>
|
||||
<a class="btn btn-primary" href="user/serviceprovider/@context.Value.ToString()">Manage</a>
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn Caption="Address" FieldName="Profile.Address.AddressText" Width="280" />
|
||||
|
||||
</DetailRowTemplate>
|
||||
</CompanyGrid>
|
||||
</div>
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
<p>Address: @(((Company)context.DataItem).Profile.Address.AddressText)</p>
|
||||
}
|
||||
|
||||
</div>
|
||||
</Animation>
|
||||
</div>
|
||||
<DxTabs>
|
||||
<DxTabPage Text="Products">
|
||||
<ProductDetailGridComponent ShowManageButtons="true" DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto" ParentData="(Company)context.DataItem" ContextId="((Company)context.DataItem).Id" />
|
||||
</DxTabPage>
|
||||
|
||||
<div class=" col-12 col-xl-6">
|
||||
</DxTabs>
|
||||
|
||||
</DetailRowTemplate>
|
||||
</CompanyGrid>
|
||||
</DxTabPage>
|
||||
</DxTabs>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -90,10 +106,14 @@
|
|||
|
||||
|
||||
@code {
|
||||
|
||||
AccordionExpandMode ExpandMode { get; set; } = AccordionExpandMode.SingleOrNone;
|
||||
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
||||
private LoggerClient<MyServiceProviders> _logger = null!;
|
||||
|
||||
private CompanyGrid _gridCompany = null!;
|
||||
|
||||
private List<Company> companies = [];
|
||||
public List<Company> Companies = [];
|
||||
public ServiceProviderWizardModel MyModel = new ServiceProviderWizardModel();
|
||||
|
||||
bool EulaAccepted { get; set; }
|
||||
|
|
@ -136,23 +156,58 @@
|
|||
}
|
||||
}
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
_logger = new LoggerClient<MyServiceProviders>(LogWriters.ToArray());
|
||||
|
||||
var myId = SessionService.User!.UserId;
|
||||
|
||||
_logger.Debug(companies.Count().ToString());
|
||||
_contextIds = new Guid[1];
|
||||
_contextIds[0] = myId;
|
||||
var result = await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesByContextId, myId);
|
||||
//await AdminSignalRClient.GetAllIntoAsync<Company>(Companies, SignalRTags.GetCompaniesByContextId, new object[] { myId });
|
||||
companies = result;
|
||||
// ServiceProviderDataService.GetPropertiesByOwnerIdAsync(myId, companyPropertiesByOwner =>
|
||||
// {
|
||||
// _logger.DetailConditional($"companyPropertiesByOwner count: {companyPropertiesByOwner?.Count.ToString() ?? "NULL"}");
|
||||
// }).Forget();
|
||||
|
||||
return base.OnInitializedAsync();
|
||||
|
||||
}
|
||||
|
||||
void ColumnChooserButton_Click()
|
||||
{
|
||||
_gridCompany.ShowColumnChooser();
|
||||
}
|
||||
|
||||
string GetCustomColor(ProductType productType)
|
||||
{
|
||||
|
||||
var transferStatusByte = (byte)productType;
|
||||
|
||||
switch (transferStatusByte)
|
||||
{
|
||||
case 5:
|
||||
return "bg-important";
|
||||
|
||||
case > 5 and < 35:
|
||||
return "bg-attention";
|
||||
|
||||
case 35:
|
||||
return "bg-finished";
|
||||
|
||||
case > 35:
|
||||
return "bg-cancel";
|
||||
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void RefreshComponent()
|
||||
{
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject AdminSignalRClient AdminSignalRClient;
|
||||
@inject IJSRuntime JsRuntime;
|
||||
|
||||
|
||||
<ProductDetailGrid @ref="_productGrid"
|
||||
|
|
@ -41,67 +42,61 @@
|
|||
<Columns>
|
||||
<DxGridCommandColumn NewButtonVisible="true" Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N"/>
|
||||
|
||||
<DxGridDataColumn FieldName="@nameof(Product.ServiceProvider.Name)" Caption="Company name" />
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductName) FieldName="Name" SortIndex="0"/>
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductType) FieldName="ProductType" Width="130" />
|
||||
<DxGridDataColumn FieldName="Id" Visible="@ShowManageButtons" Width="180">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
Product product = (Product)context.DataItem;
|
||||
if (product.ProductType == TIAM.Core.Enums.ProductType.Hotel)
|
||||
{
|
||||
<a class="btn btn-primary" href="user/hoteladmin/@context.Value">Manage hotel</a>
|
||||
}
|
||||
else if (product.ProductType == TIAM.Core.Enums.ProductType.Transfer)
|
||||
{
|
||||
<a class="btn btn-primary" href="user/transferadmin/@context.Value">Manage transfer service </a>
|
||||
}
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.Price) FieldName="Price" Width="100" />
|
||||
<DxGridDataColumn Caption="ReferralLink" FieldName="Id" Width="100" >
|
||||
<CellDisplayTemplate>
|
||||
@*
|
||||
/public/transfer/{referralId:guid}/{productId:guid}
|
||||
*@
|
||||
@{
|
||||
Product product = (Product)context.DataItem;
|
||||
|
||||
<p>@Setting.BaseUrl/public/transfer/@product.ServiceProvider.AffiliateId/@product.Id</p>
|
||||
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn Caption="Options">
|
||||
|
||||
<DxGridDataColumn Caption="Options" TextAlignment="GridTextAlignment.Center">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
//check if has transferdestination
|
||||
var AddressId = ((Product)context.DataItem).Profile.AddressId;
|
||||
var result = CheckDestinations(AddressId);
|
||||
//if not, display button
|
||||
|
||||
Product product = (Product)context.DataItem;
|
||||
var _url = $"{Setting.BaseUrl}/public/transfer/{product.ServiceProvider.AffiliateId}/{product.Id}";
|
||||
|
||||
<DxButton Context="ButtonContext" CssClass="btn-primary" Click="() => CopyUrl(_url)">Copy referral url</DxButton>
|
||||
|
||||
if (!result)
|
||||
{
|
||||
// <p>Address:</p>
|
||||
// <p>@(((Product)context.DataItem).Profile.Address.AddressText)</p>
|
||||
<DxButton Click="() => SaveAsDestination(((Product)context.DataItem).Profile.Address, (Product)context.DataItem)" Text="Save as destination" RenderStyle="ButtonRenderStyle.Primary" />
|
||||
}
|
||||
else
|
||||
// else
|
||||
// {
|
||||
// <p>Address: @(((Product)context.DataItem).Profile.Address.AddressText)</p>
|
||||
// }
|
||||
|
||||
if (product.ProductType == TIAM.Core.Enums.ProductType.Hotel)
|
||||
{
|
||||
<p>Address:</p>
|
||||
<p>@(((Product)context.DataItem).Profile.Address.AddressText)</p>
|
||||
<a class="btn-primary" href="user/hoteladmin/@product.Id"><i class="fa-solid fa-pen-to-square"></i></a>
|
||||
}
|
||||
else if (product.ProductType == TIAM.Core.Enums.ProductType.Transfer)
|
||||
{
|
||||
<a class="btn btn-primary" href="user/transferadmin/@product.Id"><i class="fa-solid fa-pen-to-square"></i></a>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductDescription) FieldName="Description" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Created" Visible="false" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" Visible="false" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
|
||||
@{
|
||||
Product product = (Product)context.DataItem;
|
||||
var _url = $"{Setting.BaseUrl}/public/transfer/{product.ServiceProvider.AffiliateId}/{product.Id}";
|
||||
<h4>Referral link</h4>
|
||||
<a href="@_url">@_url</a>
|
||||
<br/>
|
||||
<DxButton Context="ButtonContext" CssClass="btn btn-primary" Click="() => CopyUrl(_url)">Copy URL</DxButton>
|
||||
}
|
||||
<DxTabs>
|
||||
<DxTabPage Text="Permissions">
|
||||
<UserProductMappingGridComponent DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Never" ContextIds="new [] {((Product)context.DataItem).Id}" GetAllTag="SignalRTags.GetUserProductMappingsByProductId">
|
||||
|
|
@ -139,6 +134,16 @@
|
|||
|
||||
</ProductDetailGrid>
|
||||
|
||||
<script>
|
||||
function copyToClipboard(text) {
|
||||
navigator.clipboard.writeText(text).then(function () {
|
||||
console.log('Copied to clipboard successfully!');
|
||||
}, function (err) {
|
||||
alert('Could not copy text: '+ err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid? ContextId { get; set; }
|
||||
[Parameter] public IProductsRelation? ParentData { get; set; } = null!;
|
||||
|
|
@ -150,7 +155,14 @@
|
|||
private List<TransferDestination> destinations = [];
|
||||
|
||||
private ProductDetailGrid _productGrid = null!;
|
||||
private LoggerClient<ProductDetailGridComponent> _logger = null!;
|
||||
private LoggerClient<ProductDetailGridComponent> _logger = null!;
|
||||
|
||||
private async Task CopyUrl(string url)
|
||||
{
|
||||
|
||||
await JsRuntime.InvokeVoidAsync("copyToClipboard", url);
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_logger = new LoggerClient<ProductDetailGridComponent>(LogWriters.ToArray());
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
||||
|
|
@ -78,6 +79,9 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="Pages\User\CardComponents\CompanyCardComponent.razor">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
<Content Update="Pages\User\Drivers\DriverManageCars.razor">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
|
|
@ -88,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>
|
||||
|
|
|
|||
|
|
@ -273,6 +273,9 @@ select {
|
|||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist {
|
||||
background-color: aliceblue;
|
||||
}
|
||||
/*my blazor overrides end*/
|
||||
.custom-select {
|
||||
padding: 10px 15px 10px 10px !important;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ using TIAM.Services;
|
|||
using TIAM.Entities.Products;
|
||||
using TIAM.Models.Dtos.Products;
|
||||
using TIAM.Models.Dtos.Users;
|
||||
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||
|
||||
namespace TIAMWebApp.Server.Controllers
|
||||
{
|
||||
|
|
@ -523,5 +524,37 @@ namespace TIAMWebApp.Server.Controllers
|
|||
return Ok(sigBase64);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[Route(APIUrls.GetQrCodeByProductIdAndOwnerAffiliateIdRouteName)]
|
||||
public async Task<IActionResult> GetQrCodeByProductIdAndOwnerAffiliateId([FromBody] Guid[] Ids)
|
||||
{
|
||||
_logger.Info(@"GetQRCode called");
|
||||
|
||||
if (Ids[0].IsNullOrEmpty() || Ids[1].IsNullOrEmpty())
|
||||
{
|
||||
return BadRequest("Product is required");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var qrGenerator = new QRCodeGenerator();
|
||||
var qrCodeData = qrGenerator.CreateQrCode($"{Setting.BaseUrl}/public/transfer/{Ids[0]}/{Ids[1]}", QRCodeGenerator.ECCLevel.Q);
|
||||
var qrCode = new QRCode(qrCodeData);
|
||||
//Bitmap qrCodeImage = qrCode.GetGraphic(20);
|
||||
//var rootpath = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "assets");
|
||||
var rootpath = System.IO.Path.Combine(env.WebRootPath, "assets");
|
||||
var qrCodeImage = qrCode.GetGraphic(20, Color.DarkMagenta, Color.White, (Bitmap)Bitmap.FromFile(rootpath + "/myimage.png"));
|
||||
_logger.Info($@"qrCodeLogo: {rootpath}/myimage.png");
|
||||
var ms = new MemoryStream();
|
||||
qrCodeImage.Save(ms, ImageFormat.Jpeg);
|
||||
var byteImage = ms.ToArray();
|
||||
|
||||
var sigBase64 = Convert.ToBase64String(byteImage); // Get Base64
|
||||
|
||||
return Ok(sigBase64);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,6 +46,7 @@ namespace TIAMWebApp.Shared.Application.Interfaces
|
|||
|
||||
//25. (IServiceProviderDataService) Get QRCode by ProductId
|
||||
public Task<string> GetQRCodeByProductIdAsync(Guid productId);
|
||||
public Task<string> GetQRCodeByProductIdAndOwnerAffiliateIdAsync(Guid[] Ids);
|
||||
|
||||
public Task<IEnumerable<Product>> GetProductsForServiceProviderAsync(Guid serviceProviderId);
|
||||
|
||||
|
|
|
|||
|
|
@ -162,6 +162,9 @@ namespace TIAMWebApp.Shared.Application.Models
|
|||
public const string GetQrCodeByProductIdRouteName = "GetQRCodeByProductId";
|
||||
public const string GetQrCodeByProductId = ServiceProviderAPI + GetQrCodeByProductIdRouteName;
|
||||
|
||||
public const string GetQrCodeByProductIdAndOwnerAffiliateIdRouteName = "GetQrCodeByProductIdAndOwnerAffiliateId";
|
||||
public const string GetQrCodeByProductIdAndOwnerAffiliateId = ServiceProviderAPI + GetQrCodeByProductIdAndOwnerAffiliateIdRouteName;
|
||||
|
||||
public const string AddProductRouteName = "AddProduct";
|
||||
public const string AddProduct = ServiceProviderAPI + AddProductRouteName;
|
||||
|
||||
|
|
|
|||
|
|
@ -215,6 +215,23 @@ namespace TIAMWebApp.Shared.Application.Services
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetQRCodeByProductIdAndOwnerAffiliateIdAsync(Guid[] Ids)
|
||||
{
|
||||
|
||||
var url = APIUrls.GetQrCodeByProductIdAndOwnerAffiliateId;
|
||||
var response = await http.PostAsJsonAsync(url, Ids);
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Product>> GetProductsForServiceProviderAsync(Guid serviceProviderId)
|
||||
{
|
||||
var url = APIUrls.GetProductsByServiceProviderId;
|
||||
|
|
|
|||
|
|
@ -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