Aggiunto dialog promemoria
This commit is contained in:
@@ -372,7 +372,9 @@
|
||||
filteredActivity = filteredActivity
|
||||
.Where(x => Filter.Category == null || x.Category.Equals(Filter.Category));
|
||||
|
||||
return filteredActivity.ToList();
|
||||
return filteredActivity
|
||||
.OrderBy(x => x.EffectiveTime ?? x.EstimatedTime)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
[JSInvokable]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@using salesbook.Shared.Components.SingleElements
|
||||
@using salesbook.Shared.Components.SingleElements.Modal.ExceptionModal
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<ErrorBoundary @ref="ErrorBoundary">
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<div class="bottom-sheet-backdrop @(IsSheetVisible ? "show" : "")" @onclick="CloseBottomSheet"></div>
|
||||
|
||||
<div class="bottom-sheet-container @(IsSheetVisible ? "show" : "")">
|
||||
<div class="bottom-sheet pb-safe-area">
|
||||
<div class="title">
|
||||
<MudText Typo="Typo.h6">
|
||||
<b>Aggiungi un promemoria</b>
|
||||
</MudText>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="() => CloseBottomSheet()"/>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<span>Data</span>
|
||||
|
||||
<MudTextField T="DateTime?" Format="yyyy-MM-dd" InputType="InputType.Date" @bind-Value="Date" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<MudTextField T="string?" Placeholder="Memo" Variant="Variant.Text" Lines="4" @bind-Value="Memo" />
|
||||
</div>
|
||||
|
||||
<div class="button-section">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="() => CloseBottomSheet(true)">Salva</MudButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public bool IsSheetVisible { get; set; }
|
||||
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
|
||||
|
||||
private DateTime? Date { get; set; } = DateTime.Today;
|
||||
private string? Memo { get; set; }
|
||||
|
||||
private void CloseBottomSheet(bool save)
|
||||
{
|
||||
IsSheetVisible = false;
|
||||
IsSheetVisibleChanged.InvokeAsync(IsSheetVisible);
|
||||
}
|
||||
|
||||
private void CloseBottomSheet() => CloseBottomSheet(false);
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -154,12 +154,26 @@
|
||||
</MudButton>
|
||||
</YesButton>
|
||||
</MudMessageBox>
|
||||
|
||||
<MudMessageBox @ref="ConfirmMemo" Class="c-messageBox" Title="Attenzione!" CancelText="Annulla">
|
||||
<MessageContent>
|
||||
Vuoi creare un promemoria?
|
||||
</MessageContent>
|
||||
<YesButton>
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Filled.DeleteForever">
|
||||
Crea
|
||||
</MudButton>
|
||||
</YesButton>
|
||||
</MudMessageBox>
|
||||
</DialogContent>
|
||||
</MudDialog>
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
|
||||
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeValue"/>
|
||||
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeEsito"/>
|
||||
|
||||
<AddMemo @bind-IsSheetVisible="OpenAddMemo" />
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||
@@ -186,12 +200,17 @@
|
||||
private bool VisibleOverlay { get; set; }
|
||||
private bool SuccessAnimation { get; set; }
|
||||
|
||||
private bool OpenEsito { get; set; } = false;
|
||||
private bool OpenEsito { get; set; }
|
||||
private bool OpenAddMemo { get; set; }
|
||||
|
||||
//MessageBox
|
||||
private MudMessageBox ConfirmDelete { get; set; }
|
||||
private MudMessageBox ConfirmMemo { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
|
||||
_ = LoadData();
|
||||
|
||||
LabelSave = IsNew ? "Aggiungi" : null;
|
||||
@@ -243,7 +262,6 @@
|
||||
private bool CheckPreSave()
|
||||
{
|
||||
Snackbar.Clear();
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
|
||||
if (!ActivityModel.ActivityTypeId.IsNullOrEmpty()) return true;
|
||||
Snackbar.Add("Tipo attività obbligatorio!", Severity.Error);
|
||||
@@ -317,9 +335,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnAfterChangeEsito()
|
||||
{
|
||||
OnAfterChangeValue();
|
||||
|
||||
var result = await ConfirmMemo.ShowAsync();
|
||||
|
||||
if (result is true)
|
||||
OpenAddMemo = !OpenAddMemo;
|
||||
}
|
||||
|
||||
private void OpenSelectEsito()
|
||||
{
|
||||
if (!IsNew && (ActivityModel.UserName is null || !ActivityModel.UserName.Equals(UserSession.User.Username))) return;
|
||||
if (!IsNew && (ActivityModel.UserName is null || !ActivityModel.UserName.Equals(UserSession.User.Username)))
|
||||
{
|
||||
Snackbar.Add("Non puoi inserire un esito per un'attività che non ti è stata assegnata.", Severity.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
OpenEsito = !OpenEsito;
|
||||
StateHasChanged();
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
@using salesbook.Shared.Core.Services
|
||||
@inject AppAuthenticationStateProvider AuthenticationStateProvider
|
||||
|
||||
<div class="container container-modal">
|
||||
<div class="c-modal">
|
||||
<div class="exception-header mb-2">
|
||||
Reference in New Issue
Block a user