53 lines
1.5 KiB
Plaintext
53 lines
1.5 KiB
Plaintext
@page "/ispezioni"
|
|
@attribute [Authorize]
|
|
@using SteUp.Shared.Components.Layout
|
|
@using SteUp.Shared.Components.Layout.Overlay
|
|
@using SteUp.Shared.Components.SingleElements
|
|
@using SteUp.Shared.Components.SingleElements.Card
|
|
@using SteUp.Shared.Core.Entities
|
|
@using SteUp.Shared.Core.Interface.LocalDb
|
|
@inject IIspezioniService IspezioniService
|
|
|
|
<HeaderLayout Title="Ispezioni"/>
|
|
|
|
<div class="container ispezioni pb-safe-area">
|
|
@if (Ispezioni.IsNullOrEmpty())
|
|
{
|
|
<NoDataAvailable Text="Nessuna ispezione effettuata"
|
|
ImageSource="_content/SteUp.Shared/images/undraw_file-search_cbur.svg"/>
|
|
}
|
|
else
|
|
{
|
|
<Virtualize Items="Ispezioni" Context="ispezione">
|
|
<InspectionCard Class="no-margin" Ispezione="ispezione" CompactView="true" OnClick="@OnClickIspezione"/>
|
|
</Virtualize>
|
|
}
|
|
</div>
|
|
|
|
<SpinnerOverlay VisibleOverlay="VisibleOverlay"/>
|
|
|
|
@code{
|
|
private List<Ispezione> Ispezioni { get; set; } = [];
|
|
|
|
private bool VisibleOverlay { get; set; } = true;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await LoadData();
|
|
|
|
VisibleOverlay = false;
|
|
StateHasChanged();
|
|
}
|
|
|
|
private async Task LoadData()
|
|
{
|
|
Ispezioni = await IspezioniService.GetAllIspezioniWithSchedeAsync(UserSession.User.Username);
|
|
}
|
|
|
|
private void OnClickIspezione(Ispezione ispezione)
|
|
{
|
|
SteupDataService.InspectionPageState.Ispezione = ispezione;
|
|
NavigationManager.NavigateTo("/ispezione");
|
|
}
|
|
|
|
} |