Aggiunto messaggio per completamento ispezione

This commit is contained in:
2026-03-02 13:00:35 +01:00
parent 63368748ab
commit 8fbeaf8637
3 changed files with 24 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
@using CommunityToolkit.Mvvm.Messaging
@using SteUp.Shared.Components.SingleElements.MessageBox
@using SteUp.Shared.Core.Messages.Ispezione
@using SteUp.Shared.Core.Messages.Scheda
@inject INetworkService NetworkService
@@ -56,6 +57,9 @@
</nav>
</div>
<ConfirmMessageBox @ref="_messageBox" NoText="No" YesText="Si" YesColor="Color.Primary"
Message="Completando l'ispezione non sarà più possibile editarla o aggiungere ulteriori segnalazioni. Procedere?"/>
@code
{
private bool IsVisible { get; set; } = true;
@@ -63,6 +67,8 @@
private bool ShowCompleteInspection { get; set; }
private bool SchedaVisible { get; set; }
private ConfirmMessageBox _messageBox = null!;
protected override Task OnInitializedAsync()
{
NavigationManager.LocationChanged += (_, args) =>
@@ -96,8 +102,13 @@
}
}
private void CompleteInspection() =>
private async Task CompleteInspection()
{
var result = await _messageBox.ShowAsync();
if (result is true)
Messenger.Send(new CompleteInspectionMessage());
}
private async Task NewScheda()
{

View File

@@ -49,7 +49,8 @@
</div>
<SpinnerOverlay VisibleOverlay="VisibleOverlay"/>
<ConfirmDeleteMessageBox @ref="_deleteMessageBox" Message="Confermi la cancellazione della scheda corrente?"/>
<ConfirmMessageBox @ref="_messageBox" YesText="Cancella" YesColor="Color.Error"
Message="Confermi la cancellazione della scheda corrente?"/>
@code{
[Parameter] public string CodMdep { get; set; } = string.Empty;
@@ -60,7 +61,7 @@
private bool VisibleOverlay { get; set; }
private ConfirmDeleteMessageBox _deleteMessageBox = null!;
private ConfirmMessageBox _messageBox = null!;
private async Task UpdateScheda()
{
@@ -70,7 +71,7 @@
private async Task DeleteScheda()
{
var result = await _deleteMessageBox.ShowAsync();
var result = await _messageBox.ShowAsync();
if (result is true)
{

View File

@@ -1,10 +1,10 @@
<MudMessageBox @ref="_confirmDelete" Title="Attenzione!" CancelText="Annulla">
<MudMessageBox @ref="_confirmDelete" Title="Attenzione!" CancelText="@NoText">
<MessageContent>
@Message
</MessageContent>
<YesButton>
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Error">
Cancella
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="YesColor">
@YesText
</MudButton>
</YesButton>
</MudMessageBox>
@@ -12,6 +12,9 @@
@code
{
[Parameter] public string Message { get; set; } = string.Empty;
[Parameter] public string YesText { get; set; } = string.Empty;
[Parameter] public string NoText { get; set; } = "Annulla";
[Parameter] public Color YesColor { get; set; } = Color.Primary;
private MudMessageBox? _confirmDelete;