Fix e migliorati caricamenti
This commit is contained in:
@@ -4,11 +4,13 @@
|
||||
@using salesbook.Shared.Components.SingleElements
|
||||
@using salesbook.Shared.Components.SingleElements.BottomSheet
|
||||
@using salesbook.Shared.Core.Dto.Activity
|
||||
@using salesbook.Shared.Core.Dto.PageState
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Core.Messages.Activity.New
|
||||
@inject IManageDataService ManageData
|
||||
@inject IJSRuntime JS
|
||||
@inject NewActivityService NewActivity
|
||||
@inject UserListState UserState
|
||||
|
||||
<HeaderLayout Title="@_headerTitle"
|
||||
ShowFilter="true"
|
||||
@@ -168,7 +170,6 @@
|
||||
<FilterActivity @bind-IsSheetVisible="OpenFilter" @bind-Filter="Filter" @bind-Filter:after="ApplyFilter"/>
|
||||
|
||||
@code {
|
||||
|
||||
// Modelli per ottimizzazione rendering
|
||||
private record DayData(DateTime Date, string CssClass, bool HasEvents, CategoryData[] EventCategories, string DayName = "");
|
||||
|
||||
@@ -221,11 +222,20 @@
|
||||
PrepareRenderingData();
|
||||
|
||||
NewActivity.OnActivityCreated += async activityId => await OnActivityCreated(activityId);
|
||||
UserState.OnUsersLoaded += async () => await InvokeAsync(LoadData);
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
if (firstRender && UserState.IsLoaded)
|
||||
{
|
||||
await LoadData();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
Filter.User = new HashSet<string> { UserSession.User.Username };
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
{
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
|
||||
|
||||
await LoadNotification();
|
||||
await CheckAndRequestPermissions();
|
||||
|
||||
@@ -54,9 +56,6 @@
|
||||
private async Task CheckAndRequestPermissions()
|
||||
{
|
||||
await NotificationManager.RequestAccess();
|
||||
|
||||
// if (BatteryOptimizationManagerService.IsBatteryOptimizationEnabled())
|
||||
// BatteryOptimizationManagerService.OpenBatteryOptimizationSettings(_ => { });
|
||||
}
|
||||
|
||||
private Task StartSyncUser()
|
||||
|
||||
@@ -35,7 +35,7 @@ else
|
||||
<div class="container content" style="overflow: auto;" id="topPage">
|
||||
<div class="container-primary-info">
|
||||
<div class="section-primary-info">
|
||||
<MudAvatar Style="height: 70px; width: 70px; font-size: 2rem; font-weight: bold" Color="Color.Secondary">
|
||||
<MudAvatar Style="height: 70px; width: 70px; font-size: 2rem; font-weight: bold" Variant="@(IsContact ? Variant.Filled : Variant.Outlined)" Color="Color.Secondary">
|
||||
@UtilityString.ExtractInitials(Anag.RagSoc)
|
||||
</MudAvatar>
|
||||
|
||||
@@ -55,41 +55,45 @@ else
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="section-info">
|
||||
<div class="section-personal-info">
|
||||
@if (!string.IsNullOrEmpty(Anag.Telefono))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">Telefono</span>
|
||||
<span class="info-text">@Anag.Telefono</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.PartIva))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">P. IVA</span>
|
||||
<span class="info-text">@Anag.PartIva</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="section-personal-info">
|
||||
@if (!string.IsNullOrEmpty(Anag.EMail))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">E-mail</span>
|
||||
<span class="info-text">@Anag.EMail</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Agente != null)
|
||||
{
|
||||
@if (Agente != null)
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">Agente</span>
|
||||
<span class="info-text">@Agente.FullName</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.Telefono))
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">Telefono</span>
|
||||
<span class="info-text">@Anag.Telefono</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.PartIva))
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">P. IVA</span>
|
||||
<span class="info-text">@Anag.PartIva</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.EMail))
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">E-mail</span>
|
||||
<span class="info-text">@Anag.EMail</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -773,7 +777,16 @@ else
|
||||
{
|
||||
var result = await ModalHelpers.OpenUserForm(Dialog, anag);
|
||||
|
||||
if (result is { Canceled: false })
|
||||
if (result is { Canceled: false, Data: not null } && result.Data.GetType() == typeof(AnagClie))
|
||||
{
|
||||
var clie = (AnagClie)result.Data;
|
||||
IsContact = true;
|
||||
CodContact = clie.CodAnag!;
|
||||
|
||||
await LoadAnagAsync();
|
||||
SaveDataToSession();
|
||||
}
|
||||
else if (result is { Canceled: false })
|
||||
{
|
||||
await LoadAnagAsync();
|
||||
SaveDataToSession();
|
||||
|
||||
@@ -39,9 +39,10 @@
|
||||
|
||||
.section-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
padding: .4rem 1.2rem .8rem;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.section-personal-info {
|
||||
|
||||
Reference in New Issue
Block a user