Gestiti salvataggi rest

This commit is contained in:
2026-03-02 10:50:34 +01:00
parent e027d8e5cf
commit ab9578a45f
58 changed files with 1235 additions and 305 deletions

View File

@@ -1,5 +1,8 @@
@using CommunityToolkit.Mvvm.Messaging
@using SteUp.Shared.Core.Entities
@using SteUp.Shared.Core.Interface.IntegryApi
@using SteUp.Shared.Core.Interface.System.Network
@using SteUp.Shared.Core.Messages.Ispezione
@using SteUp.Shared.Core.Messages.Scheda
@inject INetworkService NetworkService
@inject IDialogService Dialog
@@ -31,17 +34,24 @@
@if (PlusVisible)
{
<MudFabMenu ButtonClass="custom-plus-button" MenuClass="custom-menu-fab" OnClick="@OnOpenMenu" StartIcon="@Icons.Material.Filled.Add"
IconColor="Color.Primary" Color="Color.Surface" AlignItems="AlignItems.End"
<MudFabMenu ButtonClass="custom-plus-button" MenuClass="custom-menu-fab" OnClick="@OnOpenMenu"
StartIcon="@Icons.Material.Filled.Add"
IconColor="Color.Primary" Color="Color.Surface" AlignItems="AlignItems.End"
Size="Size.Medium" IconSize="Size.Medium">
@if (SchedaVisible)
{
<MudFabMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@NewScheda"
if (ShowCompleteInspection)
{
<MudFabMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@CompleteInspection"
Label="Concludi ispezione" Color="Color.Surface"/>
}
<MudFabMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@NewScheda"
Label="Nuova scheda" Color="Color.Surface"/>
}
else
{
<MudFabMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@NewActivity"
<MudFabMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@NewActivity"
Label="Nuova ispezione" Color="Color.Surface"/>
}
</MudFabMenu>
@@ -53,6 +63,7 @@
{
private bool IsVisible { get; set; } = true;
private bool PlusVisible { get; set; } = true;
private bool ShowCompleteInspection { get; set; }
private bool SchedaVisible { get; set; }
protected override Task OnInitializedAsync()
@@ -81,6 +92,9 @@
_ = ModalHelper.OpenSelectShop(Dialog);
}
private void CompleteInspection() =>
Messenger.Send(new CompleteInspectionMessage());
private async Task NewScheda()
{
var ispezione = SteupDataService.InspectionPageState.Ispezione;
@@ -95,6 +109,7 @@
var location = NavigationManager.Uri.Remove(0, NavigationManager.BaseUri.Length);
SchedaVisible = new List<string> { "ispezione" }.Contains(location);
ShowCompleteInspection = !SteupDataService.InspectionPageState.Ispezione.ActivityId.IsNullOrEmpty();
StateHasChanged();
}
}