1 Commits

Author SHA1 Message Date
ddc596ef58 Native navigation 2025-07-02 14:12:39 +02:00
33 changed files with 199 additions and 290 deletions

View File

@@ -4,17 +4,12 @@ namespace salesbook.Maui
{
public partial class App : Application
{
private readonly IMessenger _messenger;
public App(IMessenger messenger)
{
InitializeComponent();
_messenger = messenger;
}
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new MainPage(_messenger));
MainPage = new NavigationPage(new MainPage(messenger));
}
}
}

View File

@@ -0,0 +1,15 @@
using salesbook.Shared.Core.Interface;
namespace salesbook.Maui.Core.Services;
public class NavigationService(IServiceProvider serviceProvider) : INavigationService
{
public async Task NavigateToDetailsAsync()
{
var detailsPage = serviceProvider.GetService<PersonalInfo>();
if (Application.Current.MainPage is NavigationPage nav && detailsPage != null)
{
await nav.Navigation.PushAsync(detailsPage);
}
}
}

View File

@@ -0,0 +1,18 @@
using salesbook.Shared.Core.Interface;
namespace salesbook.Maui.Core.Services;
public class PageTitleService(IDispatcher dispatcher) : IPageTitleService
{
public void SetTitle(string title)
{
dispatcher.Dispatch(() =>
{
if (Application.Current?.MainPage is NavigationPage nav &&
nav.CurrentPage is ContentPage cp)
{
cp.Title = title;
}
});
}
}

View File

@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:salesbook.Maui"
xmlns:shared="clr-namespace:salesbook.Shared;assembly=salesbook.Shared"
x:Class="salesbook.Maui.MainPage"
BackgroundColor="{DynamicResource PageBackgroundColor}">
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
<BlazorWebView HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type shared:Components.Routes}" />
</BlazorWebView.RootComponents>

View File

@@ -11,6 +11,8 @@ namespace salesbook.Maui
{
InitializeComponent();
_messenger = messenger;
Title = "Home";
}
protected override bool OnBackButtonPressed()

View File

@@ -13,6 +13,7 @@ using salesbook.Shared.Core.Messages.Activity.Copy;
using salesbook.Shared.Core.Messages.Activity.New;
using salesbook.Shared.Core.Messages.Back;
using salesbook.Shared.Core.Services;
using System.Globalization;
namespace salesbook.Maui
{
@@ -24,20 +25,15 @@ namespace salesbook.Maui
{
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("it-IT");
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("it-IT");
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseIntegry(appToken: AppToken, useLoginAzienda: true)
.UseMauiCommunityToolkit()
.UseSentry(options =>
{
options.Dsn = "https://453b6b38f94fd67e40e0d5306d6caff8@o4508499810254848.ingest.de.sentry.io/4509605099667536";
#if DEBUG
options.Debug = true;
#endif
options.TracesSampleRate = 1.0;
})
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); })
.UseLoginAzienda(AppToken);
builder.Services.AddMauiBlazorWebView();
builder.Services.AddMudServices();
@@ -69,6 +65,10 @@ namespace salesbook.Maui
builder.Services.AddSingleton<IFormFactor, FormFactor>();
builder.Services.AddSingleton<LocalDbService>();
builder.Services.AddSingleton<INavigationService, NavigationService>();
builder.Services.AddSingleton<IPageTitleService, PageTitleService>();
builder.Services.AddTransient<PersonalInfo>();
return builder.Build();
}
}

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:components="clr-namespace:salesbook.Shared.Components;assembly=salesbook.Shared"
x:Class="salesbook.Maui.PersonalInfo"
BackgroundColor="{DynamicResource PageBackgroundColor}">
<BlazorWebView HostPage="wwwroot/index.html" StartPath="/PersonalInfo">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type components:Routes}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentPage>

View File

@@ -0,0 +1,11 @@
namespace salesbook.Maui;
public partial class PersonalInfo : ContentPage
{
public PersonalInfo()
{
InitializeComponent();
Title = "Profilo";
}
}

View File

@@ -1,5 +1,6 @@
using Android.App;
using Android.Content.PM;
using AndroidX.AppCompat.App;
namespace salesbook.Maui
{
@@ -9,5 +10,9 @@ namespace salesbook.Maui
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
public MainActivity()
{
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
}
}
}

View File

@@ -35,5 +35,8 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict>
</plist>

View File

@@ -29,8 +29,8 @@
<ApplicationId>it.integry.salesbook</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0.1</ApplicationDisplayVersion>
<ApplicationVersion>4</ApplicationVersion>
<ApplicationDisplayVersion>1.0.0</ApplicationDisplayVersion>
<ApplicationVersion>3</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
@@ -118,15 +118,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="12.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="11.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="IntegryApiClient.MAUI" Version="1.1.6" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.81" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.81" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.81" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.6" />
<PackageReference Include="Sentry.Maui" Version="5.11.2" />
<PackageReference Include="IntegryApiClient.MAUI" Version="1.1.4" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.5" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.70" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.70" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.70" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.5" />
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
</ItemGroup>
@@ -134,4 +133,16 @@
<ProjectReference Include="..\salesbook.Shared\salesbook.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="PersonalInfo.xaml.cs">
<DependentUpon>PersonalInfo.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<MauiXaml Update="PersonalInfo.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
</Project>

View File

@@ -1,4 +1,7 @@
@using Microsoft.Maui.Controls
@using salesbook.Shared.Core.Interface
@inject IJSRuntime JS
@inject INavigationService NavigationService
<div class="@(Back ? "" : "container") header">
<div class="header-content @(Back ? "with-back" : "no-back")">
@@ -83,7 +86,9 @@
await JS.InvokeVoidAsync("goBack");
}
private void OpenPersonalInfo() =>
NavigationManager.NavigateTo("/PersonalInfo");
private async Task OpenPersonalInfo()
{
await NavigationService.NavigateToDetailsAsync();
}
}

View File

@@ -1,10 +1,10 @@
@using System.Globalization
@using CommunityToolkit.Mvvm.Messaging
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Core.Messages.Back
@inherits LayoutComponentBase
@inject IJSRuntime JS
@inject IMessenger Messenger
@inject BackNavigationService BackService
@inject INavigationService NavigationService
<MudThemeProvider Theme="_currentTheme" @ref="@_mudThemeProvider" @bind-IsDarkMode="@IsDarkMode" />
<MudPopoverProvider/>

View File

@@ -1,21 +1,20 @@
@page "/Calendar"
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Components.Layout
@using salesbook.Shared.Components.SingleElements
@using salesbook.Shared.Components.Layout.Spinner
@using salesbook.Shared.Components.SingleElements.BottomSheet
@using salesbook.Shared.Core.Entity
@using salesbook.Shared.Core.Messages.Activity.New
@inject IManageDataService ManageData
@inject IJSRuntime JS
@inject NewActivityService NewActivity
@inject IPageTitleService PageTitleService
<HeaderLayout Title="@_headerTitle"
@* <HeaderLayout Title="@_headerTitle"
ShowFilter="true"
ShowCalendarToggle="true"
OnFilterToggle="ToggleFilter"
OnCalendarToggle="ToggleExpanded"/>
OnCalendarToggle="ToggleExpanded"/> *@
<div @ref="_weekSliderRef" class="container week-slider @(Expanded ? "expanded" : "") @(SliderAnimation)">
@if (Expanded)
@@ -260,6 +259,8 @@
private void PrepareHeaderTitle()
{
_headerTitle = CurrentMonth.ToString("MMMM yyyy", new System.Globalization.CultureInfo("it-IT")).FirstCharToUpper();
PageTitleService?.SetTitle(_headerTitle);
}
private void PrepareEventsCache()
@@ -372,9 +373,7 @@
filteredActivity = filteredActivity
.Where(x => Filter.Category == null || x.Category.Equals(Filter.Category));
return filteredActivity
.OrderBy(x => x.EffectiveTime ?? x.EstimatedTime)
.ToList();
return filteredActivity.ToList();
}
[JSInvokable]

View File

@@ -1,14 +1,19 @@
@page "/Notifications"
@attribute [Authorize]
@using salesbook.Shared.Components.Layout
@using salesbook.Shared.Components.SingleElements
@using salesbook.Shared.Core.Interface
@inject IPageTitleService PageTitleService
<HeaderLayout Title="Notifiche" />
@* <HeaderLayout Title="Notifiche" /> *@
<div class="container">
<NoDataAvailable Text="Nessuna notifica meno recente" />
</div>
@code {
protected override void OnInitialized()
{
PageTitleService?.SetTitle("Notifiche");
}
}

View File

@@ -1,6 +1,5 @@
@page "/PersonalInfo"
@attribute [Authorize]
@using salesbook.Shared.Components.Layout
@using salesbook.Shared.Core.Authorization.Enum
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Core.Services
@@ -8,7 +7,7 @@
@inject INetworkService NetworkService
@inject IFormFactor FormFactor
<HeaderLayout BackTo="Indietro" Back="true" BackOnTop="true" Title="Profilo" ShowProfile="false"/>
@* <HeaderLayout BackTo="Indietro" Back="true" BackOnTop="true" Title="Profilo" ShowProfile="false"/> *@
@if (IsLoggedIn)
{

View File

@@ -68,40 +68,31 @@ else
</div>
</div>
<MudTabs Elevation="2" Rounded="true" PanelClass="pt-6" Style="width: 100%" Centered="true">
<MudTabPanel Text="Contatti">
@if (PersRif is { Count: > 0 })
{
<div class="container-pers-rif">
<Virtualize Items="PersRif" Context="person">
@{
var index = PersRif.IndexOf(person);
var isLast = index == PersRif.Count - 1;
}
<ContactCard Contact="person" />
@if (!isLast)
{
<div class="divider"></div>
}
</Virtualize>
</div>
}
<div class="container-button">
<MudButton Class="button-settings infoText"
FullWidth="true"
Size="Size.Medium"
Variant="Variant.Outlined">
Aggiungi contatto
</MudButton>
</div>
</MudTabPanel>
<MudTabPanel Text="Commesse">
<Virtualize Items="Commesse" Context="commessa">
<CommessaCard Commessa="commessa" />
@if (PersRif is { Count: > 0 })
{
<div class="container-pers-rif">
<Virtualize Items="PersRif" Context="person">
@{
var index = PersRif.IndexOf(person);
var isLast = index == PersRif.Count - 1;
}
<ContactCard Contact="person" />
@if (!isLast)
{
<div class="divider"></div>
}
</Virtualize>
</MudTabPanel>
</MudTabs>
</div>
}
<div class="container-button">
<MudButton Class="button-settings infoText"
FullWidth="true"
Size="Size.Medium"
Variant="Variant.Outlined">
Aggiungi contatto
</MudButton>
</div>
</div>
}
@@ -110,7 +101,6 @@ else
private AnagClie Anag { get; set; } = new();
private List<VtbCliePersRif>? PersRif { get; set; }
private List<JtbComt> Commesse { get; set; }
private bool IsLoading { get; set; } = true;
@@ -123,7 +113,6 @@ else
{
Anag = (await ManageData.GetTable<AnagClie>(x => x.CodAnag.Equals(CodAnag))).Last();
PersRif = await ManageData.GetTable<VtbCliePersRif>(x => x.CodAnag.Equals(Anag.CodAnag));
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag != null && x.CodAnag.Equals(CodAnag));
IsLoading = false;
StateHasChanged();

View File

@@ -1,13 +1,11 @@
@page "/Users"
@attribute [Authorize]
@using salesbook.Shared.Components.Layout
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Core.Entity
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Components.SingleElements.BottomSheet
@inject IManageDataService ManageData
@inject IPageTitleService PageTitleService
<HeaderLayout Title="Contatti" ShowFilter="true" OnFilterToggle="ToggleFilter" />
@* <HeaderLayout Title="Contatti"/> *@
<div class="container search-box">
<div class="input-card clearButton">
@@ -33,16 +31,15 @@
}
</div>
<FilterUsers @bind-IsSheetVisible="OpenFilter" @bind-Filter="Filter" @bind-Filter:after="ApplyFilter"/>
@code {
private List<UserDisplayItem> GroupedUserList { get; set; } = [];
private List<UserDisplayItem> FilteredGroupedUserList { get; set; } = [];
private string? TextToFilter { get; set; }
//Filtri
private bool OpenFilter { get; set; }
private FilterUserDTO Filter { get; set; } = new();
protected override void OnInitialized()
{
PageTitleService?.SetTitle("Contatti");
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
@@ -129,15 +126,4 @@
FilteredGroupedUserList = result;
}
private void ToggleFilter()
{
OpenFilter = !OpenFilter;
StateHasChanged();
}
private void ApplyFilter()
{
}
}

View File

@@ -1,4 +1,4 @@
@using salesbook.Shared.Components.SingleElements.Modal.ExceptionModal
@using salesbook.Shared.Components.SingleElements
@inject NavigationManager NavigationManager
<ErrorBoundary @ref="ErrorBoundary">

View File

@@ -1,45 +0,0 @@
<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);
}

View File

@@ -15,6 +15,12 @@
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="CloseBottomSheet"/>
</div>
<div class="input-card clearButton">
<MudTextField T="string?" Placeholder="Cerca..." Variant="Variant.Text" @bind-Value="Filter.Text" DebounceInterval="500"/>
<MudIconButton Class="closeIcon" Icon="@Icons.Material.Filled.Close" OnClick="() => Filter.Text = null"/>
</div>
<div class="input-card">
<div class="form-container">
<span class="disable-full-width">Assegnata a</span>
@@ -29,7 +35,7 @@
FullWidth="true" T="string"
Variant="Variant.Text"
Virtualize="true"
@bind-SelectedValues="FilterActivity.User"
@bind-SelectedValues="Filter.User"
Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code"/>
@@ -43,7 +49,7 @@
<MudSelectExtended FullWidth="true"
T="string?"
Variant="Variant.Text"
@bind-Value="FilterActivity.Type"
@bind-Value="Filter.Type"
Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code">
@foreach (var type in ActivityType)
@@ -61,7 +67,7 @@
<MudSelectExtended FullWidth="true"
T="string?"
Variant="Variant.Text"
@bind-Value="FilterActivity.Result"
@bind-Value="Filter.Result"
Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code">
@foreach (var result in ActivityResult)
@@ -79,7 +85,7 @@
<MudSelectExtended FullWidth="true"
T="ActivityCategoryEnum?"
Variant="Variant.Text"
@bind-Value="FilterActivity.Category"
@bind-Value="Filter.Category"
Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code">
@foreach (var category in CategoryList)
@@ -91,7 +97,7 @@
</div>
<div class="button-section">
<MudButton OnClick="() => Filter = new FilterUserDTO()" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
<MudButton OnClick="() => Filter = new FilterActivityDTO()" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OnFilterButton">Filtra</MudButton>
</div>
</div>
@@ -101,10 +107,8 @@
[Parameter] public bool IsSheetVisible { get; set; }
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
[Parameter] public FilterUserDTO Filter { get; set; }
[Parameter] public EventCallback<FilterUserDTO> FilterChanged { get; set; }
private FilterActivityDTO FilterActivity { get; set; } = new();
[Parameter] public FilterActivityDTO Filter { get; set; }
[Parameter] public EventCallback<FilterActivityDTO> FilterChanged { get; set; }
private List<StbActivityResult> ActivityResult { get; set; } = [];
private List<StbActivityType> ActivityType { get; set; } = [];

View File

@@ -1,24 +0,0 @@
@using salesbook.Shared.Core.Entity
<div class="activity-card">
<div class="activity-left-section">
<div class="activity-body-section">
<div class="title-section">
<MudText Class="activity-title" Typo="Typo.body1" HtmlTag="h3">@Commessa.Descrizione</MudText>
<div class="activity-hours-section">
<span class="activity-hours">
@Commessa.CodJcom
</span>
</div>
</div>
</div>
</div>
<div class="activity-info-section">
<MudChip T="string" Icon="@IconConstants.Chip.User" Size="Size.Small">Stato</MudChip>
</div>
</div>
@code {
[Parameter] public JtbComt Commessa { get; set; } = new();
}

View File

@@ -1,59 +0,0 @@
.activity-card {
width: 100%;
display: flex;
flex-direction: column;
padding: .5rem .5rem;
border-radius: 12px;
line-height: normal;
box-shadow: var(--custom-box-shadow);
}
.activity-card.memo { border-left: 5px solid var(--mud-palette-info-darken); }
.activity-card.interna { border-left: 5px solid var(--mud-palette-success-darken); }
.activity-card.commessa { border-left: 5px solid var(--mud-palette-warning); }
.activity-left-section {
display: flex;
align-items: center;
margin-left: 4px;
}
.title-section {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
}
.activity-hours {
font-weight: 700;
color: var(--mud-palette-text-primary);
}
.activity-hours-section ::deep .mud-chip { margin: 5px 0 0 !important; }
.activity-body-section {
width: 100%;
display: flex;
flex-direction: column;
}
.title-section ::deep > .activity-title {
font-weight: 800 !important;
margin: 0 !important;
line-height: normal !important;
color: var(--mud-palette-text-primary);
}
.activity-body-section ::deep > .activity-subtitle {
color: var(--mud-palette-gray-darker);
margin: .2rem 0 !important;
line-height: normal !important;
}
.activity-info-section {
display: flex;
flex-wrap: wrap;
}

View File

@@ -1,3 +1,6 @@
@using salesbook.Shared.Core.Services
@inject AppAuthenticationStateProvider AuthenticationStateProvider
<div class="container container-modal">
<div class="c-modal">
<div class="exception-header mb-2">

View File

@@ -149,20 +149,8 @@
</MessageContent>
<YesButton>
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Error"
StartIcon="@Icons.Material.Filled.Check">
Cancella
</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
Cancella
</MudButton>
</YesButton>
</MudMessageBox>
@@ -171,9 +159,7 @@
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeEsito"/>
<AddMemo @bind-IsSheetVisible="OpenAddMemo" />
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeValue"/>
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
@@ -200,17 +186,12 @@
private bool VisibleOverlay { get; set; }
private bool SuccessAnimation { get; set; }
private bool OpenEsito { get; set; }
private bool OpenAddMemo { get; set; }
private bool OpenEsito { get; set; } = false;
//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;
@@ -262,6 +243,7 @@
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);
@@ -335,23 +317,9 @@
}
}
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)))
{
Snackbar.Add("Non puoi inserire un esito per un'attività che non ti è stata assegnata.", Severity.Info);
return;
}
if (!IsNew && (ActivityModel.UserName is null || !ActivityModel.UserName.Equals(UserSession.User.Username))) return;
OpenEsito = !OpenEsito;
StateHasChanged();

View File

@@ -1,5 +0,0 @@
namespace salesbook.Shared.Core.Dto;
public class FilterUserDTO
{
}

View File

@@ -0,0 +1,6 @@
namespace salesbook.Shared.Core.Interface;
public interface INavigationService
{
Task NavigateToDetailsAsync();
}

View File

@@ -0,0 +1,6 @@
namespace salesbook.Shared.Core.Interface;
public interface IPageTitleService
{
void SetTitle(string title);
}

View File

@@ -14,11 +14,12 @@
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="8.2.2" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="IntegryApiClient.Core" Version="1.1.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.6" />
<PackageReference Include="IntegryApiClient.Core" Version="1.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.5" />
<PackageReference Include="Microsoft.Maui.Controls.Core" Version="9.0.70" />
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.12.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.6" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.5" />
<PackageReference Include="MudBlazor" Version="8.6.0" />
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
</ItemGroup>

View File

@@ -22,8 +22,7 @@ builder.Services.AddScoped<IManageDataService, ManageDataService>();
builder.Services.AddScoped<AppAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(provider => provider.GetRequiredService<AppAuthenticationStateProvider>());
const string appToken = "f0484398-1f8b-42f5-ab79-5282c164e1d8";
builder.Services.UseIntegry(appToken: appToken, useLoginAzienda: true);
builder.Services.UseLoginAzienda("f0484398-1f8b-42f5-ab79-5282c164e1d8");
builder.RootComponents.Add<Routes>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

View File

@@ -16,10 +16,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="IntegryApiClient.Blazor" Version="1.1.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.6" />
<PackageReference Include="IntegryApiClient.Blazor" Version="1.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.5" />
</ItemGroup>
<ItemGroup>