This commit is contained in:
Loretta 2024-08-29 18:01:36 +02:00
commit eeeea7b037
10 changed files with 334 additions and 84 deletions

View File

@ -40,6 +40,15 @@
return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent); return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent);
} }
</script> </script>
<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>
</head> </head>
<body> <body>

View File

@ -24,8 +24,150 @@
<HeroSlider SliderItems="sliders" Height="30vh"></HeroSlider> <HeroSlider SliderItems="sliders" Height="30vh"></HeroSlider>
<div class="container-fluid" style="position: relative; z-index: 2;"> <div class="container-fluid" style="position: relative; z-index: 2;">
<div class="row d-flex justify-content-center"> <div class="row d-flex justify-content-center">
<div class="col-12 col-lg-6">
@{
if (displayHelp)
{
<div class="col-md-6 col-12 px-5">
<!-- Step 1 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 1: Choose Your Transfer Direction
</p>
<p class="text-muted">At the top of the form, select whether you need a transfer <strong>"To the Airport"</strong> or <strong>"From the Airport"</strong> by clicking on the corresponding tab.</p>
</div>
</div>
<!-- Step 2 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 2: Enter the Destination (or Pickup) Address
</p>
<p class="text-muted">In the <strong>PickupAddress</strong> section, select your address:</p>
<ul>
<li><strong>Preset addresses:</strong> Click on the dropdown menu under “Preset addresses” and choose an address from the list. For example, you may see options like "Széchenyi fürdő."</li>
<li><strong>Custom address:</strong> If your address is not listed, click on the "Custom address" tab to manually enter your address.</li>
</ul>
</div>
</div>
<!-- Step 3 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 3: Confirm the Destination
</p>
<p class="text-muted">Once you select or enter the address, the form will display it as the "Selected address." Make sure this is correct before proceeding.</p>
</div>
</div>
<!-- Step 4 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 4: Enter Flight Information (Optional)
</p>
<p class="text-muted">If applicable, fill in your <strong>FlightNumber</strong>. This is optional, so you can leave it blank if you don't have or dont want to provide it.</p>
</div>
</div>
<!-- Step 5 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 5: Specify the Number of Passengers
</p>
<p>In the <strong>NumberOfPassengers</strong> field, enter the number of people who will be traveling. The default is set to 1, but you can change it as needed.</p>
</div>
</div>
<!-- Step 6 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 6: Indicate the Amount of Luggage
</p>
<p class="text-muted">In the <strong>NumberOfLuggage</strong> field, enter the total number of luggage items you will be bringing.</p>
</div>
</div>
<!-- Step 7 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 7: Fill in Your Personal Information
</p>
<p class="text-muted">Under <strong>FullName</strong>, enter your first and last name in the respective fields. Provide your <strong>PhoneNumber</strong> in the designated field. The phone number appears to be pre-filled with a sample number ("+11234567890"), so be sure to update it with your actual contact number. Enter your <strong>EmailAddress</strong> to receive confirmation and any further communication regarding your transfer.</p>
</div>
</div>
<!-- Step 8 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 8: Add Additional Comments (Optional)
</p>
<p class="text-muted">If you have any special requests or additional information youd like to provide, use the <strong>Comment</strong> section to do so.</p>
</div>
</div>
<!-- Step 9 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 9: Submit Your Request
</p>
<p>Once all fields are filled in correctly, click the <strong>Submit</strong> button at the bottom of the form to place your transfer order.</p>
</div>
</div>
<!-- Step 10 -->
<div class="card mb-3 shadow-sm">
<div class="card-body">
<p>
Step 10: Confirmation
</p>
<p>After submitting, you should receive a confirmation email or message. Ensure all the details are correct, and youre all set!</p>
</div>
</div>
</div>
}
}
<div class="col-12 col-md-6">
<DxToolbar ItemRenderStyleMode="ToolbarRenderStyleMode.Contained">
<Items>
<DxToolbarItem Alignment="ToolbarItemAlignment.Right" Text="Help" RenderStyle="ButtonRenderStyle.Secondary" IconCssClass="grid-icon-column-chooser" Click="ShowHelp_Click" />
</Items>
</DxToolbar>
<DxTabs> <DxTabs>
<DxTabPage TabIconCssClass="fa-solid fa-plane-departure" Click="ToAirport" Text="To the Airport"> <DxTabPage TabIconCssClass="fa-solid fa-plane-departure" Click="ToAirport" Text="To the Airport">
<DynamicEditForm Data="myModel" TitleString="@($"To: {myModel.Destination}")" isEditing="true" IgnoreReflection="TransferIgnorList1" OnSubmit="SubmitForm"></DynamicEditForm> <DynamicEditForm Data="myModel" TitleString="@($"To: {myModel.Destination}")" isEditing="true" IgnoreReflection="TransferIgnorList1" OnSubmit="SubmitForm"></DynamicEditForm>
@ -37,19 +179,21 @@
</DxTabPage> </DxTabPage>
</DxTabs> </DxTabs>
@* <InputWizard Data=@myModel @* <InputWizard Data=@myModel
OnSubmit="SubmitForm" OnSubmit="SubmitForm"
IgnoreReflection="@TransferIgnorList" IgnoreReflection="@TransferIgnorList"
SubmitButtonText="ButtonSend" SubmitButtonText="ButtonSend"
TitleResourceString="TransferTitle" TitleResourceString="TransferTitle"
SubtitleResourceString="TransferSubtitle"></InputWizard> *@ SubtitleResourceString="TransferSubtitle"></InputWizard> *@
</div>
</div>
</div> </div>
</div> </div>
<div class="container mt-5"> <div class="container mt-5">
@ -66,7 +210,7 @@
<li><strong>Comfortable Vehicles:</strong> Clean, modern, and well-maintained cars.</li> <li><strong>Comfortable Vehicles:</strong> Clean, modern, and well-maintained cars.</li>
</ul> </ul>
</div> </div>
<div class="col-12 col-sm-6 p-5"> <div class="col-12 col-sm-6 p-5">
<img class="img-fluid" src="_content/TIAMSharedUI/images/about1.jpg" /> <img class="img-fluid" src="_content/TIAMSharedUI/images/about1.jpg" />
@ -74,15 +218,15 @@
<div class="col-12 col-sm-6 p-5"> <div class="col-12 col-sm-6 p-5">
<img class="img-fluid" src="_content/TIAMSharedUI/images/about2.jpg" /> <img class="img-fluid" src="_content/TIAMSharedUI/images/about2.jpg" />
</div> </div>
<div class="col-12 col-sm-6 p-5"> <div class="col-12 col-sm-6 p-5">
<h2>How to Book</h2> <h2>How to Book</h2>
<p>Booking your airport transfer is easy! Simply visit our <a href="/transfer">booking page</a>, enter your details, and confirm your reservation. You can also contact us at <a href="mailto:info@touriam.com">info@touriam.com</a> or call us at (123) 456-7890 for assistance.</p> <p>Booking your airport transfer is easy! Simply visit our <a href="/transfer">booking page</a>, enter your details, and confirm your reservation. You can also contact us at <a href="mailto:info@touriam.com">info@touriam.com</a> or call us at (123) 456-7890 for assistance.</p>
<p>Experience the convenience and reliability of Tour I Am. Book your airport transfer today and travel with peace of mind!</p> <p>Experience the convenience and reliability of Tour I Am. Book your airport transfer today and travel with peace of mind!</p>
</div> </div>
</div> </div>
</div> </div>
@ -115,7 +259,7 @@ new HeroSliderItem
{ {
"Id", "Id",
"Destination", "Destination",
"UserId", "UserId",
"ProductId", "ProductId",
"PaymentId", "PaymentId",
"TripDate", "TripDate",
@ -125,7 +269,7 @@ new HeroSliderItem
"UserProductToCarId", "UserProductToCarId",
"ReferralId", "ReferralId",
"Price" "Price"
}; };
public List<string> TransferIgnorList2 = new List<string> public List<string> TransferIgnorList2 = new List<string>
{ {
@ -150,6 +294,8 @@ new HeroSliderItem
private bool toAirport = true; private bool toAirport = true;
private bool displayHelp = false;
public void ToAirport() public void ToAirport()
{ {
toAirport = true; toAirport = true;
@ -172,14 +318,14 @@ new HeroSliderItem
resModel.UserId = user.Id; resModel.UserId = user.Id;
//user exists already //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 //I have ordered for myself
resModel.ReferralId = null; resModel.ReferralId = null;
} }
else else
{ {
//if I am logged in and different user I become referrer (if no referrer already) //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 //user has no referrer so I am the referrer
resModel.ReferralId = userDetail.UserDto.RefferalId; resModel.ReferralId = userDetail.UserDto.RefferalId;
} }
} }
} }
} }
else else
{ {
@ -210,7 +356,7 @@ new HeroSliderItem
registration.Email = resModel.EmailAddress; registration.Email = resModel.EmailAddress;
registration.PhoneNumber = resModel.PhoneNumber; registration.PhoneNumber = resModel.PhoneNumber;
registration.Password = password; registration.Password = password;
//get list with one member! //get list with one member!
var createResult = await UserDataService.CreateGuestUser(registration); var createResult = await UserDataService.CreateGuestUser(registration);
if (createResult.isSuccess) if (createResult.isSuccess)
@ -218,24 +364,24 @@ new HeroSliderItem
if (createResult.user != null) if (createResult.user != null)
{ {
if (_sessionService.User != null) if (_sessionService.User != null)
{ {
//if I am logged in user I become referrer //if I am logged in user I become referrer
var userDetail = await UserDataService.GetUserDetailByIdAsync(_sessionService.User.UserId); var userDetail = await UserDataService.GetUserDetailByIdAsync(_sessionService.User.UserId);
var createdUserDetail = await UserDataService.GetUserDetailByIdAsync(createResult.user.Id); var createdUserDetail = await UserDataService.GetUserDetailByIdAsync(createResult.user.Id);
if(createdUserDetail != null) if (createdUserDetail != null)
{ {
createdUserDetail.UserDto.RefferalId = userDetail.UserDto.RefferalId; createdUserDetail.UserDto.RefferalId = userDetail.UserDto.RefferalId;
var updatedNewUser = await _adminSignalRClient.PostDataAsync<UserModelDtoDetail>(SignalRTags.UpdateUserModelDtoDetail, userDetail); var updatedNewUser = await _adminSignalRClient.PostDataAsync<UserModelDtoDetail>(SignalRTags.UpdateUserModelDtoDetail, userDetail);
if (updatedNewUser != null) if (updatedNewUser != null)
{ {
//referral set //referral set
} }
else else
{ {
//something wrong //something wrong
} }
} }
resModel.ReferralId = userDetail.UserDto.RefferalId; resModel.ReferralId = userDetail.UserDto.RefferalId;
} }
resModel.UserId = createResult.user.Id; resModel.UserId = createResult.user.Id;
@ -245,7 +391,7 @@ new HeroSliderItem
{ {
//some error handling //some error handling
} }
} }
} }
var transfer = await WizardProcessor.ProcessWizardAsync<TransferWizardModel>(Result.GetType(), Result); var transfer = await WizardProcessor.ProcessWizardAsync<TransferWizardModel>(Result.GetType(), Result);
BrowserConsoleLogWriter.Info($"Submitted nested form: {Result.GetType().FullName}"); BrowserConsoleLogWriter.Info($"Submitted nested form: {Result.GetType().FullName}");
@ -258,5 +404,10 @@ new HeroSliderItem
return base.OnInitializedAsync(); return base.OnInitializedAsync();
} }
private void ShowHelp_Click()
{
displayHelp = !displayHelp;
}
} }

View File

@ -134,15 +134,6 @@
</ProductDetailGrid> </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 { @code {
[Parameter] public Guid? ContextId { get; set; } [Parameter] public Guid? ContextId { get; set; }

View File

@ -1,4 +1,5 @@
@using TIAM.Entities.Products @using AyCode.Core.Helpers
@using TIAM.Entities.Products
@using TIAM.Entities.ServiceProviders @using TIAM.Entities.ServiceProviders
@using TIAM.Entities.Transfers @using TIAM.Entities.Transfers
@using TIAM.Entities.Drivers @using TIAM.Entities.Drivers
@ -20,6 +21,7 @@
@inject IStringLocalizer<TIAMResources> Localizer @inject IStringLocalizer<TIAMResources> Localizer
@inject IEnumerable<IAcLogWriterClientBase> LogWriters @inject IEnumerable<IAcLogWriterClientBase> LogWriters
@inject AdminSignalRClient AdminSignalRClient; @inject AdminSignalRClient AdminSignalRClient;
@inject IJSRuntime JsRuntime;
<ProductGrid @ref="_productGrid" <ProductGrid @ref="_productGrid"
@ -55,12 +57,52 @@
</DxGridDataColumn> </DxGridDataColumn>
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductType) FieldName="ProductType" Width="130" /> <DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductType) FieldName="ProductType" Width="130" />
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.Price) FieldName="Price" Width="100" /> <DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.Price) FieldName="Price" Width="100" />
<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
// {
// <p>Address: @(((Product)context.DataItem).Profile.Address.AddressText)</p>
// }
if (product.ProductType == TIAM.Core.Enums.ProductType.Hotel)
{
<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 Caption=@Localizer.GetString(ResourceKeys.ProductDescription) FieldName="Description" />
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" /> <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="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
</Columns> </Columns>
<DetailRowTemplate> <DetailRowTemplate>
<DxTabs> <DxTabs>
<DxTabPage Text="Address">
<AddressDetailGridComponent ParentData="((Product)context.DataItem).Profile" />
</DxTabPage>
<DxTabPage Text="Prices"> <DxTabPage Text="Prices">
<TransferDestinationToProductDetailGridComponent IsProductIdReadonly="true" GetAllTag="SignalRTags.GetTransferDestinationToProductsByProductId" ContextIds="new [] {((Product)context.DataItem).Id}" /> <TransferDestinationToProductDetailGridComponent IsProductIdReadonly="true" GetAllTag="SignalRTags.GetTransferDestinationToProductsByProductId" ContextIds="new [] {((Product)context.DataItem).Id}" />
</DxTabPage> </DxTabPage>
@ -95,16 +137,71 @@
</ProductGrid> </ProductGrid>
@code { @code {
[Parameter] public EventCallback<GridEditModelSavingEventArgs> OnGridEditModelSaving { get; set; } [Parameter] public EventCallback<GridEditModelSavingEventArgs> OnGridEditModelSaving { get; set; }
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never; [Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
private List<TransferDestination> destinations = [];
private ProductGrid _productGrid = null!; private ProductGrid _productGrid = null!;
private LoggerClient<ProductGridComponent> _logger = null!; private LoggerClient<ProductGridComponent> _logger = null!;
private async Task CopyUrl(string url)
{
await JsRuntime.InvokeVoidAsync("copyToClipboard", url);
}
protected override void OnInitialized() protected override void OnInitialized()
{ {
_logger = new LoggerClient<ProductGridComponent>(LogWriters.ToArray()); _logger = new LoggerClient<ProductGridComponent>(LogWriters.ToArray());
AdminSignalRClient.GetAllIntoAsync<TransferDestination>(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<TransferDestination>(SignalRTags.CreateTransferDestination, transferDestination);
_productGrid.Reload();
await InvokeAsync(StateHasChanged);
} }
protected override async Task OnParametersSetAsync() protected override async Task OnParametersSetAsync()

View File

@ -64,30 +64,31 @@
var transfer = (TransferDestination)editFormContext.EditModel; var transfer = (TransferDestination)editFormContext.EditModel;
} }
<DxFormLayout CssClass="w-100"> <DxFormLayout CssClass="w-100">
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationName) ColSpanMd="6"> <DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationName) ColSpanXs="12" ColSpanMd="6">
@editFormContext.GetEditor("Name") @editFormContext.GetEditor("Name")
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationInfo) ColSpanMd="6">
@editFormContext.GetEditor("Description") <DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanXs="12" ColSpanMd="6">
</DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
@editFormContext.GetEditor("AddressString") @editFormContext.GetEditor("AddressString")
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6"> <DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanXs="12" ColSpanMd="3">
@editFormContext.GetEditor("Price") @editFormContext.GetEditor("Price")
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price2) ColSpanMd="6"> <DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price2) ColSpanXs="12" ColSpanMd="3">
@editFormContext.GetEditor("Price2") @editFormContext.GetEditor("Price2")
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price3) ColSpanMd="6"> <DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price3) ColSpanXs="12" ColSpanMd="3">
@editFormContext.GetEditor("Price3") @editFormContext.GetEditor("Price3")
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Commission) ColSpanMd="6"> <DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Commission) ColSpanXs="12" ColSpanMd="3">
@editFormContext.GetEditor("ProductCommis") @editFormContext.GetEditor("ProductCommis")
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6"> <DxFormLayoutItem Caption="Extra" ColSpanXs="12" ColSpanMd="6">
@editFormContext.GetEditor("ExtraPrice") @editFormContext.GetEditor("ExtraPrice")
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationInfo) ColSpanXs="12" ColSpanMd="6">
@editFormContext.GetEditor("Description")
</DxFormLayoutItem>
</DxFormLayout> </DxFormLayout>
</EditFormTemplate> </EditFormTemplate>

View File

@ -80,7 +80,7 @@
@{ @{
string url3 = $"user/messages/{userId}"; string url3 = $"user/messages/{userId}";
<NavLink class="nav-link" href="@url3"> <NavLink class="nav-link" href="@url3">
<i class="fa-solid fa-envelope">@(" (" + sessionService.SiteViewModel.UnreadMessagesCount + ")")</i> <i class="fa-solid fa-envelope"><sup>@(" (" + sessionService.SiteViewModel.UnreadMessagesCount + ")")</sup></i>
</NavLink> </NavLink>
} }
</li> </li>
@ -119,7 +119,7 @@
@if (hasProperty || isSysAdmin || isDevAdmin) @if (hasProperty || isSysAdmin || isDevAdmin || isDriver)
{ {
<li class="nav-item"> <li class="nav-item">
<NavLink class="nav-link" href="user/admin"> <NavLink class="nav-link" href="user/admin">

View File

@ -58,6 +58,7 @@ namespace TIAMSharedUI.Shared.Components
private bool hasProperty = false; private bool hasProperty = false;
private bool isSysAdmin = false; private bool isSysAdmin = false;
private bool isDevAdmin = false; private bool isDevAdmin = false;
private bool isDriver = false;
private Guid? userId = null; private Guid? userId = null;
private string userEmail = ""; private string userEmail = "";
private string userFullName = ""; private string userFullName = "";
@ -176,6 +177,7 @@ namespace TIAMSharedUI.Shared.Components
hasProperty = properties.Count > 0; hasProperty = properties.Count > 0;
isSysAdmin = sessionService.IsSysAdmin; isSysAdmin = sessionService.IsSysAdmin;
isDevAdmin = sessionService.IsDevAdmin; isDevAdmin = sessionService.IsDevAdmin;
isDriver = sessionService.IsDriver;
foreach (var property in properties) foreach (var property in properties)
{ {
_logger.Detail($"First property: {property.Value} "); _logger.Detail($"First property: {property.Value} ");

View File

@ -15,7 +15,7 @@
<div class="w-100" style="height:40px; position:fixed; z-index: 10000;"> <div class="w-100" style="height:40px; position:fixed; z-index: 10000;">
<DxMenu CssClass="my-menu" SizeMode="SizeMode.Medium" Title="Tour I Am" ItemsPosition="ItemPosition.End" CollapseItemsToHamburgerMenu="true" <DxMenu CssClass="my-menu" SizeMode="SizeMode.Medium" Title="Tour I Am" ItemsPosition="ItemPosition.End" CollapseItemsToHamburgerMenu="true"
Orientation="Orientation" Orientation="Orientation"
DisplayMode="DisplayMode" DisplayMode="DisplayMode"
HamburgerButtonPosition="MenuHamburgerButtonPosition.Right"> HamburgerButtonPosition="MenuHamburgerButtonPosition.Right">
@ -28,12 +28,7 @@
string url3 = $"user/messages/{userId}"; string url3 = $"user/messages/{userId}";
<DxToolbar SizeMode="SizeMode.Medium"> <DxToolbar SizeMode="SizeMode.Medium">
<Items> <Items>
@*<DxToolbarItem Name="Item1" Text="Item1" Tooltip="Item1" />
<DxToolbarItem Name="Item2" Text="Item2" Tooltip="Item2" />
<DxToolbarItem Name="Left" BeginGroup="true" IconCssClass="tb-icon tb-icon-align-left"
Tooltip="Align Left" />
<DxToolbarItem Name="Center" IconCssClass="tb-icon tb-icon-align-center"
Tooltip="Align Center" />*@
@if (IsSysAdmin) @if (IsSysAdmin)
{ {
<DxToolbarItem Name="Transfers" <DxToolbarItem Name="Transfers"
@ -66,20 +61,14 @@
} }
</TitleTemplate> </TitleTemplate>
<Items> <Items>
<DxMenuItem NavigateUrl="/" Text="Home" IconCssClass="menu-icon-home menu-icon" />
@{ <DxMenuItem NavigateUrl="/" Text="Home" IconCssClass="fa-solid fa-home" />
if (userHasCompany)
{ <DxMenuItem Visible="userHasCompany" NavigateUrl="user/properties" Text="My companies" IconCssClass="fa-solid fa-building" />
<DxMenuItem NavigateUrl="user/properties" Text="My companies" IconCssClass="fa-solid fa-building" />
} <DxMenuItem Visible="userHasHotels" NavigateUrl="user/createAndManageTransfer" IconCssClass="fa-solid fa-route" Text="Transfer" />
if (userHasHotels)
{
<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/media" Text="Media" IconCssClass="menu-icon-home menu-icon" /> *@
<DxMenuItem Text="Driver" Visible="@IsDriver" IconCssClass="fa-solid fa-id-card"> <DxMenuItem Text="Driver" Visible="@IsDriver" IconCssClass="fa-solid fa-id-card">
<Items> <Items>
<DxMenuItem NavigateUrl="driver/dashboard" Text="Dashboard" /> <DxMenuItem NavigateUrl="driver/dashboard" Text="Dashboard" />
@ -164,12 +153,12 @@
private bool expandHotelAdminNav = false; private bool expandHotelAdminNav = false;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private bool userHasCompany;
private bool userHasHotels;
private bool IsDriver;
private bool IsDevAdmin; private bool IsDevAdmin;
private bool IsSysAdmin; private bool IsSysAdmin;
private bool IsDriver;
private bool userHasCompany = false;
private bool userHasHotels = false;
private string? userEmail; private string? userEmail;
private string? userFullName; private string? userFullName;
private Guid? userId; private Guid? userId;
@ -193,18 +182,6 @@
{ {
_isMobile = await jsRuntime.InvokeAsync<bool>("isDevice"); _isMobile = await jsRuntime.InvokeAsync<bool>("isDevice");
_logger = new LoggerClient<AdminNavMenu>(LogWriters.ToArray()); _logger = new LoggerClient<AdminNavMenu>(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) if (SessionService.User != null)
{ {
@ -216,6 +193,19 @@
userFullName = SessionService.User.UserModelDto.ProfileDto.FullName; 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(); await base.OnInitializedAsync();
} }

View File

@ -287,7 +287,7 @@ select {
} }
.dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist { .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist {
background-color: aliceblue; background-color: lightgray;
} }
/*my blazor overrides end*/ /*my blazor overrides end*/
.custom-select { .custom-select {

View File

@ -41,6 +41,15 @@
return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent); return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent);
} }
</script> </script>
<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>
</head> </head>
<body> <body>