From 57feb0d60963df1f8d73dec6784253afd022e63c Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 27 Aug 2024 08:46:15 +0200 Subject: [PATCH 1/3] css and --- TIAMSharedUI/Shared/Components/Navbar.razor | 2 +- TIAMSharedUI/wwwroot/css/TourIAm.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TIAMSharedUI/Shared/Components/Navbar.razor b/TIAMSharedUI/Shared/Components/Navbar.razor index f106075b..4ba4f298 100644 --- a/TIAMSharedUI/Shared/Components/Navbar.razor +++ b/TIAMSharedUI/Shared/Components/Navbar.razor @@ -80,7 +80,7 @@ @{ string url3 = $"user/messages/{userId}"; - @(" (" + SiteViewModel.UnreadMessagesCount + ")") + @(" (" + SiteViewModel.UnreadMessagesCount + ")") } diff --git a/TIAMSharedUI/wwwroot/css/TourIAm.css b/TIAMSharedUI/wwwroot/css/TourIAm.css index 04a0cf3a..c912e8f2 100644 --- a/TIAMSharedUI/wwwroot/css/TourIAm.css +++ b/TIAMSharedUI/wwwroot/css/TourIAm.css @@ -287,7 +287,7 @@ select { } .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist { - background-color: aliceblue; + background-color: lightgray; } /*my blazor overrides end*/ .custom-select { From 95845f428e3c8813a4f09441f0b4f654cdd73501 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 27 Aug 2024 13:50:41 +0200 Subject: [PATCH 2/3] navbar driver fix --- TIAMSharedUI/Shared/Components/Navbar.razor | 4 ++-- TIAMSharedUI/Shared/Components/Navbar.razor.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/TIAMSharedUI/Shared/Components/Navbar.razor b/TIAMSharedUI/Shared/Components/Navbar.razor index eb6bc0a6..4d45ea2d 100644 --- a/TIAMSharedUI/Shared/Components/Navbar.razor +++ b/TIAMSharedUI/Shared/Components/Navbar.razor @@ -80,7 +80,7 @@ @{ string url3 = $"user/messages/{userId}"; - @(" (" + sessionService.SiteViewModel.UnreadMessagesCount + ")") + @(" (" + sessionService.SiteViewModel.UnreadMessagesCount + ")") } @@ -119,7 +119,7 @@ - @if (hasProperty || isSysAdmin || isDevAdmin) + @if (hasProperty || isSysAdmin || isDevAdmin || isDriver) {
  • Comfortable Vehicles: Clean, modern, and well-maintained cars.
  • - +
    @@ -74,15 +218,15 @@
    -
    +

    How to Book

    Booking your airport transfer is easy! Simply visit our booking page, enter your details, and confirm your reservation. You can also contact us at info@touriam.com or call us at (123) 456-7890 for assistance.

    Experience the convenience and reliability of Tour I Am. Book your airport transfer today and travel with peace of mind!

    -
    - +
    + @@ -115,7 +259,7 @@ new HeroSliderItem { "Id", "Destination", - "UserId", + "UserId", "ProductId", "PaymentId", "TripDate", @@ -125,7 +269,7 @@ new HeroSliderItem "UserProductToCarId", "ReferralId", "Price" - }; + }; public List TransferIgnorList2 = new List { @@ -150,6 +294,8 @@ new HeroSliderItem private bool toAirport = true; + private bool displayHelp = false; + public void ToAirport() { toAirport = true; @@ -172,14 +318,14 @@ new HeroSliderItem resModel.UserId = user.Id; //user exists already - if(_sessionService.User != null) + if (_sessionService.User != null) { - if(_sessionService.User.UserId == user.Id) + if (_sessionService.User.UserId == user.Id) { //I have ordered for myself resModel.ReferralId = null; - } + } else { //if I am logged in and different user I become referrer (if no referrer already) @@ -196,9 +342,9 @@ new HeroSliderItem //user has no referrer so I am the referrer resModel.ReferralId = userDetail.UserDto.RefferalId; - } + } } - } + } } else { @@ -210,7 +356,7 @@ new HeroSliderItem registration.Email = resModel.EmailAddress; registration.PhoneNumber = resModel.PhoneNumber; registration.Password = password; - //get list with one member! + //get list with one member! var createResult = await UserDataService.CreateGuestUser(registration); if (createResult.isSuccess) @@ -218,24 +364,24 @@ new HeroSliderItem if (createResult.user != null) { if (_sessionService.User != null) - { + { //if I am logged in user I become referrer var userDetail = await UserDataService.GetUserDetailByIdAsync(_sessionService.User.UserId); var createdUserDetail = await UserDataService.GetUserDetailByIdAsync(createResult.user.Id); - if(createdUserDetail != null) + if (createdUserDetail != null) { createdUserDetail.UserDto.RefferalId = userDetail.UserDto.RefferalId; var updatedNewUser = await _adminSignalRClient.PostDataAsync(SignalRTags.UpdateUserModelDtoDetail, userDetail); if (updatedNewUser != null) { //referral set - } + } else { //something wrong } } - resModel.ReferralId = userDetail.UserDto.RefferalId; + resModel.ReferralId = userDetail.UserDto.RefferalId; } resModel.UserId = createResult.user.Id; @@ -245,7 +391,7 @@ new HeroSliderItem { //some error handling } - } + } } var transfer = await WizardProcessor.ProcessWizardAsync(Result.GetType(), Result); BrowserConsoleLogWriter.Info($"Submitted nested form: {Result.GetType().FullName}"); @@ -258,5 +404,10 @@ new HeroSliderItem return base.OnInitializedAsync(); } + private void ShowHelp_Click() + { + displayHelp = !displayHelp; + } + } diff --git a/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor b/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor index d1a2e006..7a436f9e 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/ProductDetailGridComponent.razor @@ -134,15 +134,6 @@ - @code { [Parameter] public Guid? ContextId { get; set; } diff --git a/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor b/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor index 48315e8b..c17c9960 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/ProductGridComponent.razor @@ -1,4 +1,5 @@ -@using TIAM.Entities.Products +@using AyCode.Core.Helpers +@using TIAM.Entities.Products @using TIAM.Entities.ServiceProviders @using TIAM.Entities.Transfers @using TIAM.Entities.Drivers @@ -20,6 +21,7 @@ @inject IStringLocalizer Localizer @inject IEnumerable LogWriters @inject AdminSignalRClient AdminSignalRClient; +@inject IJSRuntime JsRuntime; + + + @{ + //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}"; + + Copy referral url + + if (!result) + { + //

    Address:

    + //

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

    + + } + // else + // { + //

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

    + // } + + if (product.ProductType == TIAM.Core.Enums.ProductType.Hotel) + { + + } + else if (product.ProductType == TIAM.Core.Enums.ProductType.Transfer) + { + + } + + } + +
    +
    + + + @@ -95,16 +137,71 @@
    + + @code { [Parameter] public EventCallback OnGridEditModelSaving { get; set; } [Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never; + private List destinations = []; + private ProductGrid _productGrid = null!; private LoggerClient _logger = null!; + + + private async Task CopyUrl(string url) + { + + await JsRuntime.InvokeVoidAsync("copyToClipboard", url); + } + protected override void OnInitialized() { _logger = new LoggerClient(LogWriters.ToArray()); + AdminSignalRClient.GetAllIntoAsync(destinations, SignalRTags.GetAllTransferDestinations).Forget(); + } + + 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(SignalRTags.CreateTransferDestination, transferDestination); + _productGrid.Reload(); + await InvokeAsync(StateHasChanged); } protected override async Task OnParametersSetAsync() diff --git a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor index fe7cc083..2237f928 100644 --- a/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor +++ b/TIAMSharedUI/Pages/User/SysAdmins/TransferDestinationGridComponent.razor @@ -64,30 +64,31 @@ var transfer = (TransferDestination)editFormContext.EditModel; } - + @editFormContext.GetEditor("Name") - - @editFormContext.GetEditor("Description") - - + + @editFormContext.GetEditor("AddressString") - + @editFormContext.GetEditor("Price") - + @editFormContext.GetEditor("Price2") - + @editFormContext.GetEditor("Price3") - + @editFormContext.GetEditor("ProductCommis") - + @editFormContext.GetEditor("ExtraPrice") + + @editFormContext.GetEditor("Description") + diff --git a/TIAMSharedUI/Shared/Users/AdminNavMenu.razor b/TIAMSharedUI/Shared/Users/AdminNavMenu.razor index 6c23d578..3079ac10 100644 --- a/TIAMSharedUI/Shared/Users/AdminNavMenu.razor +++ b/TIAMSharedUI/Shared/Users/AdminNavMenu.razor @@ -15,7 +15,7 @@
    - @@ -28,12 +28,7 @@ string url3 = $"user/messages/{userId}"; - @* - - - *@ + @if (IsSysAdmin) { - - @{ - if (userHasCompany) - { - - } - if (userHasHotels) - { - - } - } + + + + + + + @* *@ - - @@ -164,12 +153,12 @@ private bool expandHotelAdminNav = false; private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; + private bool userHasCompany; + private bool userHasHotels; + private bool IsDriver; private bool IsDevAdmin; private bool IsSysAdmin; - private bool IsDriver; - private bool userHasCompany = false; - private bool userHasHotels = false; private string? userEmail; private string? userFullName; private Guid? userId; @@ -193,18 +182,6 @@ { _isMobile = await jsRuntime.InvokeAsync("isDevice"); _logger = new LoggerClient(LogWriters.ToArray()); - //_logger.Debug($"UserId: {SessionService.User.UserModelDto.Id}"); //errorokat dobott - IsDevAdmin = SessionService.IsDevAdmin; - //_logger.Debug($"UserId: {SessionService.IsDevAdmin}"); - IsSysAdmin = SessionService.IsSysAdmin; - //_logger.Debug($"UserId: {SessionService.IsSysAdmin}"); - IsDriver = SessionService.IsDriver; - //_logger.Debug($"UserId: {SessionService.IsDriver}"); - userHasCompany = SessionService.HasCompany; - if (SessionService.GetHotels().Count() > 0) - { - userHasHotels = true; - } if (SessionService.User != null) { @@ -216,6 +193,19 @@ userFullName = SessionService.User.UserModelDto.ProfileDto.FullName; } } + //_logger.Debug($"UserId: {SessionService.User.UserModelDto.Id}"); //errorokat dobott + userHasCompany = SessionService.HasCompany; + if (SessionService.GetHotels().Count() > 0) + { + userHasHotels = true; + } + IsDriver = SessionService.IsDriver; + //_logger.Debug($"UserId: {SessionService.IsDriver}"); + + IsDevAdmin = SessionService.IsDevAdmin; + //_logger.Debug($"UserId: {SessionService.IsDevAdmin}"); + IsSysAdmin = SessionService.IsSysAdmin; + //_logger.Debug($"UserId: {SessionService.IsSysAdmin}"); await base.OnInitializedAsync(); } diff --git a/TIAMWebApp/Client/wwwroot/index.html b/TIAMWebApp/Client/wwwroot/index.html index e2ead78a..abf2ad23 100644 --- a/TIAMWebApp/Client/wwwroot/index.html +++ b/TIAMWebApp/Client/wwwroot/index.html @@ -41,6 +41,15 @@ return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent); } +