transfer cards accordion style fixes, coloring fiix, user transfers list (WIP), driver sendmessage, etc
This commit is contained in:
parent
c02f2dfe51
commit
dd8b1ac6b4
|
|
@ -943,10 +943,10 @@
|
|||
<Name>Anata_Development_Team</Name>
|
||||
</SelectedItem>
|
||||
<SelectedItem Type="Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlFile, Microsoft.Data.Tools.Schema.Sql, Version=162.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<Name>TIAM_DEV</Name>
|
||||
<Name>TIAM_DEV_log</Name>
|
||||
</SelectedItem>
|
||||
<SelectedItem Type="Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlFile, Microsoft.Data.Tools.Schema.Sql, Version=162.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<Name>TIAM_DEV_log</Name>
|
||||
<Name>TIAM_DEV</Name>
|
||||
</SelectedItem>
|
||||
<SelectedItem Type="Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlFile, Microsoft.Data.Tools.Schema.Sql, Version=162.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<Name>TIAM_DEVRELEASE</Name>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
@inherits BasePageComponent
|
||||
@inject HttpClient Http
|
||||
@inject NavigationManager navManager
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject ITransferDataService transferDataService
|
||||
@inject IUserDataService UserDataService
|
||||
@inject SumupService SumUpService
|
||||
|
|
@ -405,7 +404,7 @@ else
|
|||
foreach (var t in Enum.GetValues(typeof(TransferStatusType)).OfType<TransferStatusType>().ToList())
|
||||
_statusTypes.Add(t.ToString());
|
||||
|
||||
_logger = new LoggerClient<EditTransfers>(LogWriters.ToArray());
|
||||
_logger = new LoggerClient<EditTransfers>(_logWriters.ToArray());
|
||||
_logger.Info($"parameter: {transferId.ToString()}");
|
||||
|
||||
await LoadTransfer();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<div class="container-fluid" style="position: relative; z-index: 2;">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-12 col-lg-6">
|
||||
<div class="card bg-white p-3">
|
||||
|
||||
@* <InputWizard Data=@myModel
|
||||
OnSubmit="SubmitForm"
|
||||
IgnoreReflection="@TransferIgnorList"
|
||||
|
|
@ -34,7 +34,6 @@
|
|||
SubtitleResourceString="TransferSubtitle"></InputWizard> *@
|
||||
<DynamicEditForm Data="myModel" isEditing="true" IgnoreReflection="TransferIgnorList" OnSubmit="SubmitForm"></DynamicEditForm>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
if (Context.Products.Count() > 0)
|
||||
{
|
||||
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
<DxAccordion SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
|
|
|
|||
|
|
@ -1,93 +1,194 @@
|
|||
@using BlazorAnimation
|
||||
@using AyCode.Core.Enums
|
||||
@using AyCode.Services.Loggers
|
||||
@using BlazorAnimation
|
||||
@using TIAM.Core.Consts
|
||||
@using TIAM.Core.Enums
|
||||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAM.Services
|
||||
@using TIAMSharedUI.Pages.Components.EditComponents
|
||||
@using TIAMSharedUI.Pages.User.SysAdmins
|
||||
@using TIAMSharedUI.Shared.Components.Cards
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||
@using TIAMWebApp.Shared.Application.Services
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IServiceProviderDataService ServiceProviderDataService
|
||||
@inject AdminSignalRClient AdminSignalRClient;
|
||||
@inject IWizardProcessor wizardProcessor
|
||||
|
||||
<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.FullName}")</div>
|
||||
<p class="e-title"><i class="fa-solid fa-at"></i> @Context.ContactEmail</p>
|
||||
<p class="e-title"><i class="fa-solid fa-phone"></i> @Context.ContactPhone</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="hr" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
@RenderDetailsItem("fa-solid fa-location-dot", "From", Context.FromAddress)
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
@RenderDetailsItem("fa-solid fa-location-dot", "To", Context.ToAddress)
|
||||
</div>
|
||||
<hr class="hr" />
|
||||
<div class="col-12 col-md-4">
|
||||
@RenderDetailsItem("fa-solid fa-users", "Passengers", Context.PassengerCount.ToString())
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
@RenderDetailsItem("fa-solid fa-suitcase-rolling", "Luggage", Context.LuggageCount.ToString())
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
@RenderDetailsItem("fa-solid fa-hashtag", "Flight number", Context.FlightNumber)
|
||||
</div>
|
||||
<hr class="hr" />
|
||||
<div class="col-12">
|
||||
@RenderDetailsItem("fa-solid fa-hashtag", "Comment", Context.Comment)
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
@RenderDetailsItem("fa-solid fa-list-check", "Status", AllStatuses.FirstOrDefault(x => x.StatusValue == (byte)Context.TransferStatusType).StatusName)
|
||||
</div>
|
||||
<div class="col-9 col-md-5">
|
||||
<DxComboBox Data="@Statuses"
|
||||
@bind-Value="@CurrentStatusType"
|
||||
NullText="Select new status"
|
||||
CssClass="form-field"
|
||||
ValueFieldName="@nameof(TransferStatusModel.StatusValue)"
|
||||
TextFieldName="@nameof(TransferStatusModel.StatusName)" />
|
||||
|
||||
</div>
|
||||
<div class="col-3 col-md-1">
|
||||
<DxButton CssClass="btn btn-primary" Click="SaveStatus" Enabled="@isSaveActive"> Save</DxButton>
|
||||
</div>
|
||||
@if(!Context.Paid)
|
||||
{
|
||||
<hr class="hr" />
|
||||
<div class="col-3 col-md-1">
|
||||
<DxButton CssClass="btn btn-primary" Click="PaidByCash">Paid in car</DxButton>
|
||||
</div>
|
||||
<DxPopup CssClass="popup-demo-events"
|
||||
@bind-Visible="@_popupVisible"
|
||||
ShowFooter="true"
|
||||
CloseOnEscape="true"
|
||||
CloseOnOutsideClick="false"
|
||||
ShowCloseButton="false"
|
||||
HeaderText="MessageBox"
|
||||
Closing="EmailPopupClosing"
|
||||
Closed="EmailPopupClosed"
|
||||
SizeMode="SizeMode.Large">
|
||||
<BodyContentTemplate>
|
||||
@{
|
||||
if(showResultMessage)
|
||||
{
|
||||
<h5>@resultMessage</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<DynamicEditForm Data=@_messageWizardModel
|
||||
OnSubmit="SubmitForm"
|
||||
TitleString="New message"
|
||||
ButtonTextString="Send message"
|
||||
isEditing="true"
|
||||
IgnoreReflection=@IgnoreList></DynamicEditForm>
|
||||
}
|
||||
}
|
||||
|
||||
</BodyContentTemplate>
|
||||
<FooterContentTemplate Context="Context">
|
||||
@{
|
||||
if(showResultMessage)
|
||||
{
|
||||
<div class="popup-demo-events-footer">
|
||||
<!--DxCheckBox CssClass="popup-demo-events-checkbox" @bind-Checked="@EulaAccepted">I accept the terms of the EULA</!--DxCheckBox-->
|
||||
<!--DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="Context.CloseCallback" /-->
|
||||
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text="Ok" Click="CancelCreateClick" />
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="popup-demo-events-footer">
|
||||
<!--DxCheckBox CssClass="popup-demo-events-checkbox" @bind-Checked="@EulaAccepted">I accept the terms of the EULA</!--DxCheckBox-->
|
||||
<!--DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="Context.CloseCallback" /-->
|
||||
<DxButton CssClass="popup-demo-events-button ms-2" RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="CancelCreateClick" />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
</FooterContentTemplate>
|
||||
</DxPopup>
|
||||
|
||||
<DxTabs CssClass="no-padding">
|
||||
<DxTabPage Text="Details">
|
||||
|
||||
<div class="e-card cw-480 p-3">
|
||||
<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.FullName}")</div>
|
||||
<p class="e-title"><i class="fa-solid fa-at"></i> @Context.ContactEmail</p>
|
||||
<p class="e-title"><i class="fa-solid fa-phone"></i> @Context.ContactPhone</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="hr" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
@RenderDetailsItem("fa-solid fa-location-dot", "From", Context.FromAddress)
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
@RenderDetailsItem("fa-solid fa-location-dot", "To", Context.ToAddress)
|
||||
</div>
|
||||
<hr class="hr" />
|
||||
<div class="col-12 col-md-4">
|
||||
@RenderDetailsItem("fa-solid fa-users", "Passengers", Context.PassengerCount.ToString())
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
@RenderDetailsItem("fa-solid fa-suitcase-rolling", "Luggage", Context.LuggageCount.ToString())
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
@RenderDetailsItem("fa-solid fa-hashtag", "Flight number", Context.FlightNumber)
|
||||
</div>
|
||||
<hr class="hr" />
|
||||
<div class="col-12">
|
||||
@RenderDetailsItem("fa-solid fa-hashtag", "Comment", Context.Comment)
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
@RenderDetailsItem("fa-solid fa-list-check", "Status", AllStatuses.FirstOrDefault(x => x.StatusValue == (byte)Context.TransferStatusType).StatusName)
|
||||
</div>
|
||||
<div class="col-9 col-md-5">
|
||||
<DxComboBox Data="@Statuses"
|
||||
@bind-Value="@CurrentStatusType"
|
||||
NullText="Select new status"
|
||||
CssClass="form-field"
|
||||
ValueFieldName="@nameof(TransferStatusModel.StatusValue)"
|
||||
TextFieldName="@nameof(TransferStatusModel.StatusName)" />
|
||||
|
||||
</div>
|
||||
<div class="col-3 col-md-1">
|
||||
<DxButton CssClass="btn btn-primary" Click="SaveStatus" Enabled="@isSaveActive"> Save</DxButton>
|
||||
</div>
|
||||
@if (!Context.Paid)
|
||||
{
|
||||
<hr class="hr" />
|
||||
<div class="col-3 col-md-1">
|
||||
<DxButton CssClass="btn btn-primary" Click="PaidByCash">Paid in car</DxButton>
|
||||
</div>
|
||||
}
|
||||
|
||||
<p>@msg</p>
|
||||
</div>
|
||||
</div>
|
||||
</DxTabPage>
|
||||
<DxTabPage Text="Messages">
|
||||
<div style="margin-top: 10px; margin-bottom: 10px;">
|
||||
<DxButton Click="() => SendMail(Context)" Text="Send a message" RenderStyle="ButtonRenderStyle.Primary" />
|
||||
</div>
|
||||
<MessageDetailGridComponent ContextId="Context.Id" IsSenderEmailVisible="false" IsMessageTextVisible="false"></MessageDetailGridComponent>
|
||||
</DxTabPage>
|
||||
|
||||
</DxTabs>
|
||||
|
||||
<p>@msg</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Transfer Context { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> DataChanged { get; set; }
|
||||
[Parameter] public EventCallback<string> DataChanged { get; set; }
|
||||
|
||||
private LoggerClient<TransferCardComponent> _logger = null!;
|
||||
|
||||
//Email
|
||||
private bool showResultMessage = false;
|
||||
private string resultMessage = string.Empty;
|
||||
private List<UserModelDtoDetail> sysAdmins = [];
|
||||
|
||||
|
||||
private MessageWizardModel _messageWizardModel = new();
|
||||
|
||||
private bool displayCard = true;
|
||||
|
||||
private bool _popupVisible;
|
||||
|
||||
public List<string> IgnoreList =
|
||||
[
|
||||
"ReceiverEmailAddress",
|
||||
"ReceiverFullName",
|
||||
"ReceiverId",
|
||||
"SenderEmailAddress",
|
||||
"SenderFullName",
|
||||
"SenderId",
|
||||
"ContextId",
|
||||
"ContextType"
|
||||
];
|
||||
|
||||
|
||||
|
||||
private static readonly IEnumerable<TransferStatusModel> Statuses = new[]
|
||||
{
|
||||
{
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.DriverConfirmed), "Driver confirmed"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.DriverEnRoute), "Driver enroute"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.PassengerPickup), "Passenger in car"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.Finished), "Finished"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.UserCanceled), "User cancelled"),
|
||||
};
|
||||
};
|
||||
|
||||
private static readonly List<TransferStatusModel> AllStatuses = new()
|
||||
{
|
||||
{
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.OrderSubmitted), "Order submitted"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.OrderConfirmed), "Order confirmed"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.AssignedToDriver), "Assigned to driver"),
|
||||
|
|
@ -97,7 +198,7 @@
|
|||
new TransferStatusModel(Convert.ToByte(TransferStatusType.Finished), "Finished"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.UserCanceled), "User cancelled"),
|
||||
new TransferStatusModel(Convert.ToByte(TransferStatusType.AdminDenied), "Admin cancelled")
|
||||
};
|
||||
};
|
||||
|
||||
private TransferStatusModel _currentStatusType;
|
||||
public TransferStatusModel CurrentStatusType
|
||||
|
|
@ -175,12 +276,15 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_logger = new LoggerClient<TransferCardComponent>(LogWriters.ToArray());
|
||||
sysAdmins = await AdminSignalRClient.GetByIdAsync<List<UserModelDtoDetail>>(SignalRTags.GetAllUserModelDtoDetails, TiamConstClient.SysAdmins[0]);
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
protected override Task OnParametersSetAsync()
|
||||
{
|
||||
CurrentStatusType = AllStatuses.FirstOrDefault(x => x.StatusValue == (byte)Context.TransferStatusType);
|
||||
|
||||
return base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
|
|
@ -196,4 +300,61 @@
|
|||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
|
||||
void SendMail(Transfer item)
|
||||
{
|
||||
_logger.Info($"Preparing mail to {item.ContactEmail}, {item.Id}");
|
||||
_messageWizardModel.Subject = $"[#{item.OrderId}] New message from guest";
|
||||
_messageWizardModel.ReceiverId = TiamConstClient.SysAccounts["SystemEmailSender"];
|
||||
//get first sysadmin
|
||||
|
||||
_messageWizardModel.ReceiverEmailAddress = sysAdmins[0].UserDto.EmailAddress;
|
||||
_messageWizardModel.ReceiverFullName = "Admin user";
|
||||
|
||||
_messageWizardModel.SenderId = item.UserId;
|
||||
_messageWizardModel.SenderEmailAddress = TiamConstClient.SystemEmailAddress;
|
||||
|
||||
_messageWizardModel.ContextId = item.Id;
|
||||
_messageWizardModel.ContextType = MessageContextType.Transfer;
|
||||
_popupVisible = true;
|
||||
}
|
||||
|
||||
void CancelCreateClick()
|
||||
{
|
||||
showResultMessage = false;
|
||||
resultMessage = "";
|
||||
_popupVisible = false;
|
||||
}
|
||||
|
||||
void EmailPopupClosed()
|
||||
{
|
||||
//cancel clicked
|
||||
|
||||
}
|
||||
|
||||
void EmailPopupClosing(PopupClosingEventArgs args)
|
||||
{
|
||||
//myModel = new TransferWizardModel();
|
||||
_messageWizardModel = new MessageWizardModel();
|
||||
}
|
||||
|
||||
public async Task SubmitForm(object result)
|
||||
{
|
||||
var messageModel = (result as MessageWizardModel)!;
|
||||
_logger.Info(messageModel.Content);
|
||||
var email = await wizardProcessor.ProcessWizardAsync<MessageWizardModel>(result.GetType(), messageModel);
|
||||
if (email != null)
|
||||
{
|
||||
resultMessage = "Message sent";
|
||||
}
|
||||
else
|
||||
{
|
||||
resultMessage = $"Something went wrong, please try again later, or contact us by regular email at {TiamConstClient.SystemEmailAddress}!";
|
||||
}
|
||||
showResultMessage = true;
|
||||
_logger.Info($"Submitted nested form: {result.GetType().FullName}");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,19 +74,25 @@
|
|||
<div class="row">
|
||||
<div class=" col-12">
|
||||
|
||||
<DxTabs>
|
||||
<DxTabs CssClass="no-padding">
|
||||
<DxTabPage Text="@($"Upcoming({PageModel.Upcomings.Count})")">
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
<DxAccordion CssClass="no-padding" SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var transfer in PageModel.Upcomings)
|
||||
{
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"[#{transfer.OrderId}] {transfer.Appointment} - {transfer.FromAddress}")>
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
<DxAccordionItem IconCssClass="@GetCustomColor(transfer.TransferStatusType)">
|
||||
<HeaderTextTemplate>
|
||||
<div style="flex-direction: column">
|
||||
<p class="no-padding no-margin">@($"[#{transfer.OrderId}] {transfer.Appointment}")</p>
|
||||
<p class="text-muted no-padding no-margin">@($"{transfer.FromAddress}")</p>
|
||||
</div>
|
||||
</HeaderTextTemplate>
|
||||
<ContentTemplate>
|
||||
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
|
|
@ -101,18 +107,25 @@
|
|||
</DxTabPage>
|
||||
|
||||
<DxTabPage Text="@($"Problems({PageModel.Problems.Count})")">
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
<DxAccordion CssClass="no-padding" SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var transfer in PageModel.Problems)
|
||||
{
|
||||
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"[#{transfer.OrderId}] {transfer.Appointment} - {transfer.FromAddress}")>
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
<DxAccordionItem IconCssClass="@GetCustomColor(transfer.TransferStatusType)">
|
||||
|
||||
<HeaderTextTemplate>
|
||||
<div style="flex-direction: column">
|
||||
<p class="no-padding no-margin">@($"[#{transfer.OrderId}] {transfer.Appointment}")</p>
|
||||
<p class="text-muted no-padding no-margin">@($"{transfer.FromAddress}")</p>
|
||||
</div>
|
||||
</HeaderTextTemplate>
|
||||
<ContentTemplate>
|
||||
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
|
|
@ -158,10 +171,10 @@
|
|||
<DxGridDataColumn FieldName="Appointment" Caption="Appointment" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" SortOrder="GridColumnSortOrder.Descending" GroupIndex="0" GroupInterval="GridColumnGroupInterval.Date" DisplayFormat="d" Width="95" />
|
||||
<DxGridDataColumn Caption="Time" Width="50" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var appointment = (Transfer)context.DataItem;
|
||||
<text>@appointment.Appointment.ToString("t")</text>
|
||||
}
|
||||
@{
|
||||
var appointment = (Transfer)context.DataItem;
|
||||
<text>@appointment.Appointment.ToString("t")</text>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="FromAddress" />
|
||||
|
|
@ -370,19 +383,19 @@
|
|||
switch (transferStatusByte)
|
||||
{
|
||||
case 5:
|
||||
return "bg-important text-body";
|
||||
return "text-danger fa-solid fa-triangle-exclamation";
|
||||
|
||||
case > 5 and < 35:
|
||||
return "bg-attention text-body";
|
||||
return "text-warning fa-solid fa-triangle-exclamation";
|
||||
|
||||
case 35:
|
||||
return "bg-finished text-body";
|
||||
return "text-success fa-solid fa-circle-check";
|
||||
|
||||
case > 35:
|
||||
return "bg-cancel text-body";
|
||||
return "text-muted fa-solid fa-circle-xmark";
|
||||
|
||||
default:
|
||||
return "text-body";
|
||||
return "text-primary";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -393,7 +406,7 @@
|
|||
_logger = new LoggerClient<DriverManageTransfers>(LogWriters.ToArray());
|
||||
|
||||
InitializePageAsync(DriverId).Forget();
|
||||
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
SearchFilterCondition="@ListSearchFilterCondition.Contains"
|
||||
ListRenderMode="ListRenderMode.Virtual"
|
||||
TextFieldName="Name"
|
||||
CssClass="form-field">
|
||||
CssClass="form-field"
|
||||
SizeMode="SizeMode.Small">
|
||||
</DxComboBox>
|
||||
|
||||
<div class="row py-3">
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="mb-0"> <a href="/user/transfers">All transfers</a> </h6>
|
||||
<h6 class="mb-0"> <a href="/user/transfers/@productId">All transfers</a> </h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits BasePageComponent
|
||||
|
||||
@layout AdminLayout
|
||||
@* @layout AdminLayout *@
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
@inject IWizardProcessor wizardProcessor
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
</DxTabPage>
|
||||
|
||||
<DxTabPage Text="Profiles">
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
<DxAccordion SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<DxTabs>
|
||||
<DxTabPage Text="Cards">
|
||||
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
<DxAccordion SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
@inject AdminSignalRClient AdminSignalRClient
|
||||
|
||||
|
||||
<CarGrid Logger="_logger"
|
||||
<CarGrid SizeMode="SizeMode.Small" Logger="_logger"
|
||||
GetAllMessageTag="GetAllTag"
|
||||
ContextIds="@(ContextId.IsNullOrEmpty() ? null : [ContextId])"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
@using TIAM.Entities.Emails
|
||||
@using TIAMSharedUI.Shared.Components.BaseComponents
|
||||
@inherits UserBasePageComponent
|
||||
@layout AdminLayout
|
||||
@* @layout AdminLayout *@
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> localizer
|
||||
@inject IWizardProcessor wizardProcessor
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
<PageTitle>Transfers</PageTitle>
|
||||
|
||||
<div class="text-center m-5">
|
||||
<h1>Tasks</h1>
|
||||
<h2 style="font-size:small">Manage your tasks here!</h2>
|
||||
<h1>Your orders</h1>
|
||||
<h2 style="font-size:small">Manage your orders here!</h2>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -71,98 +71,111 @@
|
|||
<div class="row">
|
||||
<div class=" col-12">
|
||||
|
||||
|
||||
|
||||
<DxTabs>
|
||||
<DxTabPage Text="Upcoming">
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var (transfer, i) in Upcoming)
|
||||
{
|
||||
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"{transfer.Appointment} - {transfer.FromAddress}") Expanded=@(i == 0)>
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
</Items>
|
||||
</DxAccordion>
|
||||
</DxTabPage>
|
||||
<DxTabPage Text="Unpaid">
|
||||
<DxAccordion ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var (transfer, i) in Problems)
|
||||
{
|
||||
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"{transfer.Appointment} - {transfer.FromAddress}") Expanded=@(i == 0)>
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
</Items>
|
||||
</DxAccordion>
|
||||
</DxTabPage>
|
||||
|
||||
|
||||
<DxTabPage Text="Calendar">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
<DxScheduler @bind-StartDate="@StartDate"
|
||||
DataStorage="@_dataStorage"
|
||||
CssClass="w-100">
|
||||
<DxSchedulerTimelineView Duration="@TimeSpan.FromHours(48)" CellMinWidth="80">
|
||||
<Scales>
|
||||
<DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Day" UnitCount="1"></DxSchedulerTimeScale>
|
||||
<DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Hour" UnitCount="2"></DxSchedulerTimeScale>
|
||||
</Scales>
|
||||
</DxSchedulerTimelineView>
|
||||
<DxSchedulerWeekView ShowWorkTimeOnly="false"></DxSchedulerWeekView>
|
||||
<DxSchedulerDayView DayCount="1" ShowWorkTimeOnly="false"></DxSchedulerDayView>
|
||||
</DxScheduler>
|
||||
</div>
|
||||
</DxTabPage>
|
||||
<DxTabs CssClass="no-padding">
|
||||
<DxTabPage Text="Upcoming">
|
||||
<DxAccordion CssClass="no-padding" SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var (transfer, i) in Upcoming)
|
||||
{
|
||||
|
||||
<DxTabPage Text="History">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
|
||||
<TransferDetailGrid @ref="_gridTransfer"
|
||||
Logger="_logger"
|
||||
GetAllMessageTag="SignalRTags.GetTransfersByUserProductMappingId"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
ContextIds="new object[] {userId}"
|
||||
CustomizeElement="Grid_CustomizeElement"
|
||||
ShowGroupPanel="true"
|
||||
CustomGroup="Grid_CustomGroup"
|
||||
CustomizeGroupValueDisplayText="Grid_CustomizeGroupValueDisplayText"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
AllowSelectRowByClick="false"
|
||||
PageSize="13"
|
||||
ShowFilterRow="true">
|
||||
<DxAccordionItem IconCssClass="@GetCustomColor(transfer.TransferStatusType)" Expanded=@(i == 0)>
|
||||
<HeaderTextTemplate>
|
||||
<div style="flex-direction: column">
|
||||
<p class="no-padding no-margin">@($"[#{transfer.OrderId}] {transfer.Appointment}")</p>
|
||||
<p class="text-muted no-padding no-margin">@($"{transfer.FromAddress}")</p>
|
||||
</div>
|
||||
</HeaderTextTemplate>
|
||||
<ContentTemplate>
|
||||
|
||||
<Columns>
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Appointment" SortOrder="GridColumnSortOrder.Descending" GroupIndex="0" GroupInterval="GridColumnGroupInterval.Custom" DisplayFormat="g" Width="125" />
|
||||
<DxGridDataColumn FieldName="OrderId" Caption="Order" SortIndex="1" SortOrder="GridColumnSortOrder.Descending" Width="70" />
|
||||
<DxGridDataColumn FieldName="FromAddress" />
|
||||
<DxGridDataColumn FieldName="ToAddress" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="125" Visible="false" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
|
||||
</TransferDetailGrid>
|
||||
</div>
|
||||
</DxTabPage>
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
</Items>
|
||||
</DxAccordion>
|
||||
</DxTabPage>
|
||||
<DxTabPage Text="Unpaid">
|
||||
<DxAccordion CssClass="no-padding" SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
||||
ExpandCollapseAction="ExpandCollapseAction"
|
||||
AnimationType="LayoutAnimationType.Slide">
|
||||
<Items>
|
||||
@foreach (var (transfer, i) in Problems)
|
||||
{
|
||||
|
||||
<DxAccordionItem IconCssClass="@GetCustomColor(transfer.TransferStatusType)" Expanded=@(i == 0)>
|
||||
<HeaderTextTemplate>
|
||||
<div style="flex-direction: column">
|
||||
<p class="no-padding no-margin">@($"[#{transfer.OrderId}] {transfer.Appointment}")</p>
|
||||
<p class="text-muted no-padding no-margin">@($"{transfer.FromAddress}")</p>
|
||||
</div>
|
||||
</HeaderTextTemplate>
|
||||
|
||||
<ContentTemplate>
|
||||
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
|
||||
</ContentTemplate>
|
||||
</DxAccordionItem>
|
||||
}
|
||||
</Items>
|
||||
</DxAccordion>
|
||||
</DxTabPage>
|
||||
|
||||
|
||||
<DxTabPage Text="Calendar">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
<DxScheduler @bind-StartDate="@StartDate"
|
||||
DataStorage="@_dataStorage"
|
||||
CssClass="w-100">
|
||||
<DxSchedulerTimelineView Duration="@TimeSpan.FromHours(48)" CellMinWidth="80">
|
||||
<Scales>
|
||||
<DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Day" UnitCount="1"></DxSchedulerTimeScale>
|
||||
<DxSchedulerTimeScale Unit="@SchedulerTimeScaleUnit.Hour" UnitCount="2"></DxSchedulerTimeScale>
|
||||
</Scales>
|
||||
</DxSchedulerTimelineView>
|
||||
<DxSchedulerWeekView ShowWorkTimeOnly="false"></DxSchedulerWeekView>
|
||||
<DxSchedulerDayView DayCount="1" ShowWorkTimeOnly="false"></DxSchedulerDayView>
|
||||
</DxScheduler>
|
||||
</div>
|
||||
</DxTabPage>
|
||||
|
||||
<DxTabPage Text="History">
|
||||
<div class="d-flex flex-column mb-4 pb-2">
|
||||
|
||||
<TransferDetailGrid @ref="_gridTransfer"
|
||||
Logger="_logger"
|
||||
GetAllMessageTag="SignalRTags.GetTransfersByUserProductMappingId"
|
||||
SignalRClient="AdminSignalRClient"
|
||||
ContextIds="new object[] {userId}"
|
||||
CustomizeElement="Grid_CustomizeElement"
|
||||
ShowGroupPanel="true"
|
||||
CustomGroup="Grid_CustomGroup"
|
||||
CustomizeGroupValueDisplayText="Grid_CustomizeGroupValueDisplayText"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
AllowSelectRowByClick="false"
|
||||
PageSize="13"
|
||||
ShowFilterRow="true">
|
||||
|
||||
<Columns>
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Appointment" SortOrder="GridColumnSortOrder.Descending" GroupIndex="0" GroupInterval="GridColumnGroupInterval.Custom" DisplayFormat="g" Width="125" />
|
||||
<DxGridDataColumn FieldName="OrderId" Caption="Order" SortIndex="1" SortOrder="GridColumnSortOrder.Descending" Width="70" />
|
||||
<DxGridDataColumn FieldName="FromAddress" />
|
||||
<DxGridDataColumn FieldName="ToAddress" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="125" Visible="false" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
|
||||
</TransferDetailGrid>
|
||||
</div>
|
||||
</DxTabPage>
|
||||
|
||||
</DxTabs>
|
||||
|
||||
</DxTabs>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=" col-12 col-xl-6">
|
||||
|
|
@ -276,13 +289,13 @@
|
|||
{
|
||||
if (e.FieldName == "Appointment")
|
||||
{
|
||||
|
||||
string displayText = ((DateTime)e.Value).Date.ToString();
|
||||
|
||||
string displayText = ((DateTime)e.Value).Date.ToString();
|
||||
e.DisplayText = displayText;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void RefreshComponent()
|
||||
{
|
||||
StateHasChanged();
|
||||
|
|
@ -355,7 +368,7 @@
|
|||
_logger.Info($"Submitted nested form: {result.GetType().FullName}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
string GetCustomColor(TransferStatusType transferStatusType)
|
||||
{
|
||||
|
|
@ -365,19 +378,19 @@
|
|||
switch (transferStatusByte)
|
||||
{
|
||||
case 5:
|
||||
return "bg-important";
|
||||
return "text-danger fa-solid fa-triangle-exclamation";
|
||||
|
||||
case > 5 and < 35:
|
||||
return "bg-attention";
|
||||
return "text-warning fa-solid fa-triangle-exclamation";
|
||||
|
||||
case 35:
|
||||
return "bg-finished";
|
||||
return "text-success fa-solid fa-circle-check";
|
||||
|
||||
case > 35:
|
||||
return "bg-cancel";
|
||||
return "text-muted fa-solid fa-circle-xmark";
|
||||
|
||||
default:
|
||||
return "";
|
||||
return "text-primary";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,37 +19,38 @@
|
|||
@inject GooglePlacesService GooglePlacesService
|
||||
|
||||
|
||||
<DxTabs CssClass="bg-light">
|
||||
<DxTabs SizeMode="SizeMode.Small" CssClass="bg-light">
|
||||
<DxTabPage Text="Preset addresses">
|
||||
|
||||
|
||||
<DxComboBox Data="@Data"
|
||||
CssClass="p-3"
|
||||
InputCssClass="@CssClass"
|
||||
@bind-Value="@SelectedDestination"
|
||||
SearchMode="@ListSearchMode.AutoSearch"
|
||||
SearchFilterCondition="@ListSearchFilterCondition.Contains"
|
||||
ListRenderMode="ListRenderMode.Virtual"
|
||||
TextFieldName="@nameof(TransferDestination.Name)"
|
||||
InputId="cbOverview" />
|
||||
|
||||
|
||||
|
||||
|
||||
<DxComboBox Data="@Data"
|
||||
CssClass="p-3"
|
||||
InputCssClass="@CssClass"
|
||||
@bind-Value="@SelectedDestination"
|
||||
SearchMode="@ListSearchMode.AutoSearch"
|
||||
SearchFilterCondition="@ListSearchFilterCondition.Contains"
|
||||
ListRenderMode="ListRenderMode.Virtual"
|
||||
TextFieldName="@nameof(TransferDestination.Name)"
|
||||
InputId="cbOverview"
|
||||
SizeMode="SizeMode.Small" />
|
||||
|
||||
|
||||
</DxTabPage>
|
||||
<DxTabPage Text="Custom address">
|
||||
|
||||
<AddressSearchAndSelectComponent AddressChanged="@OnSelectedAddressChanged" CssClass="@CssClass">
|
||||
|
||||
</AddressSearchAndSelectComponent>
|
||||
@* <DxFormLayoutItem Caption="Type a custom address">
|
||||
<DxTextBox @bind-Text="Address" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem>
|
||||
<DxButton Context="ButtonContext" Click="ValidateAddress">Validate Address</DxButton>
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem>
|
||||
<p>@ValidationMessage</p>
|
||||
</DxFormLayoutItem> *@
|
||||
|
||||
<AddressSearchAndSelectComponent AddressChanged="@OnSelectedAddressChanged" CssClass="@CssClass">
|
||||
|
||||
</AddressSearchAndSelectComponent>
|
||||
@* <DxFormLayoutItem Caption="Type a custom address">
|
||||
<DxTextBox @bind-Text="Address" />
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem>
|
||||
<DxButton Context="ButtonContext" Click="ValidateAddress">Validate Address</DxButton>
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem>
|
||||
<p>@ValidationMessage</p>
|
||||
</DxFormLayoutItem> *@
|
||||
|
||||
</DxTabPage>
|
||||
</DxTabs>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,169 +7,142 @@
|
|||
|
||||
|
||||
<nav class="navbar sticky-top navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid">
|
||||
<NavLink class="navbar-brand" href="/">
|
||||
<img height="25" src="_content/TIAMSharedUI/images/logo_wide.png" alt="TourIam Logo" title="TourIAm Logo" />
|
||||
</NavLink>
|
||||
|
||||
|
||||
<button @onclick="ToggleNavMenu" class="navbar-toggler">
|
||||
<img src="_content/TIAMSharedUI/images/navbar-toggler.png" width="40" />
|
||||
</button>
|
||||
<div class="@NavMenuCssClass navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<!--NavLink class="nav-link" href="" Match="NavLinkMatch.All"-->
|
||||
<NavLink class="nav-link" href="/">
|
||||
<!--span class="oi oi-home" aria-hidden="true"></span-->
|
||||
@localizer.GetString("NavMenu.Home")
|
||||
</NavLink>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
@{
|
||||
if(enableTransfer)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="transfer">
|
||||
@localizer.GetString("NavMenu.Transfer")
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="formulaone">
|
||||
@localizer.GetString("NavMenu.FormulaOne")
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
|
||||
if (sessionService.IsSysAdmin)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="swagger">
|
||||
API
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="chat">
|
||||
Chat
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="events">
|
||||
@localizer.GetString("NavMenu.Events")
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
|
||||
if(enableLanguage)
|
||||
{
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<NavLink class="nav-link" href="settings">
|
||||
@localizer.GetString("NavMenu.Settings")
|
||||
</NavLink>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="#">Action</a></li>
|
||||
<li><a class="dropdown-item" href="#">Another action</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#">Something else here</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="transfer">
|
||||
@localizer.GetString("NavMenu.Transfer")
|
||||
</NavLink>
|
||||
</li>
|
||||
|
||||
@if (isSysAdmin)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="swagger">
|
||||
API
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="chat">
|
||||
Chat
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="events">
|
||||
@localizer.GetString("NavMenu.Events")
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="about">
|
||||
@localizer.GetString("NavMenu.About")
|
||||
</NavLink>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
@* <AuthorizeView>
|
||||
<Authorized>
|
||||
@if(hasProperty)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="user/admin">
|
||||
Admin
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="user/messages">
|
||||
Messages
|
||||
</NavLink>
|
||||
</li>
|
||||
|
||||
}
|
||||
</Authorized>
|
||||
</AuthorizeView> *@
|
||||
@if(enableLogin)
|
||||
@if (enableLogin)
|
||||
{
|
||||
if (!myUser && enableLogin)
|
||||
<AuthorizeView>
|
||||
<NotAuthorized>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="login">
|
||||
@localizer.GetString("NavMenu.Login")
|
||||
</NavLink>
|
||||
</li>
|
||||
</NotAuthorized>
|
||||
|
||||
<Authorized>
|
||||
<li class="nav-item">
|
||||
@{
|
||||
string url3 = $"user/messages/{userId}";
|
||||
<NavLink class="nav-link" href="@url3">
|
||||
<i class="fa-solid fa-envelope"></i>
|
||||
</NavLink>
|
||||
}
|
||||
</li>
|
||||
|
||||
<!-- User Icon with Dropdown Menu -->
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa-solid fa-user"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
|
||||
<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">
|
||||
<i class="fa-solid fa-user"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-name-container bm-3 mb-2">
|
||||
<div class="tm-8 text-center">@userEmail</div>
|
||||
<div class="text-center">@userFullName</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center p-1">
|
||||
<DxButton Text="Manage account" RenderStyle="@ButtonRenderStyle.Secondary" Click="NavToAcc"></DxButton>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center p-1">
|
||||
<DxButton Text="My transfers" RenderStyle="@ButtonRenderStyle.Secondary" Click="NavToTransfers"></DxButton>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center p-1">
|
||||
<DxButton Text="@localizer.GetString("NavMenu.SignOut")" RenderStyle="@ButtonRenderStyle.Secondary" Click="SignOut"></DxButton>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
@if (hasProperty || isSysAdmin || isDevAdmin)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="user/admin">
|
||||
@localizer.GetString("NavMenu.Admin")
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</Authorized>
|
||||
|
||||
</AuthorizeView>
|
||||
|
||||
@if (enableLanguage)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="login">
|
||||
@localizer.GetString("NavMenu.Login")
|
||||
<NavLink class="nav-link" href="settings">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (true || hasProperty)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link" href="user/admin">
|
||||
@localizer.GetString("NavMenu.Admin")
|
||||
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
<li class="nav-item">
|
||||
<div class="btn-nav">
|
||||
<NavLink class="btn btn-primary btn-small navbar-btn" href="#" @onclick="SignOut" data-bs-target=".navbar-collapse.show">
|
||||
@localizer.GetString("NavMenu.SignOut")
|
||||
</NavLink>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@* <script>
|
||||
function toggleBootstrapNavMenu(isExpanded) {
|
||||
var navMenu = document.getElementById('navbarNav');
|
||||
if (navMenu) {
|
||||
var collapse = new bootstrap.Collapse(navMenu, {
|
||||
toggle: false
|
||||
});
|
||||
if (isExpanded) {
|
||||
collapse.show();
|
||||
console.log("Show");
|
||||
} else {
|
||||
collapse.hide();
|
||||
console.log("Hide");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script> *@
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ using Microsoft.AspNetCore.Components.Authorization;
|
|||
using Microsoft.JSInterop;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using AyCode.Blazor.Components.Services;
|
||||
|
||||
|
||||
namespace TIAMSharedUI.Shared.Components
|
||||
|
|
@ -54,14 +55,19 @@ namespace TIAMSharedUI.Shared.Components
|
|||
private bool enableLogin = true;
|
||||
private bool enableEvents = false;
|
||||
private bool enableTransfer = true;
|
||||
private bool enableLanguage = false;
|
||||
private bool enableLanguage = true;
|
||||
private bool enableApi = true;
|
||||
private bool enableChat = true;
|
||||
|
||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : "show";
|
||||
private bool collapseNavMenu = true;
|
||||
private bool myUser = false;
|
||||
private bool hasProperty = false;
|
||||
private bool hasProperty = false;
|
||||
private bool isSysAdmin = false;
|
||||
private bool isDevAdmin = false;
|
||||
private Guid? userId = null;
|
||||
private string userEmail = "";
|
||||
private string userFullName = "";
|
||||
|
||||
private ILogger _logger;
|
||||
|
||||
|
|
@ -129,6 +135,18 @@ namespace TIAMSharedUI.Shared.Components
|
|||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void NavToAcc()
|
||||
{
|
||||
var url = $"user/account/{userId}";
|
||||
navigationManager.NavigateTo(url);
|
||||
}
|
||||
|
||||
private void NavToTransfers()
|
||||
{
|
||||
var url = $"user/transfers/{userId}";
|
||||
navigationManager.NavigateTo(url);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Unsubscribe from the event when the component is disposed
|
||||
|
|
@ -140,6 +158,12 @@ namespace TIAMSharedUI.Shared.Components
|
|||
if (sessionService.User != null)
|
||||
{
|
||||
myUser = true;
|
||||
userId = sessionService.User.UserId;
|
||||
userEmail = sessionService.User.Email;
|
||||
if (sessionService.User.UserModelDto.ProfileDto.FullName != null)
|
||||
{
|
||||
userFullName = sessionService.User.UserModelDto.ProfileDto.FullName!;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -152,8 +176,10 @@ namespace TIAMSharedUI.Shared.Components
|
|||
if (properties == null)
|
||||
return;
|
||||
|
||||
|
||||
hasProperty = properties.Count > 0;
|
||||
|
||||
isSysAdmin = sessionService.IsSysAdmin;
|
||||
isDevAdmin = sessionService.IsDevAdmin;
|
||||
foreach (var property in properties)
|
||||
{
|
||||
_logger.Detail($"First property: {property.Value} ");
|
||||
|
|
|
|||
|
|
@ -99,6 +99,14 @@ select {
|
|||
background-color: aliceblue;
|
||||
}
|
||||
|
||||
.no-padding {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.no-margin {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.bg-red {
|
||||
background-color: #f7279f !important;
|
||||
}
|
||||
|
|
@ -208,20 +216,20 @@ select {
|
|||
}
|
||||
|
||||
.dxbl-tabs.dxbl-tabs-top {
|
||||
--dxbl-tabs-bg: #ffffff45;
|
||||
background-color: #ffffff45;
|
||||
--dxbl-tabs-bg: #ffffff15;
|
||||
background-color: #ffffff15;
|
||||
/*box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
|
||||
backdrop-filter: blur( 6px );*/
|
||||
-webkit-backdrop-filter: blur( 6px );
|
||||
/*-webkit-backdrop-filter: blur( 6px );*/
|
||||
/*border-radius: 10px;*/
|
||||
}
|
||||
|
||||
.dxbl-modal > .dxbl-modal-root > .dxbl-popup > .dxbl-modal-content {
|
||||
background: rgba( 255, 255, 255, 0.45 );
|
||||
background: rgba( 255, 255, 255, 1 );
|
||||
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
|
||||
backdrop-filter: blur( 6px );
|
||||
-webkit-backdrop-filter: blur( 6px );
|
||||
border-radius: 10px;
|
||||
border-radius: 0px;
|
||||
border: 1px solid rgba( 255, 255, 255, 0.18 );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue