194 lines
6.0 KiB
Plaintext
194 lines
6.0 KiB
Plaintext
@page "/user/account/{userId:guid}"
|
|
@using BlazorAnimation
|
|
@using TIAM.Core.Enums
|
|
@using TIAM.Entities.Emails
|
|
@using TIAM.Entities.Profiles
|
|
@using TIAM.Entities.Transfers
|
|
@using TIAM.Models.Dtos.Users
|
|
@using TIAM.Resources
|
|
@using TIAM.Services
|
|
@using TIAMSharedUI.Pages.Components
|
|
@using TIAMSharedUI.Pages.User.CardComponents
|
|
@using TIAMSharedUI.Pages.User.SysAdmins
|
|
@using TIAMSharedUI.Shared
|
|
@using TIAMWebApp.Shared.Application.Interfaces
|
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI
|
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
|
@using TIAMWebApp.Shared.Application.Models.PageModels
|
|
@using TIAMWebApp.Shared.Application.Utility
|
|
@using AyCode.Services.Loggers
|
|
@using TIAMWebApp.Shared.Application.Services
|
|
@using TIAMSharedUI.Shared.Components.Grids
|
|
@using AyCode.Core.Enums
|
|
@using AyCode.Core.Extensions
|
|
@using AyCode.Core.Consts
|
|
@using AyCode.Core
|
|
@using AyCode.Core.Helpers
|
|
@using DevExpress.Data.Filtering
|
|
@using TIAMSharedUI.Shared.Components.BaseComponents
|
|
@inherits BasePageComponent
|
|
|
|
@* @layout AdminLayout *@
|
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
|
@inject IStringLocalizer<TIAMResources> localizer
|
|
@inject IWizardProcessor wizardProcessor
|
|
@inject ITransferDataService transferDataService
|
|
@inject ISessionService sessionService
|
|
@inject AdminSignalRClient AdminSignalRClient;
|
|
<PageTitle>Transfers</PageTitle>
|
|
|
|
<div class="text-center m-5">
|
|
<h1>Tasks</h1>
|
|
<h2 style="font-size:small">Manage your tasks here!</h2>
|
|
</div>
|
|
|
|
|
|
<DxPopup CssClass="popup-demo-events"
|
|
@bind-Visible="@_popupVisible"
|
|
ShowFooter="true"
|
|
CloseOnEscape="true"
|
|
CloseOnOutsideClick="false"
|
|
ShowCloseButton="false"
|
|
HeaderText="Change password"
|
|
Closing="PasswordPopupClosing"
|
|
Closed="PasswordPopupClosed">
|
|
<BodyContentTemplate>
|
|
Change your password here
|
|
</BodyContentTemplate>
|
|
<FooterContentTemplate Context="Context">
|
|
<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>
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class=" col-12">
|
|
|
|
<div class="card">
|
|
|
|
<DxTabs>
|
|
|
|
<DxTabPage Text="Account details">
|
|
<div class="py-3 px-3">
|
|
<div class="d-flex flex-column mb-4 pb-2">
|
|
<UserCardComponent Context="@myUser" />
|
|
</div>
|
|
</div>
|
|
</DxTabPage>
|
|
|
|
<DxTabPage Text="Profiles">
|
|
<DxAccordion SizeMode="@SizeMode.Small" ExpandMode="ExpandMode"
|
|
ExpandCollapseAction="ExpandCollapseAction"
|
|
AnimationType="LayoutAnimationType.Slide">
|
|
<Items>
|
|
@foreach (var (profile, i) in ProfileItems)
|
|
{
|
|
|
|
<DxAccordionItem Text=@($"{profile.Name}") Expanded=@(i == 0)>
|
|
<ContentTemplate>
|
|
@* <div class="py-3 px-3">
|
|
<ProfileCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
|
</div> *@
|
|
</ContentTemplate>
|
|
</DxAccordionItem>
|
|
}
|
|
</Items>
|
|
</DxAccordion>
|
|
</DxTabPage>
|
|
|
|
|
|
</DxTabs>
|
|
</div>
|
|
</div>
|
|
|
|
<div class=" col-12 col-xl-6">
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@code {
|
|
[Parameter] public Guid UserId { get; set; }
|
|
private Guid userId;
|
|
private LoggerClient<ManageAccount> _logger;
|
|
|
|
private bool _popupVisible;
|
|
|
|
private UserModelDtoDetail myUser;
|
|
private List<Profile> profiles = [];
|
|
IEnumerable<(Profile, int)> ProfileItems = [];
|
|
|
|
AccordionExpandMode ExpandMode { get; set; } = AccordionExpandMode.SingleOrNone;
|
|
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
|
|
|
|
|
DateTime StartDate { get; set; } = DateTime.Today;
|
|
DxSchedulerDataStorage _dataStorage = new();
|
|
|
|
private void RefreshComponent()
|
|
{
|
|
StateHasChanged();
|
|
}
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
userId = UserId;
|
|
// transfers = await AdminSignalRClient.GetByIdAsync<List<Transfer>>(SignalRTags.GetTransfersByUserProductMappingId, DriverId);
|
|
|
|
|
|
}
|
|
|
|
void CancelCreateClick()
|
|
{
|
|
|
|
_popupVisible = false;
|
|
}
|
|
|
|
void PasswordPopupClosed()
|
|
{
|
|
//cancel clicked
|
|
|
|
}
|
|
|
|
void PasswordPopupClosing(PopupClosingEventArgs args)
|
|
{
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
|
|
public async Task SubmitForm(object result)
|
|
{
|
|
|
|
|
|
_logger.Info($"Submitted nested form: {result.GetType().FullName}");
|
|
}
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
_logger = new LoggerClient<ManageAccount>(LogWriters.ToArray());
|
|
if (!UserId.IsNullOrEmpty())
|
|
{
|
|
var test = UserId.ToString();
|
|
if (sessionService.User != null)
|
|
{
|
|
myUser = sessionService.User.UserModelDto;
|
|
}
|
|
profiles.Add(myUser.ProfileDto);
|
|
ProfileItems = profiles.Select((item, index) => (item, index));
|
|
//further profile by userproductmapping
|
|
}
|
|
|
|
await base.OnInitializedAsync();
|
|
}
|
|
|
|
|
|
} |