diff --git a/TIAMMobileApp/MauiProgram.cs b/TIAMMobileApp/MauiProgram.cs index e6d42c4e..00c8ccdb 100644 --- a/TIAMMobileApp/MauiProgram.cs +++ b/TIAMMobileApp/MauiProgram.cs @@ -72,6 +72,7 @@ namespace TIAMMobileApp builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); + builder.Services.AddSingleton(); builder.Services.AddAuthorizationCore(); builder.Services.Configure(Guid.NewGuid().ToString(), c => { }); return builder.Build(); diff --git a/TIAMSharedUI/Pages/Formula1.razor b/TIAMSharedUI/Pages/Formula1.razor index 714367ff..922047c8 100644 --- a/TIAMSharedUI/Pages/Formula1.razor +++ b/TIAMSharedUI/Pages/Formula1.razor @@ -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; diff --git a/TIAMSharedUI/Pages/Index.razor b/TIAMSharedUI/Pages/Index.razor index 11942d74..3be80c57 100644 --- a/TIAMSharedUI/Pages/Index.razor +++ b/TIAMSharedUI/Pages/Index.razor @@ -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; diff --git a/TIAMSharedUI/Pages/Login.razor b/TIAMSharedUI/Pages/Login.razor index 311c57cb..444195fe 100644 --- a/TIAMSharedUI/Pages/Login.razor +++ b/TIAMSharedUI/Pages/Login.razor @@ -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 Login @@ -23,7 +25,7 @@
- @localizer["LoginTitleText"] + @_localizer["LoginTitleText"]
@@ -49,7 +51,7 @@ {
-

@localizer["LoginEmail"]: @_loginModel.Email

+

@_localizer["LoginEmail"]: @_loginModel.Email

@_loginModel.Password

@@ -58,6 +60,9 @@
No account yet? Sign up here!
+
+ Forgot your password? Click here! +
diff --git a/TIAMSharedUI/Pages/Login.razor.cs b/TIAMSharedUI/Pages/Login.razor.cs index 281a2189..54d56f85 100644 --- a/TIAMSharedUI/Pages/Login.razor.cs +++ b/TIAMSharedUI/Pages/Login.razor.cs @@ -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 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 /// 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 CheckIfDriver(List Permissions) @@ -190,7 +187,7 @@ namespace TIAMSharedUI.Pages if (driverPermissionResult) { _isDriver = true; - sessionService.DriverPersmissionId = Permission.Id; + _sessionService.DriverPersmissionId = Permission.Id; } } return _isDriver; diff --git a/TIAMSharedUI/Pages/Register.razor b/TIAMSharedUI/Pages/Register.razor index 312b79d8..ec8af7cf 100644 --- a/TIAMSharedUI/Pages/Register.razor +++ b/TIAMSharedUI/Pages/Register.razor @@ -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 diff --git a/TIAMSharedUI/Pages/RenewPassword.razor b/TIAMSharedUI/Pages/RenewPassword.razor new file mode 100644 index 00000000..2514f85b --- /dev/null +++ b/TIAMSharedUI/Pages/RenewPassword.razor @@ -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 + +Login + +
+

Login

+

Good to see you again!

+
+ + +
+
+
+ +
+ +
+ +
+ @_localizer["LoginTitleText"] +
+ +
+ No account yet? Sign up here! +
+
+ Figured it out? Back to login! +
+
+
+
+
+
+ +

+ + 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. + +

+
+
+
+
+ +@code { + + [Parameter] public string renewToken { get; set; } + + private UserModelDto user; + protected override Task OnInitializedAsync() + { + return base.OnInitializedAsync(); + } +} diff --git a/TIAMSharedUI/Pages/User/Admin.razor b/TIAMSharedUI/Pages/User/Admin.razor index 22bc6105..d1492032 100644 --- a/TIAMSharedUI/Pages/User/Admin.razor +++ b/TIAMSharedUI/Pages/User/Admin.razor @@ -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 diff --git a/TIAMSharedUI/Pages/User/Admin.razor.cs b/TIAMSharedUI/Pages/User/Admin.razor.cs deleted file mode 100644 index c785adad..00000000 --- a/TIAMSharedUI/Pages/User/Admin.razor.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace TIAMSharedUI.Pages.User -{ - public partial class Home - { - } -} diff --git a/TIAMSharedUI/Pages/User/CardComponents/CompanyCardComponent.razor b/TIAMSharedUI/Pages/User/CardComponents/CompanyCardComponent.razor index 6ee719f1..7dd938c3 100644 --- a/TIAMSharedUI/Pages/User/CardComponents/CompanyCardComponent.razor +++ b/TIAMSharedUI/Pages/User/CardComponents/CompanyCardComponent.razor @@ -34,7 +34,7 @@

Information

@RenderDetailsItem("fa-solid fa-user", "Contact Name", companyProfile.FullName) - + @RenderDetailsItem("fa-solid fa-circle-info", "Description", companyProfile.Description)
diff --git a/TIAMSharedUI/Pages/User/CardComponents/ProductCardComponent.razor b/TIAMSharedUI/Pages/User/CardComponents/ProductCardComponent.razor index 36100689..586cc402 100644 --- a/TIAMSharedUI/Pages/User/CardComponents/ProductCardComponent.razor +++ b/TIAMSharedUI/Pages/User/CardComponents/ProductCardComponent.razor @@ -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;
@@ -41,34 +43,65 @@
-
+

Information

@RenderDetailsItem("fa-solid fa-user", "Contact Name", productProfile.FullName) - + @RenderDetailsItem("fa-solid fa-circle-info", "Description", Context.Description)
-
+

Affiliate information

@{ if (Context.ServiceProviderId != null) { var _url = $"{Setting.BaseUrl}/public/transfer/{Context.ServiceProvider.AffiliateId}/{Context.Id}"; +

Use this link to send it in an email to the client

@_url // Copy referral url } } + +
-
- Save -
+ +
+
+
+ @{ + if (Context.ProductType == TIAM.Core.Enums.ProductType.Hotel) + { + string url = $"user/hoteladmin/{Context.Id}"; + Manage + } + else if (Context.ProductType == TIAM.Core.Enums.ProductType.Transfer) + { + string url = $"user/transferadmin/{Context.Id}"; + Manage + } + } +
+
+ @{ + + if (!isAddressTransferDestination) + { + //

Address:

+ //

@(((Product)context.DataItem).Profile.Address.AddressText)

+ + } + } +
+
+
+

@msg

@@ -93,9 +126,10 @@ AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick; private Profile productProfile = new Profile(); - + private List 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>(SignalRTags.GetCompaniesById, Context.ServiceProviderId); + var ProductProfiles = await AdminSignalRClient.GetByIdAsync>(SignalRTags.GetProfileById, Context.ProfileId); + await AdminSignalRClient.GetAllIntoAsync(destinations, SignalRTags.GetAllTransferDestinations); if (productOwner != null) { ImageSource = await ServiceProviderDataService.GetQRCodeByProductIdAndOwnerAffiliateIdAsync(new Guid[] { productOwner[0].AffiliateId, Context.Id }); } - var ProductProfiles = await AdminSignalRClient.GetByIdAsync>(SignalRTags.GetProfileById, Context.ProfileId); if (ProductProfiles != null) { productProfile = ProductProfiles[0]; + var AddressId = productProfile.AddressId; + isAddressTransferDestination = CheckDestinations(AddressId); } + await base.OnInitializedAsync(); } @@ -154,8 +175,44 @@
; } - 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(SignalRTags.CreateTransferDestination, transferDestination); + await InvokeAsync(StateHasChanged); } } diff --git a/TIAMSharedUI/Pages/User/CardComponents/UserCardComponent.razor b/TIAMSharedUI/Pages/User/CardComponents/UserCardComponent.razor index 51822316..bb83c270 100644 --- a/TIAMSharedUI/Pages/User/CardComponents/UserCardComponent.razor +++ b/TIAMSharedUI/Pages/User/CardComponents/UserCardComponent.razor @@ -33,7 +33,7 @@
-