45 Commits

Author SHA1 Message Date
c9d7091355 Finish v1.1.0 2025-08-07 09:28:05 +02:00
d90a194a4e v1.1.0 -> 5 2025-08-07 09:28:00 +02:00
de9d415f04 Fix posizione 2025-08-07 09:27:07 +02:00
b561405ddc Fix aggiunta nuova persona di riferimento 2025-08-06 16:00:37 +02:00
c93b0c9bec Fix vari 2025-08-06 12:31:52 +02:00
c003c29d83 Aggiunto agente in fase di creazione/modifica cliente 2025-07-31 16:03:07 +02:00
8dfb163cfa Sistemati filtri 2025-07-31 15:24:45 +02:00
068723f31f Implementata gestione allegati 2025-07-30 18:27:24 +02:00
8ebc6e3b8f Gestito aggiornamento elenco contatti in caso di aggiunta o modifica del prospect / cliente 2025-07-25 14:52:00 +02:00
9c69884cc9 Aggiunta ricerca indirizzo 2025-07-24 15:51:01 +02:00
b34f6cb213 Controllo p.Iva 2025-07-22 09:10:30 +02:00
7bcb0581cc Form persone di riferimento e clienti 2025-07-21 10:08:10 +02:00
b2064ad71e Migliorati form Cliente e PersonaRif 2025-07-16 17:24:41 +02:00
8c521dc81e Gestito elenco clienti e prospect in lista contatti 2025-07-10 12:40:30 +02:00
65e48777e6 Creato form per Clienti/Prospect 2025-07-08 15:33:33 +02:00
bf2e1b65f0 Finish v1.0.1(4) 2025-07-04 15:47:50 +02:00
691c132fb6 Finish v1.0.1(4) 2025-07-04 15:47:49 +02:00
5d292a12ef -> v1.0.1 (4) 2025-07-04 15:47:38 +02:00
60f7d14a72 Vario 2025-07-04 15:43:02 +02:00
5fe41f9445 Aggiornamento librerie 2025-07-03 16:59:44 +02:00
e614c83a5b Aggiunto sentry 2025-07-03 16:50:17 +02:00
c2da42a51b Aggiunto dialog promemoria 2025-07-03 16:50:00 +02:00
ca6be0c0a8 Iniziata implementazione filtri utenti 2025-07-03 11:36:44 +02:00
ddbf9c832e Fix searchBox users 2025-07-02 10:32:01 +02:00
201cfd4bc6 Finish v1.0.0(3) 2025-06-30 15:57:41 +02:00
87264cf3aa -> v1.0.0 (3) 2025-06-30 15:57:32 +02:00
dba3cd0357 Fix 2025-06-30 15:56:46 +02:00
516fcca7cb Finish v1.0.0(2) 2025-06-30 15:50:04 +02:00
453e291827 Finish v1.0.0(2) 2025-06-30 15:50:03 +02:00
443ed95013 -> v1.0.0 (2) 2025-06-30 15:49:58 +02:00
a28b8e2f6c Finish v1.0.0(1) 2025-06-30 15:47:47 +02:00
108fa715f0 Finish v1.0.0(1) 2025-06-30 15:47:45 +02:00
3ad3ec23f0 Fix vari 2025-06-30 15:46:11 +02:00
3f2b7a6bb5 Rename salesbook 2025-06-26 10:08:21 +02:00
a34e673cd2 Cancellazione attività 2025-06-26 09:26:50 +02:00
10c1435dba Vario 2025-06-24 10:56:02 +02:00
a97df74ef4 Migliorie form inserimento 2025-06-20 10:58:58 +02:00
6c789a099e Fix filtri 2025-06-20 09:02:17 +02:00
7f8dae7c7d Non si deve poter inserire un esito su un’attività non assegnata all’utente loggato 2025-06-20 08:59:10 +02:00
51a4c7a971 Iniziata creazione pagina contatti 2025-06-20 08:55:30 +02:00
4608c6764b Aggiunta modifica esito 2025-06-17 14:57:21 +02:00
6600660315 Miglioramenti UI 2025-06-17 12:58:12 +02:00
d6c7742501 Vario 2025-06-16 17:38:48 +02:00
3a374baaba Adeguamento ui per ios 2025-06-16 16:04:55 +02:00
7ca4de628b Completato form attività e filtri 2025-06-16 11:58:49 +02:00
241 changed files with 7060 additions and 2420 deletions

View File

@@ -1,15 +0,0 @@
namespace Template.Maui
{
public partial class App : Application
{
public App()
{
InitializeComponent();
}
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new MainPage());
}
}
}

View File

@@ -1,70 +0,0 @@
using Template.Shared.Core.Interface;
namespace Template.Maui.Core.Services;
public class SyncDbService(IIntegryApiService integryApiService, LocalDbService localDb) : ISyncDbService
{
public async Task GetAndSaveActivity(string? dateFilter)
{
var allActivity = await integryApiService.GetActivity(dateFilter);
if (allActivity is not null)
if (dateFilter is null)
await localDb.InsertAll(allActivity);
else
await localDb.InsertOrUpdate(allActivity);
}
public async Task GetAndSaveCommesse(string? dateFilter)
{
var allCommesse = await integryApiService.GetAllCommesse(dateFilter);
if (allCommesse is not null)
if (dateFilter is null)
await localDb.InsertAll(allCommesse);
else
await localDb.InsertOrUpdate(allCommesse);
}
public async Task GetAndSaveProspect(string? dateFilter)
{
var tasks = new List<Task>();
var taskSyncResponseDto = await integryApiService.GetProspect(dateFilter);
if (taskSyncResponseDto.PtbPros is not null)
tasks.Add(dateFilter is null
? localDb.InsertAll(taskSyncResponseDto.PtbPros)
: localDb.InsertOrUpdate(taskSyncResponseDto.PtbPros));
if (taskSyncResponseDto.PtbProsRif is not null)
tasks.Add(dateFilter is null
? localDb.Insert(taskSyncResponseDto.PtbProsRif)
: localDb.InsertOrUpdate(taskSyncResponseDto.PtbProsRif));
await Task.WhenAll(tasks.AsEnumerable());
}
public async Task GetAndSaveClienti(string? dateFilter)
{
var tasks = new List<Task>();
var taskSyncResponseDto = await integryApiService.GetAnagClie(dateFilter);
if (taskSyncResponseDto.AnagClie is not null)
tasks.Add(dateFilter is null
? localDb.InsertAll(taskSyncResponseDto.AnagClie)
: localDb.InsertOrUpdate(taskSyncResponseDto.AnagClie));
if (taskSyncResponseDto.VtbDest is not null)
tasks.Add(dateFilter is null
? localDb.Insert(taskSyncResponseDto.VtbDest)
: localDb.InsertOrUpdate(taskSyncResponseDto.VtbDest));
if (taskSyncResponseDto.VtbCliePersRif is not null)
tasks.Add(dateFilter is null
? localDb.Insert(taskSyncResponseDto.VtbCliePersRif)
: localDb.InsertOrUpdate(taskSyncResponseDto.VtbCliePersRif));
await Task.WhenAll(tasks.AsEnumerable());
}
}

View File

@@ -1,20 +0,0 @@
using CommunityToolkit.Mvvm.Messaging;
using Template.Shared.Core.Messages;
namespace Template.Maui
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
protected override bool OnBackButtonPressed()
{
WeakReferenceMessenger.Default.Send(new HardwareBackMessage("back"));
return true;
}
}
}

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:usesCleartextTraffic="true" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>

View File

@@ -1,17 +0,0 @@
using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
namespace Template.Maui
{
internal class Program : MauiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
static void Main(string[] args)
{
var app = new Program();
app.Run(args);
}
}
}

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="8" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="maui-application-id-placeholder" exec="Template.Maui.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>maui-application-title-placeholder</label>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<shortcut-list />
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
</manifest>

View File

@@ -1,8 +0,0 @@
<maui:MauiWinUIApplication
x:Class="Template.Maui.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:Template.Maui.WinUI">
</maui:MauiWinUIApplication>

View File

@@ -1,25 +0,0 @@
using Microsoft.UI.Xaml;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Template.Maui.WinUI
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}

View File

@@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<mp:PhoneIdentity PhoneProductId="725421B6-1171-41CC-BE20-94A305E6285E" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>$placeholder$</DisplayName>
<PublisherDisplayName>User Name</PublisherDisplayName>
<Logo>$placeholder$.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="$placeholder$"
Description="$placeholder$"
Square150x150Logo="$placeholder$.png"
Square44x44Logo="$placeholder$.png"
BackgroundColor="transparent">
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
<uap:SplashScreen Image="$placeholder$.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="Template.Maui.WinUI.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
1) Per-Monitor for >= Windows 10 Anniversary Update
2) System < Windows 10 Anniversary Update
-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="456" height="456" fill="#512BD4" />
</svg>

Before

Width:  |  Height:  |  Size: 229 B

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="m 105.50037,281.60863 c -2.70293,0 -5.00091,-0.90042 -6.893127,-2.70209 -1.892214,-1.84778 -2.837901,-4.04181 -2.837901,-6.58209 0,-2.58722 0.945687,-4.80389 2.837901,-6.65167 1.892217,-1.84778 4.190197,-2.77167 6.893127,-2.77167 2.74819,0 5.06798,0.92389 6.96019,2.77167 1.93749,1.84778 2.90581,4.06445 2.90581,6.65167 0,2.54028 -0.96832,4.73431 -2.90581,6.58209 -1.89221,1.80167 -4.212,2.70209 -6.96019,2.70209 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 213.56111,280.08446 H 195.99044 L 149.69953,207.0544 c -1.17121,-1.84778 -2.14037,-3.76515 -2.90581,-5.75126 h -0.40578 c 0.36051,2.12528 0.54076,6.67515 0.54076,13.6496 v 65.13172 h -15.54349 v -99.36009 h 18.71925 l 44.7374,71.29798 c 1.89222,2.95695 3.1087,4.98917 3.64945,6.09751 h 0.26996 c -0.45021,-2.6325 -0.67573,-7.09015 -0.67573,-13.37293 v -64.02256 h 15.47557 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="m 289.25134,280.08446 h -54.40052 v -99.36009 h 52.23835 v 13.99669 h -36.15411 v 28.13085 h 33.31621 v 13.9271 h -33.31621 v 29.37835 h 38.31628 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 366.56466,194.72106 H 338.7222 v 85.3634 h -16.08423 v -85.3634 h -27.77455 v -13.99669 h 71.70124 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="m 105.50037,281.60863 c -2.70293,0 -5.00091,-0.90042 -6.893127,-2.70209 -1.892214,-1.84778 -2.837901,-4.04181 -2.837901,-6.58209 0,-2.58722 0.945687,-4.80389 2.837901,-6.65167 1.892217,-1.84778 4.190197,-2.77167 6.893127,-2.77167 2.74819,0 5.06798,0.92389 6.96019,2.77167 1.93749,1.84778 2.90581,4.06445 2.90581,6.65167 0,2.54028 -0.96832,4.73431 -2.90581,6.58209 -1.89221,1.80167 -4.212,2.70209 -6.96019,2.70209 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 213.56111,280.08446 H 195.99044 L 149.69953,207.0544 c -1.17121,-1.84778 -2.14037,-3.76515 -2.90581,-5.75126 h -0.40578 c 0.36051,2.12528 0.54076,6.67515 0.54076,13.6496 v 65.13172 h -15.54349 v -99.36009 h 18.71925 l 44.7374,71.29798 c 1.89222,2.95695 3.1087,4.98917 3.64945,6.09751 h 0.26996 c -0.45021,-2.6325 -0.67573,-7.09015 -0.67573,-13.37293 v -64.02256 h 15.47557 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="m 289.25134,280.08446 h -54.40052 v -99.36009 h 52.23835 v 13.99669 h -36.15411 v 28.13085 h 33.31621 v 13.9271 h -33.31621 v 29.37835 h 38.31628 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
<path d="M 366.56466,194.72106 H 338.7222 v 85.3634 h -16.08423 v -85.3634 h -27.77455 v -13.99669 h 71.70124 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,52 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<title>Template.Maui</title>
<base href="/" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap" rel="stylesheet">
<link href="_content/Template.Shared/css/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="_content/Template.Shared/css/bootstrap/bootstrap-icons.min.css" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link href="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.css" rel="stylesheet" />
<link rel="stylesheet" href="_content/Template.Shared/css/remixicon/remixicon.css" />
<link rel="stylesheet" href="_content/Template.Shared/css/app.css" />
<link rel="stylesheet" href="_content/Template.Shared/css/default-theme.css" />
<link rel="stylesheet" href="Template.Maui.styles.css" />
<link rel="icon" type="image/png" href="favicon.png" />
</head>
<body>
<div class="status-bar-safe-area"></div>
<div id="app">Loading...</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webview.js" autostart="false"></script>
<script src="_content/Template.Shared/js/bootstrap/bootstrap.bundle.min.js"></script>
<!-- Add chart.js reference if chart components are used in your application. -->
<!--<script src="_content/Template.Shared/js/bootstrap/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
<!--<script src="_content/Template.Shared/js/bootstrap/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
<!-- Add sortable.js reference if SortableList component is used in your application. -->
<!--<script src="_content/Template.Shared/js/bootstrap/Sortable.min.js"></script>-->
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
<script src="_content/Template.Shared/js/main.js"></script>
<script src="_content/Template.Shared/js/calendar.js"></script>
</body>
</html>

View File

@@ -1,82 +0,0 @@
@inject IJSRuntime JS
<div class="container header">
<div class="header-content @(Back ? "with-back" : "no-back")">
@if (Back)
{
<div class="left-section">
<MudButton StartIcon="@(!Cancel ? Icons.Material.Outlined.ArrowBackIosNew : "")"
OnClick="GoBack"
Color="Color.Info"
Style="text-transform: none"
Variant="Variant.Text">
@BackTo
</MudButton>
</div>
}
<h3 class="page-title">@Title</h3>
<div class="right-section">
@if (LabelSave.IsNullOrEmpty())
{
@if (ShowFilter)
{
<MudIconButton Icon="@Icons.Material.Outlined.FilterAlt" Color="Color.Dark"/>
}
@if (ShowNotifications)
{
@* <MudIconButton Icon="@Icons.Material.Filled.Notifications" Color="Color.Dark"/> *@
}
@if (ShowCalendarToggle)
{
<MudIconButton OnClick="OnCalendarToggle" Icon="@Icons.Material.Filled.CalendarMonth" Color="Color.Dark"/>
}
}
else
{
<MudButton OnClick="OnSave"
Color="Color.Info"
Style="text-transform: none"
Variant="Variant.Text">
@LabelSave
</MudButton>
}
</div>
</div>
</div>
@code{
[Parameter] public string? Title { get; set; }
[Parameter] public bool ShowFilter { get; set; }
[Parameter] public bool ShowNotifications { get; set; } = true;
[Parameter] public bool Back { get; set; }
[Parameter] public string BackTo { get; set; } = "";
[Parameter] public bool Cancel { get; set; }
[Parameter] public EventCallback OnCancel { get; set; }
[Parameter] public string? LabelSave { get; set; }
[Parameter] public EventCallback OnSave { get; set; }
[Parameter] public bool ShowCalendarToggle { get; set; }
[Parameter] public EventCallback OnCalendarToggle { get; set; }
protected override void OnParametersSet()
{
Back = !Back ? !Back && Cancel : Back;
BackTo = Cancel ? "Annulla" : BackTo;
}
private async Task GoBack()
{
if (Cancel)
{
await OnCancel.InvokeAsync();
return;
}
await JS.InvokeVoidAsync("goBack");
}
}

View File

@@ -1,29 +0,0 @@
.header-content {
line-height: normal;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
}
.header-content.with-back { margin: .6rem 0 0 0; }
.header-content.with-back .page-title {
position: absolute;
left: 50%;
transform: translateX(-50%);
margin: 0;
font-size: larger;
}
.left-section ::deep button, .right-section ::deep button {
font-size: 1.1rem;
}
.left-section ::deep .mud-button-icon-start {
margin-right: 3px !important;
}
.header-content.no-back .page-title {
margin: 0;
}

View File

@@ -1,41 +0,0 @@
@using Template.Shared.Core.Messages
@inherits LayoutComponentBase
@inject IJSRuntime JS
@inject BackNavigationService BackService
<MudThemeProvider Theme="_currentTheme" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />
<div class="page">
<NavMenu />
<main>
<article>
@Body
</article>
</main>
</div>
@code {
private readonly MudTheme _currentTheme = new()
{
PaletteLight = new PaletteLight()
{
Primary = "#ABA9BF",
Secondary = "#BEB7DF",
Tertiary = "#B2FDAD"
}
};
protected override void OnInitialized()
{
BackService.OnHardwareBack += async () =>
{
await JS.InvokeVoidAsync("goBack");
};
}
}

View File

@@ -1,75 +0,0 @@
@inject IDialogService Dialog
@if (IsVisible)
{
<nav class="navbar navbar-expand justify-content-center">
<div class="container-navbar">
<ul class="navbar-nav nav-justified align-items-center w-100 text-center">
<li class="nav-item">
<NavLink class="nav-link" href="Users" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-group-line"></i>
@* <span>Contatti</span> *@
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="Calendar" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-calendar-todo-line"></i>
@* <span>Agenda</span> *@
</div>
</NavLink>
</li>
<li class="nav-item plus-button">
<MudMenu PopoverClass="custom_popover" AnchorOrigin="Origin.TopCenter" TransformOrigin="Origin.BottomCenter">
<ActivatorContent>
<MudFab Class="custom-plus-button" Color="Color.Primary" Size="Size.Medium" IconSize="Size.Medium" StartIcon="@Icons.Material.Filled.Add"/>
</ActivatorContent>
<ChildContent>
<MudMenuItem Disabled="true">Nuovo contatto</MudMenuItem>
<MudMenuItem OnClick="() => ModalHelpers.OpenActivityForm(Dialog)">Nuova attivit<69></MudMenuItem>
</ChildContent>
</MudMenu>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="Notification" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-notification-4-line"></i>
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="PersonalInfo" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-user-line"></i>
@* <span>Profilo</span> *@
</div>
</NavLink>
</li>
</ul>
</div>
</nav>
}
@code
{
private bool IsVisible { get; set; } = true;
protected override Task OnInitializedAsync()
{
NavigationManager.LocationChanged += (_, args) =>
{
var location = args.Location.Remove(0, NavigationManager.BaseUri.Length);
IsVisible = new List<string> { "Calendar", "Users", "PersonalInfo" }
.Contains(location);
StateHasChanged();
};
return Task.CompletedTask;
}
}

View File

@@ -1,131 +0,0 @@
@using Template.Shared.Core.Dto
@using Template.Shared.Components.Layout
@using Template.Shared.Core.Interface
@inject IManageDataService manageData
<MudDialog Class="customDialog-form">
<DialogContent>
<HeaderLayout Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" ShowNotifications="false" Title="@(IsNew ? "Nuova" : $"{ActivityModel.ActivityId}")" />
<div class="content">
<div class="input-card">
<MudTextField T="string?" Placeholder="Descrizione" Variant="Variant.Text" Lines="3" @bind-Value="ActivityModel.ActivityDescription" @bind-Value:after="OnAfterChangeValue" />
</div>
<div class="input-card">
<div class="form-container">
<MudInput T="string?" Placeholder="Cliente" @bind-Value="ActivityModel.Cliente" @bind-Value:after="OnAfterChangeValue" />
</div>
<div class="divider"></div>
<div class="form-container">
<MudInput T="string?" Placeholder="Commessa" @bind-Value="ActivityModel.Commessa" @bind-Value:after="OnAfterChangeValue" />
</div>
</div>
<div class="input-card">
<div class="form-container">
<span>Inizio</span>
<MudTextField T="DateTime?" Format="yyyy-MM-ddTHH:mm" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedTime" @bind-Value:after="OnAfterChangeValue" />
</div>
<div class="divider"></div>
<div class="form-container">
<span>Fine</span>
<MudTextField T="DateTime?" Format="yyyy-MM-ddTHH:mm" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedEndtime" @bind-Value:after="OnAfterChangeValue" />
</div>
<div class="divider"></div>
<div class="form-container">
<span>Avviso</span>
<MudSwitch T="bool" Disabled="true" Color="Color.Primary" />
</div>
</div>
<div class="input-card">
<div class="form-container text-align-end">
<span>Assegnata a</span>
<MudInput T="string" Placeholder="Nessuno" @bind-Value="ActivityModel.UserName" @bind-Value:after="OnAfterChangeValue" />
</div>
<div class="divider"></div>
<div class="form-container">
<span>Tipo</span>
<MudSelect T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
@foreach (var state in ActivityResult)
{
<MudSelectItem Value="@state">@state</MudSelectItem>
}
</MudSelect>
</div>
<div class="divider"></div>
<div class="form-container">
<span>Esito</span>
<MudSelect T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityResultId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
@foreach (var state in ActivityResult)
{
<MudSelectItem Value="@state">@state</MudSelectItem>
}
</MudSelect>
</div>
</div>
<div class="input-card">
<MudTextField T="string?" Placeholder="Note" Variant="Variant.Text" Lines="4" @bind-Value="ActivityModel.Note" @bind-Value:after="OnAfterChangeValue" />
</div>
</div>
</DialogContent>
</MudDialog>
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
[Parameter] public string? Id { get; set; }
private ActivityDTO OriginalModel { get; set; } = new();
private ActivityDTO ActivityModel { get; set; } = new();
private List<ActivityResultDTO> ActivityResult { get; set; } = [];
private bool IsNew => Id.IsNullOrEmpty();
private bool _selectEstimatedTime;
private bool _selectEstimatedEndTime;
private string? LabelSave { get; set; }
protected override async Task OnInitializedAsync()
{
LabelSave = IsNew ? "Aggiungi" : null;
if (!Id.IsNullOrEmpty())
ActivityModel = (await manageData.GetActivity(x => x.ActivityId.Equals(Id))).Last();
if (IsNew)
{
ActivityModel.EstimatedTime = DateTime.Today.Add(TimeSpan.FromHours(DateTime.Now.Hour));
ActivityModel.EstimatedEndtime = DateTime.Today.Add(TimeSpan.FromHours(DateTime.Now.Hour) + TimeSpan.FromHours(1));
}
OriginalModel = ActivityModel.Clone();
}
private void OnAfterChangeValue()
{
if (OriginalModel.Equals(ActivityModel))
LabelSave = "Aggiorna";
StateHasChanged();
}
}

View File

@@ -1,61 +0,0 @@
.customDialog-form .content ::deep {
height: calc(100vh - (.6rem + 40px));
overflow: auto;
-ms-overflow-style: none;
scrollbar-width: none;
}
.customDialog-form .content::-webkit-scrollbar {
display: none;
}
.input-card {
width: 100%;
background: var(--mud-palette-background-gray);
border-radius: 9px;
padding: .5rem 1rem;
margin-bottom: 1.5rem;
}
.input-card ::deep > .divider { margin: 0 !important; }
.form-container {
display: flex;
justify-content: space-between;
align-items: center;
min-height: 35px;
}
.form-container > span {
font-weight: 600;
width: 50%;
}
.dateTime-picker {
display: flex;
gap: .3rem;
flex-direction: row;
align-items: center;
}
/*Custom mudBlazor*/
.form-container ::deep .mud-input.mud-input-underline:before { border-bottom: none !important; }
.form-container ::deep .mud-input.mud-input-underline:after { border-bottom: none !important; }
.form-container.text-align-end ::deep .mud-input-slot { text-align: end; }
.input-card ::deep .mud-input.mud-input-underline:before { border-bottom: none !important; }
.input-card ::deep .mud-input.mud-input-underline:after { border-bottom: none !important; }
.form-container ::deep .customIcon-select .mud-icon-root.mud-svg-icon {
rotate: 90deg !important;
font-size: 1.1rem;
}
.input-card ::deep .mud-input {
width: 100%;
font-weight: 500;
}

View File

@@ -1,309 +0,0 @@
@page "/Calendar"
@using Template.Shared.Core.Dto
@using Template.Shared.Core.Interface
@using Template.Shared.Components.Layout
@using Template.Shared.Components.SingleElements
@using Template.Shared.Components.Layout.Spinner
@inject IManageDataService manageData
@inject IDialogService Dialog
@inject IJSRuntime JS
<HeaderLayout Title="@CurrentMonth.ToString("MMMM yyyy", new System.Globalization.CultureInfo("it-IT")).FirstCharToUpper()"
ShowFilter="true"
ShowCalendarToggle="true"
OnCalendarToggle="ToggleExpanded"/>
<div @ref="weekSliderRef" class="container week-slider @(Expanded ? "expanded" : "") @(SliderAnimation)">
@if (Expanded)
{
<!-- Vista mensile -->
@foreach (var nomeGiorno in GiorniSettimana)
{
<div class="week-day">
<div>@nomeGiorno</div>
</div>
}
@foreach (var unused in Enumerable.Range(0, StartOffset))
{
<div class="day" style="visibility: hidden"></div>
}
@for (var d = 1; d <= DaysInMonth; d++)
{
var day = new DateTime(CurrentMonth.Year, CurrentMonth.Month, d);
var isSelected = IsSameDay(day, SelectedDate);
var isToday = IsSameDay(day, DateTime.Today);
var events = GetEventsForDay(day);
<div class="day @(isSelected ? "selected" : (isToday ? "today" : ""))"
@onclick="() => SelezionaDataDalMese(day)">
<div>@d</div>
@if (events.Any())
{
<div class="event-dot-container" style="margin-top: 2px;">
@foreach (var cat in events.Select(x => x.Category).Distinct())
{
<div class="event-dot @cat.ConvertToHumanReadable()" title="@cat.ConvertToHumanReadable()"></div>
}
</div>
}
</div>
}
@foreach (var unused in Enumerable.Range(0, EndOffset))
{
<div class="day" style="visibility: hidden"></div>
}
}
else
{
<!-- Vista settimanale -->
@foreach (var day in DaysOfWeek)
{
var isSelected = IsSameDay(day, SelectedDate);
var isToday = IsSameDay(day, DateTime.Today);
<div class="week-day">
<div>@day.ToString("ddd", new System.Globalization.CultureInfo("it-IT"))</div>
<div class="day @(isSelected ? "selected" : (isToday ? "today" : ""))"
@onclick="() => SelezionaData(day)">
<div>@day.Day</div>
@if (GetEventsForDay(day).Any())
{
<div class="event-dot-container" style="margin-top: 2px;">
@foreach (var cat in GetEventsForDay(day).Select(x => x.Category).Distinct())
{
<div class="event-dot @cat.ConvertToHumanReadable()" title="@cat.ConvertToHumanReadable()"></div>
}
</div>
}
</div>
</div>
}
}
</div>
<div class="container appointments">
@if (IsLoading)
{
<SpinnerLayout FullScreen="false"/>
}
else if (FilteredActivities is { Count: > 0 })
{
<Virtualize Items="FilteredActivities" Context="activity">
<ActivityCard Activity="activity" />
</Virtualize>
}
else
{
<NoDataAvailable Text="Nessuna attività trovata" ImageSource="_content/Template.Shared/images/undraw_file-search_cbur.svg"/>
}
</div>
@code {
// Stato UI
private bool Expanded { get; set; } = false;
private string SliderAnimation { get; set; } = string.Empty;
private ElementReference weekSliderRef;
private DotNetObjectReference<Calendar>? dotNetHelper;
// Stato calendario
private DateTime SelectedDate { get; set; } = DateTime.Today;
private DateTime _internalMonth = DateTime.Today;
private DateTime CurrentMonth => new(_internalMonth.Year, _internalMonth.Month, 1);
// Stato attività
private List<ActivityDTO> MonthActivities { get; set; } = [];
private List<ActivityDTO> FilteredActivities { get; set; } = [];
private bool IsLoading { get; set; } = true;
// Supporto rendering mese
private static readonly string[] GiorniSettimana = ["Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"];
private int DaysInMonth => DateTime.DaysInMonth(CurrentMonth.Year, CurrentMonth.Month);
private int StartOffset => (int)CurrentMonth.DayOfWeek == 0 ? 6 : (int)CurrentMonth.DayOfWeek - 1;
private int EndOffset
{
get
{
var totalCells = (int)Math.Ceiling((DaysInMonth + StartOffset) / 7.0) * 7;
return totalCells - (DaysInMonth + StartOffset);
}
}
// Supporto rendering settimana
private IEnumerable<DateTime> DaysOfWeek
{
get
{
var start = GetStartOfWeek(SelectedDate);
return Enumerable.Range(0, 7).Select(i => start.AddDays(i));
}
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
dotNetHelper = DotNetObjectReference.Create(this);
await JS.InvokeVoidAsync("calendarSwipe.register", weekSliderRef, dotNetHelper);
_internalMonth = new DateTime(SelectedDate.Year, SelectedDate.Month, 1);
await LoadMonthData();
}
}
[JSInvokable]
public async Task OnSwipeLeft()
{
await CambiaPeriodo(1);
StateHasChanged();
if (Expanded)
{
await LoadMonthData();
}
}
[JSInvokable]
public async Task OnSwipeRight()
{
await CambiaPeriodo(-1);
StateHasChanged();
if (Expanded)
{
await LoadMonthData();
}
}
[JSInvokable]
public async Task OnSwipeDown()
{
if (!Expanded)
ToggleExpanded();
}
[JSInvokable]
public async Task OnSwipeUp()
{
if (Expanded)
ToggleExpanded();
}
// Cambio periodo mese/settimana
private async Task CambiaPeriodo(int direzione)
{
if (Expanded)
{
// Cambio solo il mese visualizzato, NON cambiare SelectedDate
var y = CurrentMonth.Year;
var m = CurrentMonth.Month + direzione;
if (m < 1)
{
y--;
m = 12;
}
if (m > 12)
{
y++;
m = 1;
}
_internalMonth = new DateTime(y, m, 1);
}
else
{
// Cambio settimana: aggiorno anche il giorno selezionato
await SelezionaData(SelectedDate.AddDays(7 * direzione));
_internalMonth = new DateTime(SelectedDate.Year, SelectedDate.Month, 1);
}
}
// Cambio modalità
private void ToggleExpanded()
{
if (Expanded)
{
SliderAnimation = "collapse-animation";
StateHasChanged();
Expanded = false;
}
else
{
Expanded = true;
SliderAnimation = "expand-animation";
StateHasChanged();
}
SliderAnimation = "";
StateHasChanged();
}
// Caricamento attività al cambio mese
private async Task LoadMonthData()
{
IsLoading = true;
StateHasChanged();
// Carica tutte le attività del mese corrente visualizzato
var start = CurrentMonth;
var end = start.AddDays(DaysInMonth - 1);
var activities = await manageData.GetActivity(x =>
(x.EffectiveDate == null && x.EstimatedDate >= start && x.EstimatedDate <= end) ||
(x.EffectiveDate >= start && x.EffectiveDate <= end));
MonthActivities = activities.OrderBy(x => x.EffectiveDate ?? x.EstimatedDate).ToList();
IsLoading = false;
StateHasChanged();
}
// Selezione giorno in settimana
private async Task SelezionaData(DateTime day)
{
SelectedDate = day;
StateHasChanged();
var cacheInternalMonth = _internalMonth;
_internalMonth = new DateTime(day.Year, day.Month, 1);
if (cacheInternalMonth != _internalMonth)
{
await LoadMonthData();
}
FilteredActivities = GetEventsForDay(day);
StateHasChanged();
}
// Selezione giorno dal mese (chiude la vista mese!)
private async Task SelezionaDataDalMese(DateTime day)
{
SelectedDate = day;
FilteredActivities = GetEventsForDay(day);
// Chiudi la vista mese e passa alla settimana, con animazione
SliderAnimation = "collapse-animation";
StateHasChanged();
Expanded = false;
_internalMonth = new DateTime(day.Year, day.Month, 1); // Sync il mese visualizzato
SliderAnimation = "";
StateHasChanged();
}
// Utility
private static bool IsSameDay(DateTime d1, DateTime d2) => d1.Date == d2.Date;
private static DateTime GetStartOfWeek(DateTime date)
{
var day = date.DayOfWeek == DayOfWeek.Sunday ? 7 : (int)date.DayOfWeek;
return date.AddDays(-day + 1).Date;
}
private List<ActivityDTO> GetEventsForDay(DateTime day)
=> MonthActivities?.Where(x => (x.EffectiveDate ?? x.EstimatedDate) == day.Date).ToList() ?? [];
public void Dispose()
{
dotNetHelper?.Dispose();
}
}

View File

@@ -1,65 +0,0 @@
.center-box {
margin-top: -1.1rem !important; /* remove page padding */
}
.box-area {
width: 930px;
}
.right-box {
padding: 15px 30px 0 30px;
}
::placeholder {
font-size: 16px;
}
.rounded-4 {
border-radius: 20px;
}
.rounded-5 {
border-radius: 30px;
}
.bg-white {
background: var(--mud-palette-surface) !important;
}
.appName {
margin-top: 15px;
font-size: large;
font-weight: 900;
color: var(--mud-palette-primary)
}
.button-login {
text-align: center;
background-color: var(--mud-palette-primary);
border-radius: 6px;
padding: .3rem 2rem;
width: 100%;
font-weight: 700;
color: var(--mud-palette-appbar-text);
}
.login-footer {
display: flex;
align-items: center;
justify-content: flex-end;
}
.login-footer span {
font-size: 9px;
color: var(--mud-palette-gray-darker);
}
.login-footer img {
height: 15px;
margin-left: 4px;
}
.container > .bg-white {
box-shadow: var(--card-shadow);
border: 1px solid var(--card-border-color);
}

View File

@@ -1,155 +0,0 @@
@page "/PersonalInfo"
@attribute [Authorize]
@using Template.Shared.Components.Layout
@using Template.Shared.Core.Authorization.Enum
@using Template.Shared.Core.Interface
@using Template.Shared.Core.Services
@inject AppAuthenticationStateProvider AuthenticationStateProvider
@inject INetworkService NetworkService
@inject IFormFactor FormFactor
<HeaderLayout Title="Profilo"/>
<div class="container content">
<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">
@UtilityString.ExtractInitials(UserSession.User.Fullname)
</MudAvatar>
<div class="personal-info">
<span class="info-nome">@UserSession.User.Fullname</span>
@if (UserSession.User.KeyGroup is not null)
{
<span class="info-section">@(((KeyGroupEnum)UserSession.User.KeyGroup).ConvertToHumanReadable())</span>
}
</div>
</div>
<div class="divider"></div>
<div class="section-info">
<div class="section-personal-info">
<div>
<span class="info-title">Telefono</span>
<span class="info-text">000 0000000</span> @*Todo: to implement*@
</div>
<div>
<span class="info-title">Status</span>
@if (NetworkService.IsNetworkAvailable())
{
<div class="status online">
<i class="ri-wifi-line"></i>
<span>Online</span>
</div>
}
else
{
<div class="status offline">
<i class="ri-wifi-off-line"></i>
<span>Offline</span>
</div>
}
</div>
</div>
<div class="section-personal-info">
<div>
<span class="info-title">E-mail</span>
<span class="info-text">
@if (string.IsNullOrEmpty(UserSession.User.Email))
{
@("Nessuna mail configurata")
}
else
{
@UserSession.User.Email
}
</span>
</div>
<div>
<span class="info-title">Ultima sincronizzazione</span>
<span class="info-text">@LastSync.ToString("g")</span>
</div>
</div>
</div>
</div>
<div class="container-button">
<MudButton Class="button-settings green-icon"
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
Size="Size.Medium"
OnClick="() => UpdateDb(true)"
Variant="Variant.Outlined">
Sincronizza
</MudButton>
<div class="divider"></div>
<MudButton Class="button-settings red-icon"
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
Size="Size.Medium"
OnClick="() => UpdateDb()"
Variant="Variant.Outlined">
Ripristina dati
</MudButton>
</div>
<div class="container-button">
<MudButton Class="button-settings exit"
FullWidth="true"
Color="Color.Error"
Size="Size.Medium"
OnClick="Logout"
Variant="Variant.Outlined">
Esci
</MudButton>
</div>
</div>
@code {
private bool Unavailable { get; set; }
private DateTime LastSync { get; set; }
protected override async Task OnInitializedAsync()
{
await LoadData();
}
private async Task LoadData()
{
await Task.Run(() =>
{
Unavailable = FormFactor.IsWeb() || !NetworkService.IsNetworkAvailable();
LastSync = LocalStorage.Get<DateTime>("last-sync");
});
StateHasChanged();
}
private void OpenSettings() =>
NavigationManager.NavigateTo("/settings/Profilo");
private void Logout() =>
AuthenticationStateProvider.SignOut();
private void UpdateDb(bool withData = false)
{
var absoluteUri = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
var pathAndQuery = absoluteUri.Segments.Length > 1 ? absoluteUri.PathAndQuery : null;
string path;
if (withData)
path = pathAndQuery == null ? $"/sync/{DateTime.Today:yyyy-MM-dd}" : $"/sync/{DateTime.Today:yyyy-MM-dd}?path=" + System.Web.HttpUtility.UrlEncode(pathAndQuery);
else
path = pathAndQuery == null ? "/sync" : "/sync?path=" + System.Web.HttpUtility.UrlEncode(pathAndQuery);
NavigationManager.NavigateTo(path, replace: true);
}
}

View File

@@ -1,9 +0,0 @@
@page "/Users"
@attribute [Authorize]
@using Template.Shared.Components.Layout
<HeaderLayout Title="Contatti" />
@code {
}

View File

@@ -1,73 +0,0 @@
@using Template.Shared.Core.Dto
@using Template.Shared.Core.Interface
@using Template.Shared.Components.Layout.Spinner
@inject IManageDataService manageData
<div class="calendar">
@if (Load)
{
<SpinnerLayout FullScreen="false" />
}
else
{
@if (!Activities.IsNullOrEmpty())
{
@foreach (var activity in Activities!)
{
<ActivityCard Activity="activity"/>
}
}
else
{
<NoDataAvailable Text="Nessuna attività trovata" ImageSource="_content/Template.Shared/images/undraw_file-search_cbur.svg"/>
}
}
</div>
@code
{
[Parameter] public required DateTime? Date { get; set; }
[Parameter] public EventCallback<DateTime?> DateChanged { get; set; }
private List<ActivityDTO>? Activities { get; set; }
private bool Load { get; set; } = true;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await LoadData();
}
}
protected override async Task OnParametersSetAsync()
{
await LoadData();
}
private async Task LoadData()
{
Load = true;
StateHasChanged();
await Task.Delay(500);
var refreshActivity = await RefreshActivity();
Activities = refreshActivity;
Load = false;
StateHasChanged();
}
private async Task<List<ActivityDTO>> RefreshActivity()
{
var activityDto = await Task.Run(async () =>
{
return (await manageData.GetActivity(x =>
(x.EffectiveDate == null && x.EstimatedDate.Equals(Date)) || x.EffectiveDate.Equals(Date)))
.OrderBy(x => x.EffectiveDate ?? x.EstimatedDate)
.ToList();
});
return activityDto;
}
}

View File

@@ -1,17 +0,0 @@
.calendar {
width: 100%;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
gap: 1rem;
overflow-y: auto;
overflow-x: hidden;
padding-bottom: 1rem;
}
.calendar::-webkit-scrollbar { display: none; }
.calendar {
-ms-overflow-style: none;
scrollbar-width: none;
}

View File

@@ -1,150 +0,0 @@
@using Template.Shared.Core.Dto
@using Template.Shared.Core.Interface
@inject IManageDataService manageData
<div class="calendar-activity">
<div class="calendar">
@foreach (var nomeGiorno in _giorniSettimana)
{
<div class="calendar-header">@nomeGiorno</div>
}
@for (var i = 0; i < StartDays; i++)
{
<div class="calendar-day disabled @(i == 0 ? "radiusTopLeft" : "")"></div>
}
@for (var day = 1; day <= DaysInMonth; day++)
{
var currentDate = new DateTime(Date.Year, Date.Month, day);
var events = GetEventsForDay(currentDate);
var daySelected = SelectedDate == currentDate;
var isToday = currentDate == DateTime.Today;
var topRight = StartDays == 0 ? 7 : 7 - StartDays;
var bottomLeft = DaysInMonth - (6 - EndDays);
var categoryActivityCount = events.Select(x => x.Category).Distinct().ToList();
<div @onclick="() => SelectDay(currentDate)" class="calendar-day @(isToday ? "today" : daySelected ? "selectedDay" : "")
@(StartDays == 0 && day == 1 ? "radiusTopLeft" : "")
@(EndDays == 0 && day == DaysInMonth ? "radiusBottomRight" : "")
@(bottomLeft == day ? "radiusBottomLeft" : "")
@(topRight == day ? "radiusTopRight" : "")">
<div class="calendar-day-wrapper">
<span class="titleDay">@day</span>
@if (events.Any())
{
<div class="event-dot-container">
@foreach (var activityCategory in categoryActivityCount)
{
<div class="event-dot @activityCategory.ConvertToHumanReadable()"></div>
}
</div>
}
</div>
</div>
}
@for (var i = 0; i < EndDays; i++)
{
<div class="calendar-day disabled @(i + 1 == EndDays ? "radiusBottomRight" : "")"></div>
}
</div>
<div class="activityContainer">
@if (!FilteredActivityList.IsNullOrEmpty())
{
@foreach (var activity in FilteredActivityList!)
{
<ActivityCard Activity="activity"/>
}
}
</div>
</div>
@code
{
[Parameter] public required DateTime Date { get; set; }
[Parameter] public EventCallback<DateTime> DateChanged { get; set; }
private List<ActivityDTO> ActivityList { get; set; } = [];
private List<ActivityDTO> FilteredActivityList { get; set; } = [];
private DateTime SelectedDate { get; set; } = DateTime.Today;
private int DaysInMonth { get; set; }
private int StartDays { get; set; }
private int EndDays { get; set; }
readonly string[] _giorniSettimana = ["Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"];
protected override async Task OnInitializedAsync()
{
await ChangeMonth();
}
protected override async Task OnParametersSetAsync()
{
await ChangeMonth();
}
private async Task ChangeMonth()
{
var firstDay = Date;
DaysInMonth = DateTime.DaysInMonth(firstDay.Year, firstDay.Month);
var dayOfWeek = (int)firstDay.DayOfWeek;
StartDays = dayOfWeek == 0 ? 6 : dayOfWeek - 1;
var tempTotalCell = (int)Math.Ceiling((double)(DaysInMonth + StartDays) / 7);
var totalCell = tempTotalCell * 7;
EndDays = totalCell - (DaysInMonth + StartDays);
await LoadData();
}
private async Task LoadData()
{
// Load = true;
// StateHasChanged();
await Task.Delay(500);
var refreshActivity = await RefreshActivity();
ActivityList = refreshActivity;
// Load = false;
StateHasChanged();
}
private async Task<List<ActivityDTO>> RefreshActivity()
{
var startDate = Date;
var endDate = Date.AddDays(DateTime.DaysInMonth(startDate.Year, startDate.Month) - 1);
var dateRange = new DateRange(Date, endDate);
var activityDto = await Task.Run(async () =>
{
return (await manageData.GetActivity(x =>
(x.EffectiveDate == null && x.EstimatedDate >= dateRange.Start && x.EstimatedDate <= dateRange.End) ||
(x.EffectiveDate >= dateRange.Start && x.EffectiveDate <= dateRange.End)
))
.OrderBy(x => x.EffectiveDate ?? x.EstimatedDate)
.ToList();
});
return activityDto;
}
private List<ActivityDTO> GetEventsForDay(DateTime day)
{
return ActivityList.IsNullOrEmpty() ? [] : ActivityList.Where(x => (x.EffectiveDate ?? x.EstimatedDate) == day.Date).ToList();
}
private void SelectDay(DateTime currentDate)
{
SelectedDate = currentDate;
StateHasChanged();
FilteredActivityList = GetEventsForDay(currentDate);
}
}

View File

@@ -1,101 +0,0 @@
.calendar {
display: grid;
grid-template-columns: repeat(7, 1fr);
}
.calendar-header, .calendar-day {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
min-height: 65px;
font-size: 0.85rem;
padding: 4px;
}
.calendar-day { border: 1px solid var(--mud-palette-gray-light); }
.calendar-day.disabled { border: 1px solid hsl(from var(--mud-palette-gray-light) h s 88%); }
.calendar-header {
font-weight: bold;
min-height: 25px;
display: flex;
justify-content: end;
}
.today > .calendar-day-wrapper > .titleDay {
background-color: var(--mud-palette-primary);
color: var(--mud-palette-appbar-text);
font-weight: 700;
}
.selectedDay > .calendar-day-wrapper > .titleDay {
border: 1px solid var(--mud-palette-primary);
font-weight: 700;
}
.calendar-day-wrapper > .titleDay {
padding: 6px;
border-radius: 50%;
position: absolute;
line-height: normal;
}
.event-dot-container {
position: absolute;
bottom: 0;
width: 100%;
display: flex;
flex-direction: column;
gap: .2rem;
}
.event-dot {
width: 100%;
height: 6px;
border-radius: 4px;
background-color: var(--mud-palette-secondary);
}
.event-dot.memo { background-color: var(--mud-palette-info-darken); }
.event-dot.interna { background-color: var(--mud-palette-success-darken); }
.event-dot.commessa { background-color: var(--mud-palette-warning); }
.calendar-day:hover .event-popup { display: block; }
.calendar-day-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.radiusTopLeft { border-top-left-radius: 12px; }
.radiusTopRight { border-top-right-radius: 12px; }
.radiusBottomLeft { border-bottom-left-radius: 12px; }
.radiusBottomRight { border-bottom-right-radius: 12px; }
.activityContainer { margin-top: 1rem; }
.calendar-activity {
width: 100%;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
gap: 1rem;
overflow-y: auto;
overflow-x: hidden;
padding-bottom: 1rem;
}
.calendar-activity::-webkit-scrollbar { display: none; }
.calendar-activity {
-ms-overflow-style: none;
scrollbar-width: none;
}

View File

@@ -1,88 +0,0 @@
@using Template.Shared.Core.Dto
@using Template.Shared.Core.Interface
@using Template.Shared.Components.Layout.Spinner
@inject IManageDataService manageData
<div class="calendar">
@{
DateTime? currentDate = null;
}
@if (Load)
{
<SpinnerLayout FullScreen="false"/>
}
else
{
@if (!Activities.IsNullOrEmpty())
{
foreach (var activity in Activities!)
{
var dateToShow = activity.EffectiveDate ?? activity.EstimatedDate;
if (currentDate != dateToShow?.Date)
{
currentDate = dateToShow?.Date;
<div class="week-info">
<span>@($"{currentDate:D}")</span>
</div>
}
<ActivityCard Activity="activity"/>
}
}
else
{
<NoDataAvailable Text="Nessuna attività trovata" ImageSource="_content/Template.Shared/images/undraw_file-search_cbur.svg"/>
}
}
</div>
@code
{
[Parameter] public required DateRange Date { get; set; }
[Parameter] public EventCallback<DateRange> DateChanged { get; set; }
private List<ActivityDTO>? Activities { get; set; }
private bool Load { get; set; } = true;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await LoadData();
}
}
protected override async Task OnParametersSetAsync()
{
await LoadData();
}
private async Task LoadData()
{
Load = true;
StateHasChanged();
await Task.Delay(500);
var refreshActivity = await RefreshActivity();
Activities = refreshActivity;
Load = false;
StateHasChanged();
}
private async Task<List<ActivityDTO>> RefreshActivity()
{
var activityDto = await Task.Run(async () =>
{
return (await manageData.GetActivity(x =>
(x.EffectiveDate == null && x.EstimatedDate >= Date.Start && x.EstimatedDate <= Date.End) ||
(x.EffectiveDate >= Date.Start && x.EffectiveDate <= Date.End)
))
.OrderBy(x => x.EffectiveDate ?? x.EstimatedDate)
.ToList();
});
return activityDto;
}
}

View File

@@ -1,26 +0,0 @@
.calendar {
width: 100%;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
gap: 1rem;
overflow-y: auto;
overflow-x: hidden;
padding-bottom: 1rem;
}
.calendar::-webkit-scrollbar { display: none; }
.calendar {
-ms-overflow-style: none;
scrollbar-width: none;
}
.week-info {
background: var(--mud-palette-action-disabled-background);
width: 100%;
padding: .3rem .5rem;
border-radius: 8px;
text-transform: capitalize;
font-weight: 700;
}

View File

@@ -1,12 +0,0 @@
.no-data {
margin-top: 2rem;
width: calc(100vw - (var(--bs-gutter-x) * .5) * 2);
}
.no-data img {
width: 60%;
}
.no-data p {
font-size: 1.2rem;
}

View File

@@ -1,97 +0,0 @@
using Template.Shared.Core.Entity;
using Template.Shared.Core.Helpers.Enum;
namespace Template.Shared.Core.Dto;
public class ActivityDTO : StbActivity
{
public string? Commessa { get; set; }
public string? Cliente { get; set; }
public ActivityCategoryEnum Category { get; set; }
public bool Complete { get; set; }
private sealed class ActivityDtoEqualityComparer : IEqualityComparer<ActivityDTO>
{
public bool Equals(ActivityDTO? x, ActivityDTO? y)
{
if (ReferenceEquals(x, y)) return true;
if (x is null) return false;
if (y is null) return false;
if (x.GetType() != y.GetType()) return false;
return x.ActivityId == y.ActivityId && x.ActivityResultId == y.ActivityResultId && x.ActivityTypeId == y.ActivityTypeId && x.DataInsAct.Equals(y.DataInsAct) && x.ActivityDescription == y.ActivityDescription && x.ParentActivityId == y.ParentActivityId && x.TipoAnag == y.TipoAnag && x.CodAnag == y.CodAnag && x.CodJcom == y.CodJcom && x.CodJfas == y.CodJfas && Nullable.Equals(x.EstimatedDate, y.EstimatedDate) && Nullable.Equals(x.EstimatedTime, y.EstimatedTime) && Nullable.Equals(x.AlarmDate, y.AlarmDate) && Nullable.Equals(x.AlarmTime, y.AlarmTime) && Nullable.Equals(x.EffectiveDate, y.EffectiveDate) && Nullable.Equals(x.EffectiveTime, y.EffectiveTime) && x.ResultDescription == y.ResultDescription && Nullable.Equals(x.EstimatedEnddate, y.EstimatedEnddate) && Nullable.Equals(x.EstimatedEndtime, y.EstimatedEndtime) && Nullable.Equals(x.EffectiveEnddate, y.EffectiveEnddate) && Nullable.Equals(x.EffectiveEndtime, y.EffectiveEndtime) && x.UserCreator == y.UserCreator && x.UserName == y.UserName && Nullable.Equals(x.PercComp, y.PercComp) && Nullable.Equals(x.EstimatedHours, y.EstimatedHours) && x.CodMart == y.CodMart && x.PartitaMag == y.PartitaMag && x.Matricola == y.Matricola && x.Priorita == y.Priorita && Nullable.Equals(x.ActivityPlayCounter, y.ActivityPlayCounter) && x.ActivityEvent == y.ActivityEvent && x.Guarantee == y.Guarantee && x.Note == y.Note && x.Rfid == y.Rfid && x.IdLotto == y.IdLotto && x.PersonaRif == y.PersonaRif && x.HrNum == y.HrNum && x.Gestione == y.Gestione && Nullable.Equals(x.DataOrd, y.DataOrd) && x.NumOrd == y.NumOrd && x.IdStep == y.IdStep && x.IdRiga == y.IdRiga && Nullable.Equals(x.OraInsAct, y.OraInsAct) && x.IndiceGradimento == y.IndiceGradimento && x.NoteGradimento == y.NoteGradimento && x.FlagRisolto == y.FlagRisolto && x.FlagTipologia == y.FlagTipologia && x.OreRapportino == y.OreRapportino && x.UserModifier == y.UserModifier && Nullable.Equals(x.OraModAct, y.OraModAct) && Nullable.Equals(x.OraViewAct, y.OraViewAct) && x.CodVdes == y.CodVdes && x.CodCmac == y.CodCmac && x.WrikeId == y.WrikeId && x.CodMgrp == y.CodMgrp && x.PlanId == y.PlanId && x.Commessa == y.Commessa && x.Cliente == y.Cliente && x.Category == y.Category && x.Complete == y.Complete;
}
public int GetHashCode(ActivityDTO obj)
{
var hashCode = new HashCode();
hashCode.Add(obj.ActivityId);
hashCode.Add(obj.ActivityResultId);
hashCode.Add(obj.ActivityTypeId);
hashCode.Add(obj.DataInsAct);
hashCode.Add(obj.ActivityDescription);
hashCode.Add(obj.ParentActivityId);
hashCode.Add(obj.TipoAnag);
hashCode.Add(obj.CodAnag);
hashCode.Add(obj.CodJcom);
hashCode.Add(obj.CodJfas);
hashCode.Add(obj.EstimatedDate);
hashCode.Add(obj.EstimatedTime);
hashCode.Add(obj.AlarmDate);
hashCode.Add(obj.AlarmTime);
hashCode.Add(obj.EffectiveDate);
hashCode.Add(obj.EffectiveTime);
hashCode.Add(obj.ResultDescription);
hashCode.Add(obj.EstimatedEnddate);
hashCode.Add(obj.EstimatedEndtime);
hashCode.Add(obj.EffectiveEnddate);
hashCode.Add(obj.EffectiveEndtime);
hashCode.Add(obj.UserCreator);
hashCode.Add(obj.UserName);
hashCode.Add(obj.PercComp);
hashCode.Add(obj.EstimatedHours);
hashCode.Add(obj.CodMart);
hashCode.Add(obj.PartitaMag);
hashCode.Add(obj.Matricola);
hashCode.Add(obj.Priorita);
hashCode.Add(obj.ActivityPlayCounter);
hashCode.Add(obj.ActivityEvent);
hashCode.Add(obj.Guarantee);
hashCode.Add(obj.Note);
hashCode.Add(obj.Rfid);
hashCode.Add(obj.IdLotto);
hashCode.Add(obj.PersonaRif);
hashCode.Add(obj.HrNum);
hashCode.Add(obj.Gestione);
hashCode.Add(obj.DataOrd);
hashCode.Add(obj.NumOrd);
hashCode.Add(obj.IdStep);
hashCode.Add(obj.IdRiga);
hashCode.Add(obj.OraInsAct);
hashCode.Add(obj.IndiceGradimento);
hashCode.Add(obj.NoteGradimento);
hashCode.Add(obj.FlagRisolto);
hashCode.Add(obj.FlagTipologia);
hashCode.Add(obj.OreRapportino);
hashCode.Add(obj.UserModifier);
hashCode.Add(obj.OraModAct);
hashCode.Add(obj.OraViewAct);
hashCode.Add(obj.CodVdes);
hashCode.Add(obj.CodCmac);
hashCode.Add(obj.WrikeId);
hashCode.Add(obj.CodMgrp);
hashCode.Add(obj.PlanId);
hashCode.Add(obj.Commessa);
hashCode.Add(obj.Cliente);
hashCode.Add((int)obj.Category);
hashCode.Add(obj.Complete);
return hashCode.ToHashCode();
}
}
public static IEqualityComparer<ActivityDTO> ActivityDtoComparer { get; } = new ActivityDtoEqualityComparer();
public ActivityDTO Clone()
{
return (ActivityDTO)MemberwiseClone();
}
}

View File

@@ -1,6 +0,0 @@
namespace Template.Shared.Core.Dto;
public class ActivityResultDTO
{
public string ActivityResultId { get; set; }
}

View File

@@ -1,17 +0,0 @@
using Template.Shared.Core.Helpers.Enum;
namespace Template.Shared.Core.Helpers;
public static class ActivityCategoryHelper
{
public static string ConvertToHumanReadable(this ActivityCategoryEnum activityType)
{
return activityType switch
{
ActivityCategoryEnum.Memo => "memo",
ActivityCategoryEnum.Interna => "interna",
ActivityCategoryEnum.Commessa => "commessa",
_ => throw new ArgumentOutOfRangeException(nameof(activityType), activityType, null)
};
}
}

View File

@@ -1,6 +0,0 @@
namespace Template.Shared.Core.Helpers.Enum;
public enum ActivityStatusEnum
{
}

View File

@@ -1,13 +0,0 @@
using AutoMapper;
using Template.Shared.Core.Dto;
using Template.Shared.Core.Entity;
namespace Template.Shared.Core.Helpers;
public class MappingProfile : Profile
{
public MappingProfile()
{
CreateMap<StbActivity, ActivityDTO>();
}
}

View File

@@ -1,22 +0,0 @@
using MudBlazor;
using Template.Shared.Components.Pages;
namespace Template.Shared.Core.Helpers;
public class ModalHelpers
{
public static Task OpenActivityForm(IDialogService dialog ,string? id = null) =>
dialog.ShowAsync<ActivityForm>(
"Activity form",
new DialogParameters<ActivityForm>
{
{ x => x.Id, id}
},
new DialogOptions
{
FullScreen = true,
CloseButton = false,
NoHeader = true
}
);
}

View File

@@ -1,13 +0,0 @@
using System.Collections;
namespace Template.Shared.Core.Helpers;
public static class ObjectExtensions
{
public static bool IsNullOrEmpty(this IEnumerable? obj) =>
obj == null || obj.GetEnumerator().MoveNext() == false;
public static bool IsNullOrEmpty(this string? obj) =>
string.IsNullOrEmpty(obj);
}

View File

@@ -1,12 +0,0 @@
using Template.Shared.Core.Dto;
using Template.Shared.Core.Entity;
namespace Template.Shared.Core.Interface;
public interface IIntegryApiService
{
Task<List<StbActivity>?> GetActivity(string? dateFilter = null);
Task<List<JtbComt>?> GetAllCommesse(string? dateFilter = null);
Task<TaskSyncResponseDTO> GetAnagClie(string? dateFilter = null);
Task<TaskSyncResponseDTO> GetProspect(string? dateFilter = null);
}

View File

@@ -1,20 +0,0 @@
using System.Linq.Expressions;
using Template.Shared.Core.Dto;
using Template.Shared.Core.Entity;
namespace Template.Shared.Core.Interface;
public interface IManageDataService
{
Task<List<AnagClie>> GetAnagClie(Expression<Func<AnagClie, bool>>? whereCond = null);
Task<List<JtbComt>> GetJtbComt(Expression<Func<JtbComt, bool>>? whereCond = null);
Task<List<PtbPros>> GetPtbPros(Expression<Func<PtbPros, bool>>? whereCond = null);
Task<List<PtbProsRif>> GetPtbProsRif(Expression<Func<PtbProsRif, bool>>? whereCond = null);
Task<List<StbActivity>> GetStbActivity(Expression<Func<StbActivity, bool>>? whereCond = null);
Task<List<VtbCliePersRif>> GetVtbCliePersRif(Expression<Func<VtbCliePersRif, bool>>? whereCond = null);
Task<List<VtbDest>> GetVtbDest(Expression<Func<VtbDest, bool>>? whereCond = null);
Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null);
Task ClearDb();
}

View File

@@ -1,54 +0,0 @@
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
using IntegryApiClient.Core.Domain.RestClient.Contacts;
using Template.Shared.Core.Dto;
using Template.Shared.Core.Entity;
using Template.Shared.Core.Interface;
namespace Template.Shared.Core.Services;
public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUserSession userSession)
: IIntegryApiService
{
public Task<List<StbActivity>?> GetActivity(string? dateFilter)
{
var queryParams = new Dictionary<string, object> { { "dateFilter", dateFilter ?? "2020-01-01" } };
return integryApiRestClient.AuthorizedGet<List<StbActivity>?>("getActivityCrm", queryParams);
}
public Task<List<JtbComt>?> GetAllCommesse(string? dateFilter)
{
var queryParams = new Dictionary<string, object>();
if (dateFilter != null)
{
queryParams.Add("dateFilter", dateFilter);
}
return integryApiRestClient.AuthorizedGet<List<JtbComt>?>("getCommesseCrm", queryParams);
}
public Task<TaskSyncResponseDTO> GetAnagClie(string? dateFilter)
{
var queryParams = new Dictionary<string, object>();
if (dateFilter != null)
{
queryParams.Add("dateFilter", dateFilter);
}
return integryApiRestClient.AuthorizedGet<TaskSyncResponseDTO>("getAnagClieCrm", queryParams)!;
}
public Task<TaskSyncResponseDTO> GetProspect(string? dateFilter)
{
var queryParams = new Dictionary<string, object>();
if (dateFilter != null)
{
queryParams.Add("dateFilter", dateFilter);
}
return integryApiRestClient.AuthorizedGet<TaskSyncResponseDTO>("getProspectCrm", queryParams)!;
}
}

View File

@@ -1,19 +0,0 @@
namespace Template.Shared.Core.Utility;
public static class UtilityString
{
public static string ExtractInitials(string fullname)
{
return string.Concat(fullname
.Split(' ', StringSplitOptions.RemoveEmptyEntries)
.Select(word => char.ToUpper(word[0])));
}
public static string FirstCharToUpper(this string input) =>
input switch
{
null => throw new ArgumentNullException(nameof(input)),
"" => throw new ArgumentException($"{nameof(input)} cannot be empty", nameof(input)),
_ => input[0].ToString().ToUpper() + input.Substring(1)
};
}

View File

@@ -1,31 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<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.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.5" />
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
<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>
<ItemGroup>
<Folder Include="wwwroot\css\lineicons\" />
<Folder Include="wwwroot\js\bootstrap\" />
</ItemGroup>
</Project>

View File

@@ -1,8 +0,0 @@
:root {
/*Color*/
--card-border-color: hsl(from var(--mud-palette-gray-light) h s 86%);
--gray-for-shadow: hsl(from var(--mud-palette-gray-light) h s 95%);
/*Utility*/
--card-shadow: 5px 5px 10px 0 var(--gray-for-shadow);
--custom-box-shadow: 1px 2px 5px rgba(165, 165, 165, 0.5);
}

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +0,0 @@
window.goBack = function () {
history.back();
};

View File

@@ -1,54 +0,0 @@
using System.Linq.Expressions;
using Template.Shared.Core.Dto;
using Template.Shared.Core.Entity;
using Template.Shared.Core.Interface;
namespace Template.Web.Core.Services;
public class ManageDataService : IManageDataService
{
public Task<List<AnagClie>> GetAnagClie(Expression<Func<AnagClie, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task<List<JtbComt>> GetJtbComt(Expression<Func<JtbComt, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task<List<PtbPros>> GetPtbPros(Expression<Func<PtbPros, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task<List<PtbProsRif>> GetPtbProsRif(Expression<Func<PtbProsRif, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task<List<StbActivity>> GetStbActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task<List<VtbCliePersRif>> GetVtbCliePersRif(Expression<Func<VtbCliePersRif, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task<List<VtbDest>> GetVtbDest(Expression<Func<VtbDest, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
{
throw new NotImplementedException();
}
public Task ClearDb()
{
throw new NotImplementedException();
}
}

View File

@@ -3,11 +3,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
android:Application.WindowSoftInputModeAdjust="Resize"
x:Class="Template.Maui.App">
x:Class="salesbook.Maui.App">
<Application.Resources>
<ResourceDictionary>
<Color x:Key="PageBackgroundColor">#512bdf</Color>
<Color x:Key="PageBackgroundColor">#dff2ff</Color>
<Color x:Key="PrimaryTextColor">White</Color>
<Style TargetType="Label">
@@ -18,7 +18,7 @@
<Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="BackgroundColor" Value="#2b0b98" />
<Setter Property="BackgroundColor" Value="#dff2ff" />
<Setter Property="Padding" Value="14,10" />
</Style>

View File

@@ -0,0 +1,20 @@
using CommunityToolkit.Mvvm.Messaging;
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));
}
}
}

View File

@@ -0,0 +1,65 @@
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Interface;
namespace salesbook.Maui.Core.Services;
public class AttachedService : IAttachedService
{
public async Task<AttachedDTO?> SelectImage()
{
var perm = await Permissions.RequestAsync<Permissions.Photos>();
if (perm != PermissionStatus.Granted) return null;
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Scegli un'immagine",
FileTypes = FilePickerFileType.Images
});
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
}
public async Task<AttachedDTO?> SelectFile()
{
var perm = await Permissions.RequestAsync<Permissions.StorageRead>();
if (perm != PermissionStatus.Granted) return null;
var result = await FilePicker.PickAsync();
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Document);
}
public async Task<AttachedDTO?> SelectPosition()
{
var perm = await Permissions.RequestAsync<Permissions.LocationWhenInUse>();
if (perm != PermissionStatus.Granted) return null;
var loc = await Geolocation.GetLastKnownLocationAsync();
if (loc is null) return null;
return new AttachedDTO
{
Name = "Posizione attuale",
Lat = loc.Latitude,
Lng = loc.Longitude,
Type = AttachedDTO.TypeAttached.Position
};
}
private static async Task<AttachedDTO> ConvertToDto(FileResult file, AttachedDTO.TypeAttached type)
{
var stream = await file.OpenReadAsync();
using var ms = new MemoryStream();
await stream.CopyToAsync(ms);
return new AttachedDTO
{
Name = file.FileName,
Path = file.FullPath,
MimeType = file.ContentType,
DimensionBytes= ms.Length,
FileContent = ms.ToArray(),
Type = type
};
}
}

View File

@@ -1,6 +1,6 @@
using Template.Shared.Core.Interface;
using salesbook.Shared.Core.Interface;
namespace Template.Maui.Core.Services;
namespace salesbook.Maui.Core.Services;
public class FormFactor : IFormFactor
{

View File

@@ -1,7 +1,8 @@
using SQLite;
using System.Linq.Expressions;
using Template.Shared.Core.Entity;
namespace Template.Maui.Core.Services;
using salesbook.Shared.Core.Entity;
namespace salesbook.Maui.Core.Services;
public class LocalDbService
{
@@ -19,10 +20,40 @@ public class LocalDbService
_connection.CreateTableAsync<StbActivity>();
_connection.CreateTableAsync<VtbCliePersRif>();
_connection.CreateTableAsync<VtbDest>();
_connection.CreateTableAsync<StbActivityResult>();
_connection.CreateTableAsync<StbActivityType>();
_connection.CreateTableAsync<StbUser>();
_connection.CreateTableAsync<VtbTipi>();
_connection.CreateTableAsync<Nazioni>();
}
public async Task ResetSettingsDb()
{
try
{
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_activity_result;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_activity_type;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_user;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS vtb_tipi;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS nazioni;");
await _connection.CreateTableAsync<StbActivityResult>();
await _connection.CreateTableAsync<StbActivityType>();
await _connection.CreateTableAsync<StbUser>();
await _connection.CreateTableAsync<VtbTipi>();
await _connection.CreateTableAsync<Nazioni>();
}
catch (Exception ex)
{
Console.WriteLine($"Errore durante il reset del database(settings): {ex.Message}");
throw;
}
}
public async Task ResetDb()
{
await ResetSettingsDb();
try
{
await _connection.ExecuteAsync("DROP TABLE IF EXISTS anag_clie;");
@@ -86,4 +117,7 @@ public class LocalDbService
: _connection.Table<T>().Where(whereCond).ToListAsync();
public List<T> Get<T>(string sql) where T : new() => _connection.QueryAsync<T>(sql).Result;
public async Task Delete<T>(T entity) =>
await _connection.DeleteAsync(entity);
}

View File

@@ -1,34 +1,50 @@
using AutoMapper;
using System.Linq.Expressions;
using Template.Shared.Core.Dto;
using Template.Shared.Core.Entity;
using Template.Shared.Core.Helpers.Enum;
using Template.Shared.Core.Interface;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Entity;
using salesbook.Shared.Core.Helpers.Enum;
using salesbook.Shared.Core.Interface;
namespace Template.Maui.Core.Services;
namespace salesbook.Maui.Core.Services;
public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManageDataService
{
public Task<List<AnagClie>> GetAnagClie(Expression<Func<AnagClie, bool>>? whereCond = null) =>
public Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new() =>
localDb.Get(whereCond);
public Task<List<JtbComt>> GetJtbComt(Expression<Func<JtbComt, bool>>? whereCond = null) =>
localDb.Get(whereCond);
public async Task<List<ContactDTO>> GetContact()
{
var contactList = await localDb.Get<AnagClie>(x => x.FlagStato.Equals("A"));
var prospectList = await localDb.Get<PtbPros>();
public Task<List<PtbPros>> GetPtbPros(Expression<Func<PtbPros, bool>>? whereCond = null) =>
localDb.Get(whereCond);
// Mappa i contatti
var contactMapper = mapper.Map<List<ContactDTO>>(contactList);
public Task<List<PtbProsRif>> GetPtbProsRif(Expression<Func<PtbProsRif, bool>>? whereCond = null) =>
localDb.Get(whereCond);
// Mappa i prospects
var prospectMapper = mapper.Map<List<ContactDTO>>(prospectList);
public Task<List<StbActivity>> GetStbActivity(Expression<Func<StbActivity, bool>>? whereCond = null) =>
localDb.Get(whereCond);
contactMapper.AddRange(prospectMapper);
public Task<List<VtbCliePersRif>> GetVtbCliePersRif(Expression<Func<VtbCliePersRif, bool>>? whereCond = null) =>
localDb.Get(whereCond);
return contactMapper;
}
public Task<List<VtbDest>> GetVtbDest(Expression<Func<VtbDest, bool>>? whereCond = null) =>
localDb.Get(whereCond);
public async Task<ContactDTO?> GetSpecificContact(string codAnag, bool isContact)
{
if (isContact)
{
var contact = (await localDb.Get<AnagClie>(x => x.CodAnag != null && x.CodAnag.Equals(codAnag)))
.LastOrDefault();
return contact == null ? null : mapper.Map<ContactDTO>(contact);
}
else
{
var contact = (await localDb.Get<PtbPros>(x => x.CodPpro != null && x.CodPpro.Equals(codAnag)))
.LastOrDefault();
return contact == null ? null : mapper.Map<ContactDTO>(contact);
}
}
public async Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
{
@@ -66,11 +82,12 @@ public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManage
dto.Category = activity.CodAnag != null ? ActivityCategoryEnum.Interna : ActivityCategoryEnum.Memo;
}
if (dto.Category == ActivityCategoryEnum.Interna && activity.CodAnag != null)
if (dto.Category != ActivityCategoryEnum.Memo && activity.CodAnag != null)
{
string? ragSoc;
if (distinctClient.TryGetValue(activity.CodAnag, out ragSoc) || distinctProspect.TryGetValue(activity.CodAnag, out ragSoc))
if (distinctClient.TryGetValue(activity.CodAnag, out ragSoc) ||
distinctProspect.TryGetValue(activity.CodAnag, out ragSoc))
{
dto.Cliente = ragSoc;
}
@@ -86,6 +103,22 @@ public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManage
return returnDto;
}
public Task InsertOrUpdate<T>(List<T> listToSave) =>
localDb.InsertOrUpdate(listToSave);
public Task InsertOrUpdate<T>(T objectToSave) =>
localDb.InsertOrUpdate<T>([objectToSave]);
public Task Delete<T>(T objectToDelete) =>
localDb.Delete(objectToDelete);
public async Task DeleteActivity(ActivityDTO activity)
{
await localDb.Delete(
(await GetTable<StbActivity>(x => x.ActivityId.Equals(activity.ActivityId))).Last()
);
}
public Task ClearDb() =>
localDb.ResetDb();
}

View File

@@ -1,6 +1,6 @@
using Template.Shared.Core.Interface;
using salesbook.Shared.Core.Interface;
namespace Template.Maui.Core.Services;
namespace salesbook.Maui.Core.Services;
public class NetworkService : INetworkService
{

View File

@@ -0,0 +1,92 @@
using salesbook.Shared.Core.Helpers;
using salesbook.Shared.Core.Interface;
namespace salesbook.Maui.Core.Services;
public class SyncDbService(IIntegryApiService integryApiService, LocalDbService localDb) : ISyncDbService
{
public async Task GetAndSaveActivity(string? dateFilter)
{
var allActivity = await integryApiService.RetrieveActivity(dateFilter);
if (!allActivity.IsNullOrEmpty())
if (dateFilter is null)
await localDb.InsertAll(allActivity!);
else
await localDb.InsertOrUpdate(allActivity!);
}
public async Task GetAndSaveCommesse(string? dateFilter)
{
var allCommesse = await integryApiService.RetrieveAllCommesse(dateFilter);
if (!allCommesse.IsNullOrEmpty())
if (dateFilter is null)
await localDb.InsertAll(allCommesse!);
else
await localDb.InsertOrUpdate(allCommesse!);
}
public async Task GetAndSaveProspect(string? dateFilter)
{
var taskSyncResponseDto = await integryApiService.RetrieveProspect(dateFilter);
if (!taskSyncResponseDto.PtbPros.IsNullOrEmpty())
if (dateFilter is null)
await localDb.InsertAll(taskSyncResponseDto.PtbPros!);
else
await localDb.InsertOrUpdate(taskSyncResponseDto.PtbPros!);
if (!taskSyncResponseDto.PtbProsRif.IsNullOrEmpty())
if (dateFilter is null)
await localDb.InsertAll(taskSyncResponseDto.PtbProsRif!);
else
await localDb.InsertOrUpdate(taskSyncResponseDto.PtbProsRif!);
}
public async Task GetAndSaveClienti(string? dateFilter)
{
var taskSyncResponseDto = await integryApiService.RetrieveAnagClie(dateFilter);
if (!taskSyncResponseDto.AnagClie.IsNullOrEmpty())
if (dateFilter is null)
await localDb.InsertAll(taskSyncResponseDto.AnagClie!);
else
await localDb.InsertOrUpdate(taskSyncResponseDto.AnagClie!);
if (!taskSyncResponseDto.VtbDest.IsNullOrEmpty())
if (dateFilter is null)
await localDb.InsertAll(taskSyncResponseDto.VtbDest!);
else
await localDb.InsertOrUpdate(taskSyncResponseDto.VtbDest!);
if (!taskSyncResponseDto.VtbCliePersRif.IsNullOrEmpty())
if (dateFilter is null)
await localDb.InsertAll(taskSyncResponseDto.VtbCliePersRif!);
else
await localDb.InsertOrUpdate(taskSyncResponseDto.VtbCliePersRif!);
}
public async Task GetAndSaveSettings(string? dateFilter)
{
if (dateFilter is not null)
await localDb.ResetSettingsDb();
var settingsResponse = await integryApiService.RetrieveSettings();
if (!settingsResponse.ActivityResults.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.ActivityResults!);
if (!settingsResponse.ActivityTypes.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.ActivityTypes!);
if (!settingsResponse.StbUsers.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.StbUsers!);
if (!settingsResponse.VtbTipi.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.VtbTipi!);
if (!settingsResponse.Nazioni.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.Nazioni!);
}
}

View File

@@ -1,9 +1,9 @@
<?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:Template.Maui"
xmlns:shared="clr-namespace:Template.Shared;assembly=Template.Shared"
x:Class="Template.Maui.MainPage"
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">

View File

@@ -0,0 +1,23 @@
using CommunityToolkit.Mvvm.Messaging;
using salesbook.Shared.Core.Messages.Back;
namespace salesbook.Maui
{
public partial class MainPage : ContentPage
{
private readonly IMessenger _messenger;
public MainPage(IMessenger messenger)
{
InitializeComponent();
_messenger = messenger;
}
protected override bool OnBackButtonPressed()
{
_messenger.Send(new HardwareBackMessage("back"));
return true;
}
}
}

View File

@@ -1,17 +1,23 @@
using AutoMapper;
using CommunityToolkit.Maui;
using CommunityToolkit.Mvvm.Messaging;
using IntegryApiClient.MAUI;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Extensions.Logging;
using MudBlazor.Services;
using MudExtensions.Services;
using Template.Maui.Core.Services;
using Template.Shared;
using Template.Shared.Core.Helpers;
using Template.Shared.Core.Interface;
using Template.Shared.Core.Messages;
using Template.Shared.Core.Services;
using salesbook.Maui.Core.Services;
using salesbook.Shared;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Helpers;
using salesbook.Shared.Core.Interface;
using salesbook.Shared.Core.Messages.Activity.Copy;
using salesbook.Shared.Core.Messages.Activity.New;
using salesbook.Shared.Core.Messages.Back;
using salesbook.Shared.Core.Messages.Contact;
using salesbook.Shared.Core.Services;
namespace Template.Maui
namespace salesbook.Maui
{
public static class MauiProgram
{
@@ -24,12 +30,17 @@ namespace Template.Maui
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseIntegry(appToken: AppToken, useLoginAzienda: true)
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
.UseSentry(options =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
options.Dsn = "https://453b6b38f94fd67e40e0d5306d6caff8@o4508499810254848.ingest.de.sentry.io/4509605099667536";
#if DEBUG
options.Debug = true;
#endif
options.TracesSampleRate = 1.0;
})
.UseLoginAzienda(AppToken);
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
builder.Services.AddMauiBlazorWebView();
builder.Services.AddMudServices();
@@ -46,7 +57,13 @@ namespace Template.Maui
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
builder.Services.AddScoped<ISyncDbService, SyncDbService>();
builder.Services.AddScoped<IManageDataService, ManageDataService>();
//Message
builder.Services.AddScoped<IMessenger, WeakReferenceMessenger>();
builder.Services.AddScoped<NewActivityService>();
builder.Services.AddScoped<BackNavigationService>();
builder.Services.AddScoped<CopyActivityService>();
builder.Services.AddScoped<NewContactService>();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
@@ -54,9 +71,11 @@ namespace Template.Maui
#endif
builder.Services.AddSingleton<IFormFactor, FormFactor>();
builder.Services.AddSingleton<IAttachedService, AttachedService>();
builder.Services.AddSingleton<LocalDbService>();
builder.Services.AddSingleton<FilterUserDTO>();
return builder.Build();
}
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:usesCleartextTraffic="true" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>

View File

@@ -1,7 +1,7 @@
using Android.App;
using Android.Content.PM;
namespace Template.Maui
namespace salesbook.Maui
{
[Activity(Theme = "@style/Maui.SplashTheme",
MainLauncher = true,

View File

@@ -1,9 +1,9 @@
using Android.App;
using Android.Runtime;
namespace Template.Maui
namespace salesbook.Maui
{
[Application]
[Application(HardwareAccelerated = true)]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#dff2ff</color>
<color name="colorPrimaryDark">#00a0de</color>
<color name="colorAccent">#00a0de</color>
</resources>

View File

@@ -1,7 +1,7 @@
using Foundation;
using Template.Maui;
using salesbook.Maui;
namespace Template.Maui
namespace salesbook.Maui
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate

View File

@@ -1,7 +1,7 @@
using ObjCRuntime;
using UIKit;
namespace Template.Maui
namespace salesbook.Maui
{
public class Program
{

View File

@@ -1,6 +1,6 @@
using Foundation;
namespace Template.Maui
namespace salesbook.Maui
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate

View File

@@ -35,5 +35,15 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>L'app utilizza la tua posizione per allegarla alle attività.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Consente di selezionare immagini da allegare alle attività.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Permette all'app di salvare file o immagini nella tua libreria fotografica se necessario.</string>
</dict>
</plist>

View File

@@ -1,6 +1,6 @@
using UIKit;
namespace Template.Maui
namespace salesbook.Maui
{
public class Program
{

View File

@@ -0,0 +1 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 230" width="230" height="230"><style>.a{fill:#dff2ff}</style><path fill-rule="evenodd" class="a" d="m230 0v230h-230v-230z"/></svg>

After

Width:  |  Height:  |  Size: 201 B

View File

@@ -0,0 +1 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 230" width="230" height="230"><style>.a{fill:none;stroke:#002339;stroke-linecap:round;stroke-linejoin:round;stroke-width:16}.b{fill:none;stroke:#00a0de;stroke-linecap:round;stroke-linejoin:round;stroke-width:16}</style><path fill-rule="evenodd" class="a" d="m119.9 71.4h34.4c20.3 0 36.8 16.5 36.8 36.9v28.3c0 20.4-16.5 36.9-36.8 36.9h-5.1l0.1 32.2-34.7-32.2h-72.2"/><path fill-rule="evenodd" class="b" d="m117.3 24l-77.1 47.4v102.1l77.1-47.4v-102.1z"/></svg>

After

Width:  |  Height:  |  Size: 529 B

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Livello_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 570.53 425.62">
<defs>
<style>
.cls-1 {
stroke: #002339;
}
.cls-1, .cls-2 {
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 17px;
}
.cls-3 {
fill: #002339;
}
.cls-2 {
stroke: #00a0de;
}
</style>
</defs>
<g>
<path class="cls-3" d="M71.66,322.8c.96-.58,2.4-.86,4.32-.86s3.86.4,5.62,1.2c1.76.8,3.34,2.03,4.75,3.7l7.59-7.68c-2.05-2.69-4.63-4.69-7.73-6-3.11-1.31-6.58-1.97-10.42-1.97s-6.82.59-9.51,1.78c-2.69,1.18-4.77,2.88-6.24,5.09-1.47,2.21-2.21,4.79-2.21,7.73s.58,5.12,1.73,6.91c1.15,1.79,2.61,3.18,4.37,4.18,1.76.99,3.63,1.78,5.62,2.35,1.98.58,3.86,1.12,5.62,1.63,1.76.51,3.22,1.1,4.37,1.78,1.15.67,1.73,1.65,1.73,2.93,0,1.09-.54,1.94-1.63,2.54-1.09.61-2.66.91-4.71.91-2.5,0-4.8-.45-6.91-1.34-2.11-.9-3.94-2.27-5.47-4.13l-7.59,7.59c1.54,1.79,3.36,3.35,5.47,4.66,2.11,1.31,4.43,2.3,6.96,2.98,2.53.67,5.14,1.01,7.83,1.01,5.57,0,9.99-1.33,13.25-3.99,3.26-2.66,4.9-6.26,4.9-10.8,0-2.82-.56-5.12-1.68-6.91-1.12-1.79-2.56-3.23-4.32-4.32-1.76-1.09-3.62-1.94-5.57-2.54-1.95-.61-3.83-1.17-5.62-1.68-1.79-.51-3.23-1.07-4.32-1.68-1.09-.61-1.63-1.49-1.63-2.64,0-1.02.48-1.82,1.44-2.4Z"/>
<path class="cls-3" d="M137.34,316.75c-1.29-1.34-2.78-2.47-4.51-3.36-2.63-1.34-5.57-2.02-8.83-2.02-4.29,0-8.11,1.06-11.48,3.17s-6,4.99-7.92,8.64c-1.92,3.65-2.88,7.78-2.88,12.39s.96,8.64,2.88,12.29c1.92,3.65,4.56,6.53,7.92,8.64,3.36,2.11,7.15,3.17,11.38,3.17,3.33,0,6.32-.67,8.98-2.02,1.73-.87,3.2-1.99,4.46-3.31v4.37h12.68v-46.38h-12.68v4.42ZM134.85,344.5c-2.18,2.37-5.03,3.55-8.55,3.55-2.24,0-4.26-.54-6.05-1.63-1.79-1.09-3.19-2.56-4.18-4.42-.99-1.86-1.49-4.03-1.49-6.53s.5-4.58,1.49-6.43c.99-1.86,2.37-3.33,4.13-4.42,1.76-1.09,3.79-1.63,6.1-1.63s4.42.53,6.15,1.58c1.73,1.06,3.1,2.54,4.13,4.46,1.02,1.92,1.54,4.1,1.54,6.53,0,3.59-1.09,6.56-3.27,8.93Z"/>
<rect class="cls-3" x="164.81" y="289.28" width="12.58" height="69.43"/>
<path class="cls-3" d="M225.49,314.25c-3.46-1.98-7.36-2.98-11.71-2.98-4.61,0-8.77,1.06-12.48,3.17-3.71,2.11-6.64,4.99-8.79,8.64-2.15,3.65-3.22,7.78-3.22,12.39s1.09,8.83,3.27,12.48c2.18,3.65,5.17,6.53,8.98,8.64,3.81,2.11,8.15,3.17,13.01,3.17,3.78,0,7.26-.67,10.47-2.02,3.2-1.34,5.98-3.36,8.35-6.05l-7.49-7.49c-1.41,1.67-3.07,2.88-4.99,3.65-1.92.77-4.07,1.15-6.43,1.15-2.63,0-4.93-.54-6.91-1.63-1.99-1.09-3.5-2.67-4.56-4.75-.42-.82-.73-1.72-.98-2.65l33.87-.08c.26-1.02.42-1.97.48-2.83.06-.86.1-1.71.1-2.54,0-4.48-.96-8.48-2.88-12-1.92-3.52-4.61-6.27-8.07-8.26ZM207.15,323.47c1.86-1.09,4.03-1.63,6.53-1.63,2.37,0,4.35.48,5.95,1.44,1.6.96,2.85,2.37,3.75,4.23.43.89.76,1.89,1,2.99l-22.38.06c.23-.86.51-1.68.88-2.43.99-2.02,2.42-3.57,4.27-4.66Z"/>
<path class="cls-3" d="M260.64,322.8c.96-.58,2.4-.86,4.32-.86s3.86.4,5.62,1.2c1.76.8,3.34,2.03,4.75,3.7l7.59-7.68c-2.05-2.69-4.63-4.69-7.73-6-3.11-1.31-6.58-1.97-10.42-1.97s-6.82.59-9.51,1.78c-2.69,1.18-4.77,2.88-6.24,5.09-1.47,2.21-2.21,4.79-2.21,7.73s.58,5.12,1.73,6.91c1.15,1.79,2.61,3.18,4.37,4.18,1.76.99,3.63,1.78,5.62,2.35,1.98.58,3.86,1.12,5.62,1.63,1.76.51,3.22,1.1,4.37,1.78,1.15.67,1.73,1.65,1.73,2.93,0,1.09-.54,1.94-1.63,2.54-1.09.61-2.66.91-4.71.91-2.5,0-4.8-.45-6.91-1.34-2.11-.9-3.94-2.27-5.47-4.13l-7.59,7.59c1.54,1.79,3.36,3.35,5.47,4.66,2.11,1.31,4.43,2.3,6.96,2.98,2.53.67,5.14,1.01,7.83,1.01,5.57,0,9.99-1.33,13.25-3.99,3.26-2.66,4.9-6.26,4.9-10.8,0-2.82-.56-5.12-1.68-6.91-1.12-1.79-2.56-3.23-4.32-4.32-1.76-1.09-3.62-1.94-5.57-2.54-1.95-.61-3.83-1.17-5.62-1.68-1.79-.51-3.23-1.07-4.32-1.68-1.09-.61-1.63-1.49-1.63-2.64,0-1.02.48-1.82,1.44-2.4Z"/>
<path class="cls-3" d="M331.93,314.54c-3.43-2.11-7.28-3.17-11.57-3.17-3.26,0-6.26.69-8.98,2.06-1.58.8-2.96,1.79-4.18,2.93v-27.08h-12.58v69.43h12.48v-4.15c1.23,1.2,2.62,2.23,4.23,3.05,2.69,1.38,5.7,2.06,9.03,2.06,4.29,0,8.13-1.06,11.52-3.17,3.39-2.11,6.06-4.99,8.02-8.64,1.95-3.65,2.93-7.75,2.93-12.29s-.96-8.74-2.88-12.39c-1.92-3.65-4.59-6.53-8.02-8.64ZM328.38,342c-.99,1.86-2.35,3.33-4.08,4.42-1.73,1.09-3.74,1.63-6.05,1.63s-4.35-.54-6.15-1.63c-1.79-1.09-3.17-2.56-4.13-4.42-.96-1.86-1.44-4-1.44-6.43s.48-4.67,1.44-6.53c.96-1.86,2.32-3.33,4.08-4.42,1.76-1.09,3.79-1.63,6.1-1.63s4.34.54,6.1,1.63c1.76,1.09,3.14,2.58,4.13,4.46.99,1.89,1.49,4.02,1.49,6.39,0,2.5-.5,4.67-1.49,6.53Z"/>
<path class="cls-3" d="M389.26,314.44c-3.75-2.11-7.99-3.17-12.72-3.17s-8.88,1.07-12.63,3.22c-3.75,2.15-6.71,5.03-8.88,8.64-2.18,3.62-3.27,7.7-3.27,12.24s1.09,8.75,3.27,12.44c2.18,3.68,5.14,6.59,8.88,8.74,3.74,2.15,7.95,3.22,12.63,3.22s8.99-1.07,12.77-3.22c3.78-2.14,6.75-5.07,8.93-8.79,2.18-3.71,3.26-7.84,3.26-12.39s-1.1-8.64-3.31-12.29c-2.21-3.65-5.19-6.53-8.93-8.64ZM387.05,341.9c-.99,1.86-2.4,3.33-4.23,4.42-1.82,1.09-3.92,1.63-6.29,1.63s-4.35-.54-6.15-1.63c-1.79-1.09-3.19-2.56-4.18-4.42-.99-1.86-1.49-4-1.49-6.43s.5-4.58,1.49-6.43c.99-1.86,2.38-3.31,4.18-4.37,1.79-1.06,3.84-1.58,6.15-1.58s4.43.53,6.19,1.58c1.76,1.06,3.17,2.51,4.23,4.37,1.06,1.86,1.58,4,1.58,6.43s-.5,4.58-1.49,6.43Z"/>
<path class="cls-3" d="M447.74,314.44c-3.75-2.11-7.99-3.17-12.72-3.17s-8.88,1.07-12.63,3.22c-3.75,2.15-6.71,5.03-8.88,8.64-2.18,3.62-3.27,7.7-3.27,12.24s1.09,8.75,3.27,12.44c2.18,3.68,5.14,6.59,8.88,8.74,3.74,2.15,7.95,3.22,12.63,3.22s8.99-1.07,12.77-3.22c3.78-2.14,6.75-5.07,8.93-8.79,2.18-3.71,3.26-7.84,3.26-12.39s-1.1-8.64-3.31-12.29c-2.21-3.65-5.19-6.53-8.93-8.64ZM445.53,341.9c-.99,1.86-2.4,3.33-4.23,4.42-1.82,1.09-3.92,1.63-6.29,1.63s-4.35-.54-6.15-1.63c-1.79-1.09-3.19-2.56-4.18-4.42-.99-1.86-1.49-4-1.49-6.43s.5-4.58,1.49-6.43c.99-1.86,2.38-3.31,4.18-4.37,1.79-1.06,3.84-1.58,6.15-1.58s4.43.53,6.19,1.58c1.76,1.06,3.17,2.51,4.23,4.37,1.06,1.86,1.58,4,1.58,6.43s-.5,4.58-1.49,6.43Z"/>
<polygon class="cls-3" points="516.64 358.71 497.56 334.39 515.77 312.33 501.18 312.33 484.37 333.58 484.37 289.28 471.79 289.28 471.79 358.71 484.37 358.71 484.37 336.08 501.27 358.71 516.64 358.71"/>
</g>
<g>
<path class="cls-1" d="M288.72,101.41h36.59c21.62,0,39.14,17.52,39.14,39.14v30.15c0,21.62-17.52,39.14-39.14,39.14h-5.37l.07,34.31-36.88-34.31h-77.99"/>
<polygon class="cls-2" points="285.99 51.02 204.08 101.41 204.08 209.84 285.99 159.45 285.99 51.02"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -15,7 +15,7 @@
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
<OutputType>Exe</OutputType>
<RootNamespace>Template.Maui</RootNamespace>
<RootNamespace>salesbook.Maui</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
@@ -23,14 +23,14 @@
<Nullable>enable</Nullable>
<!-- Display name -->
<ApplicationTitle>Template.Maui</ApplicationTitle>
<ApplicationTitle>salesbook</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>it.integry.template.maui</ApplicationId>
<ApplicationId>it.integry.salesbook</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.1.0</ApplicationDisplayVersion>
<ApplicationVersion>5</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
@@ -78,8 +78,9 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
<CodesignKey>Apple Development: Created via API (5B7B69P4JY)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
<CodesignKey>Apple Distribution: Integry S.r.l. (UNP26J4R89)</CodesignKey>
<CodesignProvision></CodesignProvision>
<ProvisioningType>manual</ProvisioningType>
</PropertyGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
@@ -92,12 +93,19 @@
-->
</ItemGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<!-- Android App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" ForegroundScale="0.65" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<!-- ios App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" />
</ItemGroup>
<ItemGroup>
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#dff2ff" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
@@ -111,19 +119,20 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="11.2.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="12.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<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="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="sqlite-net-pcl" Version="1.9.172" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Template.Shared\Template.Shared.csproj" />
<ProjectReference Include="..\salesbook.Shared\salesbook.Shared.csproj" />
</ItemGroup>
</Project>

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"/>
<title>salesbook.Maui</title>
<base href="/"/>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap" rel="stylesheet">
<link href="_content/salesbook.Shared/css/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="_content/salesbook.Shared/css/bootstrap/bootstrap-icons.min.css" rel="stylesheet"/>
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet"/>
<link href="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="_content/salesbook.Shared/css/remixicon/remixicon.css"/>
<link rel="stylesheet" href="_content/salesbook.Shared/css/app.css"/>
<link rel="stylesheet" href="_content/salesbook.Shared/css/form.css"/>
<link rel="stylesheet" href="_content/salesbook.Shared/css/bottomSheet.css"/>
<link rel="stylesheet" href="_content/salesbook.Shared/css/default-theme.css"/>
<link rel="stylesheet" href="salesbook.Maui.styles.css"/>
<link rel="icon" type="image/png" href="favicon.png"/>
</head>
<body>
<div class="status-bar-safe-area"></div>
<div id="app">
<div class="spinner-container">
<span class="loader"></span>
</div>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webview.js" autostart="false"></script>
<script src="_content/salesbook.Shared/js/bootstrap/bootstrap.bundle.min.js"></script>
<!-- Add chart.js reference if chart components are used in your application. -->
<!--<script src="_content/salesbook.Shared/js/bootstrap/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
<!--<script src="_content/salesbook.Shared/js/bootstrap/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
<!-- Add sortable.js reference if SortableList component is used in your application. -->
<!--<script src="_content/salesbook.Shared/js/bootstrap/Sortable.min.js"></script>-->
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
<script src="_content/salesbook.Shared/js/main.js"></script>
<script src="_content/salesbook.Shared/js/calendar.js"></script>
<script src="_content/salesbook.Shared/js/alphaScroll.js"></script>
</body>
</html>

View File

@@ -0,0 +1,103 @@
@inject IJSRuntime JS
<div class="@(Back ? "" : "container") header">
<div class="header-content @(Back ? "with-back" : "no-back")">
@if (!SmallHeader)
{
@if (Back)
{
<div class="left-section">
<MudButton StartIcon="@(!Cancel ? Icons.Material.Outlined.ArrowBackIosNew : "")"
OnClick="GoBack"
Color="Color.Info"
Style="text-transform: none"
Variant="Variant.Text">
@BackTo
</MudButton>
</div>
}
<h3 class="page-title">@Title</h3>
<div class="right-section">
@if (LabelSave.IsNullOrEmpty())
{
@if (ShowFilter)
{
<MudIconButton OnClick="OnFilterToggle" Icon="@Icons.Material.Outlined.FilterAlt"/>
}
@* @if (ShowCalendarToggle)
{
<MudIconButton OnClick="OnCalendarToggle" Icon="@Icons.Material.Filled.CalendarMonth" Color="Color.Dark"/>
} *@
@if (ShowProfile)
{
<MudIconButton Class="user" OnClick="OpenPersonalInfo" Icon="@Icons.Material.Filled.Person"/>
}
}
else
{
<MudButton OnClick="OnSave"
Color="Color.Info"
Style="text-transform: none"
Variant="Variant.Text">
@LabelSave
</MudButton>
}
</div>
}
else
{
<div class="title">
<MudText Typo="Typo.h6">
<b>@Title</b>
</MudText>
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="() => GoBack()" />
</div>
}
</div>
</div>
@code{
[Parameter] public string? Title { get; set; }
[Parameter] public bool ShowFilter { get; set; }
[Parameter] public bool ShowProfile { get; set; } = true;
[Parameter] public bool Back { get; set; }
[Parameter] public bool BackOnTop { get; set; }
[Parameter] public string BackTo { get; set; } = "";
[Parameter] public EventCallback OnFilterToggle { get; set; }
[Parameter] public bool Cancel { get; set; }
[Parameter] public EventCallback OnCancel { get; set; }
[Parameter] public string? LabelSave { get; set; }
[Parameter] public EventCallback OnSave { get; set; }
[Parameter] public bool ShowCalendarToggle { get; set; }
[Parameter] public EventCallback OnCalendarToggle { get; set; }
[Parameter] public bool SmallHeader { get; set; }
protected override void OnParametersSet()
{
Back = !Back ? !Back && Cancel : Back;
BackTo = Cancel ? "Annulla" : BackTo;
}
private async Task GoBack()
{
if (Cancel)
{
await OnCancel.InvokeAsync();
return;
}
await JS.InvokeVoidAsync("goBack");
}
private void OpenPersonalInfo() =>
NavigationManager.NavigateTo("/PersonalInfo");
}

View File

@@ -0,0 +1,29 @@
.header {
min-height: var(--mh-header);
width: 100%;
display: flex;
align-items: center;
}
.header-content {
width: 100%;
line-height: normal;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
}
.header-content.with-back .page-title {
position: absolute;
left: 50%;
transform: translateX(-50%);
margin: 0;
font-size: larger;
}
.left-section ::deep button, .right-section ::deep button { font-size: 1.1rem; }
.left-section ::deep .mud-button-icon-start { margin-right: 3px !important; }
.header-content.no-back .page-title { margin: 0; }

View File

@@ -0,0 +1,92 @@
@using System.Globalization
@using CommunityToolkit.Mvvm.Messaging
@using salesbook.Shared.Core.Messages.Back
@inherits LayoutComponentBase
@inject IJSRuntime JS
@inject IMessenger Messenger
@inject BackNavigationService BackService
<MudThemeProvider Theme="_currentTheme" @ref="@_mudThemeProvider" @bind-IsDarkMode="@IsDarkMode" />
<MudPopoverProvider/>
<MudDialogProvider/>
<MudSnackbarProvider/>
<div class="page">
<NavMenu/>
<main>
<article>
@Body
</article>
</main>
</div>
@code {
private MudThemeProvider? _mudThemeProvider;
private bool IsDarkMode { get; set; }
private string _mainContentClass = "";
private readonly MudTheme _currentTheme = new()
{
PaletteLight = new PaletteLight()
{
Primary = "#00a0de",
Secondary = "#002339",
Tertiary = "#dff2ff",
TextPrimary = "#000"
},
PaletteDark = new PaletteDark
{
Primary = "#00a0de",
Secondary = "#002339",
Tertiary = "#dff2ff",
Surface = "#000406",
Background = "#000406",
TextPrimary = "#fff",
GrayDark = "#E0E0E0"
}
};
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// if (firstRender)
// {
// var isDarkMode = LocalStorage.GetString("isDarkMode");
// if (isDarkMode == null && _mudThemeProvider != null)
// {
// IsDarkMode = await _mudThemeProvider.GetSystemPreference();
// await _mudThemeProvider.WatchSystemPreference(OnSystemPreferenceChanged);
// LocalStorage.SetString("isDarkMode", IsDarkMode.ToString());
// StateHasChanged();
// }
// else
// {
// IsDarkMode = bool.Parse(isDarkMode!);
// }
// if (IsDarkMode)
// {
// _mainContentClass += "is-dark";
// StateHasChanged();
// }
// }
}
private async Task OnSystemPreferenceChanged(bool newValue)
{
IsDarkMode = newValue;
}
protected override void OnInitialized()
{
BackService.OnHardwareBack += async () => { await JS.InvokeVoidAsync("goBack"); };
var culture = new CultureInfo("it-IT", false);
CultureInfo.CurrentCulture = culture;
CultureInfo.CurrentUICulture = culture;
}
}

View File

@@ -0,0 +1,106 @@
@using CommunityToolkit.Mvvm.Messaging
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Core.Entity
@using salesbook.Shared.Core.Messages.Activity.Copy
@using salesbook.Shared.Core.Messages.Activity.New
@using salesbook.Shared.Core.Messages.Contact
@inject IDialogService Dialog
@inject IMessenger Messenger
@inject CopyActivityService CopyActivityService
<div class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
<div class="container-navbar">
<ul class="navbar-nav flex-row nav-justified align-items-center w-100 text-center">
<li class="nav-item">
<NavLink class="nav-link" href="Users" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-group-line"></i>
<span>Contatti</span>
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="Calendar" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-calendar-todo-line"></i>
<span>Agenda</span>
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="Notifications" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-notification-4-line"></i>
<span>Notifiche</span>
</div>
</NavLink>
</li>
</ul>
</div>
@if (PlusVisible)
{
<MudMenu PopoverClass="custom_popover" AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomRight">
<ActivatorContent>
<MudFab Class="custom-plus-button" Color="Color.Surface" Size="Size.Medium" IconSize="Size.Medium" IconColor="Color.Primary" StartIcon="@Icons.Material.Filled.Add"/>
</ActivatorContent>
<ChildContent>
<MudMenuItem OnClick="() => CreateUser()">Nuovo contatto</MudMenuItem>
<MudMenuItem OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem>
</ChildContent>
</MudMenu>
}
</nav>
</div>
@code
{
private bool IsVisible { get; set; } = true;
private bool PlusVisible { get; set; } = true;
protected override Task OnInitializedAsync()
{
CopyActivityService.OnCopyActivity += async dto => await CreateActivity(dto);
NavigationManager.LocationChanged += (_, args) =>
{
var location = args.Location.Remove(0, NavigationManager.BaseUri.Length);
var newIsVisible = new List<string> { "Calendar", "Users", "Notifications" }
.Contains(location);
var newPlusVisible = new List<string> { "Calendar", "Users" }
.Contains(location);
if (IsVisible == newIsVisible && PlusVisible == newPlusVisible) return;
IsVisible = newIsVisible;
PlusVisible = newPlusVisible;
StateHasChanged();
};
return Task.CompletedTask;
}
private Task CreateActivity() => CreateActivity(null);
private async Task CreateActivity(ActivityDTO? activity)
{
var result = await ModalHelpers.OpenActivityForm(Dialog, activity, null);
if (result is { Canceled: false, Data: not null } && result.Data.GetType() == typeof(StbActivity))
{
Messenger.Send(new NewActivityMessage(((StbActivity)result.Data).ActivityId));
}
}
private async Task CreateUser()
{
var result = await ModalHelpers.OpenUserForm(Dialog, null);
if (result is { Canceled: false, Data: not null } && result.Data.GetType() == typeof(CRMCreateContactResponseDTO))
{
Messenger.Send(new NewContactMessage((CRMCreateContactResponseDTO)result.Data));
}
}
}

View File

@@ -1,17 +1,41 @@
.navbar {
.animated-navbar {
background: transparent;
position: fixed;
bottom: 0;
width: 100%;
z-index: 1001;
transition: all 0.3s ease-in-out;
}
.animated-navbar.show-nav { transform: translateY(0); }
.animated-navbar.hide-nav { transform: translateY(100%); }
.animated-navbar.with-plus { margin-left: 30px; }
.navbar {
padding-bottom: 1rem;
padding-top: 0 !important;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: end;
transition: all 0.3s ease-in-out;
}
.navbar.with-plus { transform: translateX(-30px); }
.navbar.without-plus {
transform: translateX(0);
justify-content: center;
}
.container-navbar {
background: var(--mud-palette-surface);
border-radius: 15px;
border-radius: 50px;
padding: 0 10px;
box-shadow: var(--custom-box-shadow);
transition: all 0.3s ease-in-out;
}
.nav-item { font-size: 0.9rem; }
@@ -21,29 +45,33 @@
bottom: 15px;
}
.nav-item ::deep .custom-plus-button .mud-icon-root {
transition: .513s;
.navbar ::deep .custom-plus-button .mud-icon-root {
transition: .5s;
transform: rotate(0);
font-size: 2rem;
}
.nav-item ::deep .custom-plus-button:focus .mud-icon-root {
transform: rotate(225deg);
}
.navbar ::deep .custom-plus-button {
background: var(--mud-palette-surface);
box-shadow: var(--custom-box-shadow);
transition: all 0.3s ease-in-out;
}
.navbar ::deep .custom-plus-button:focus .mud-icon-root { transform: rotate(225deg); }
.nav-item ::deep a {
display: flex;
align-items: center;
line-height: 1.2;
justify-content: center;
padding-top: .5rem !important;
padding-bottom: .5rem !important;
padding-top: .25rem !important;
padding-bottom: .25rem !important;
}
.nav-item ::deep a > div {
-webkit-transition: all .1s ease-out;
transition: all .1s ease-out;
min-width: 60px;
min-width: 75px;
}
.nav-item ::deep a.active > div { color: var(--mud-palette-primary); }
@@ -66,8 +94,4 @@
font-weight: 500;
}
@supports (-webkit-touch-callout: none) {
.nav-item { padding-bottom: env(safe-area-inset-bottom) !important; }
.nav-item ::deep > .nav-link { padding-bottom: 0 !important; }
}
@supports (-webkit-touch-callout: none) { .navbar { padding-bottom: env(safe-area-inset-bottom); } }

View File

@@ -0,0 +1,23 @@
@using salesbook.Shared.Components.Layout.Spinner
<MudOverlay Visible="VisibleOverlay" LightBackground="true">
@if (SuccessAnimation)
{
<div class="success-checkmark">
<div class="check-icon">
<span class="icon-line line-tip"></span>
<span class="icon-line line-long"></span>
<div class="icon-circle"></div>
<div class="icon-fix"></div>
</div>
</div>
}
else
{
<SpinnerLayout/>
}
</MudOverlay>
@code {
[Parameter] public required bool SuccessAnimation { get; set; }
[Parameter] public required bool VisibleOverlay { get; set; }
}

View File

@@ -0,0 +1,156 @@
.success-checkmark {
width: 80px;
height: 80px;
margin: 0 auto;
}
.success-checkmark .check-icon {
width: 80px;
height: 80px;
position: relative;
border-radius: 50%;
box-sizing: content-box;
border: 4px solid var(--mud-palette-success);
}
.success-checkmark .check-icon::before {
top: 3px;
left: -2px;
width: 30px;
transform-origin: 100% 50%;
border-radius: 100px 0 0 100px;
}
.success-checkmark .check-icon::after {
top: 0;
left: 30px;
width: 60px;
transform-origin: 0 50%;
border-radius: 0 100px 100px 0;
animation: rotate-circle 4.25s ease-in;
}
.success-checkmark .check-icon::before,
.success-checkmark .check-icon::after {
content: '';
height: 100px;
position: absolute;
transform: rotate(-45deg);
z-index: 2;
}
.icon-line {
height: 5px;
background-color: var(--mud-palette-success);
display: block;
border-radius: 2px;
position: absolute;
z-index: 10;
}
.icon-line.line-tip {
top: 46px;
left: 14px;
width: 25px;
transform: rotate(45deg);
animation: icon-line-tip 0.75s;
}
.icon-line.line-long {
top: 38px;
right: 8px;
width: 47px;
transform: rotate(-45deg);
animation: icon-line-long 0.75s;
}
.icon-circle {
top: -4px;
left: -4px;
z-index: 10;
width: 80px;
height: 80px;
border-radius: 50%;
position: absolute;
box-sizing: content-box;
border: 4px solid var(--mud-palette-success);
}
.icon-fix {
top: 8px;
width: 5px;
left: 26px;
z-index: 1;
height: 85px;
position: absolute;
transform: rotate(-45deg);
}
@keyframes rotate-circle {
0% { transform: rotate(-45deg); }
5% { transform: rotate(-45deg); }
12% { transform: rotate(-405deg); }
100% { transform: rotate(-405deg); }
}
@keyframes icon-line-tip {
0% {
width: 0;
left: 1px;
top: 19px;
}
54% {
width: 0;
left: 1px;
top: 19px;
}
70% {
width: 50px;
left: -8px;
top: 37px;
}
84% {
width: 17px;
left: 21px;
top: 48px;
}
100% {
width: 25px;
left: 14px;
top: 45px;
}
}
@keyframes icon-line-long {
0% {
width: 0;
right: 46px;
top: 54px;
}
65% {
width: 0;
right: 46px;
top: 54px;
}
84% {
width: 55px;
right: 0px;
top: 35px;
}
100% {
width: 47px;
right: 8px;
top: 38px;
}
}

View File

@@ -0,0 +1,626 @@
@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.Messages.Activity.New
@inject IManageDataService ManageData
@inject IJSRuntime JS
@inject NewActivityService NewActivity
<HeaderLayout Title="@_headerTitle"
ShowFilter="true"
ShowCalendarToggle="true"
OnFilterToggle="ToggleFilter"
OnCalendarToggle="ToggleExpanded"/>
<div @ref="_weekSliderRef" class="container week-slider @(Expanded ? "expanded" : "") @(SliderAnimation)">
@if (Expanded)
{
<!-- Vista mensile -->
@foreach (var nomeGiorno in GiorniSettimana)
{
<div class="week-day">
<div>@nomeGiorno</div>
</div>
}
@foreach (var unused in Enumerable.Range(0, StartOffset))
{
<div class="day" style="visibility: hidden"></div>
}
@if (_isInitialized && _monthDaysData.Length > 0)
{
@for (var d = 1; d <= DaysInMonth; d++)
{
var day = new DateTime(CurrentMonth.Year, CurrentMonth.Month, d);
var dayData = _monthDaysData[d - 1];
<div class="day @dayData.CssClass"
@onclick="() => SelezionaDataDalMese(day)">
<div>@d</div>
@if (dayData.HasEvents)
{
<div class="event-dot-container" style="margin-top: 2px;">
@foreach (var cat in dayData.EventCategories)
{
<div class="event-dot @cat.CssClass" title="@cat.Title"></div>
}
</div>
}
</div>
}
}
else
{
@* Fallback rendering per prima inizializzazione *@
@for (var d = 1; d <= DaysInMonth; d++)
{
var day = new DateTime(CurrentMonth.Year, CurrentMonth.Month, d);
var isSelected = IsSameDay(day, SelectedDate);
var isToday = IsSameDay(day, DateTime.Today);
var events = GetEventsForDay(day);
<div class="day @(isSelected ? "selected" : (isToday ? "today" : ""))"
@onclick="() => SelezionaDataDalMese(day)">
<div>@d</div>
@if (events.Any())
{
<div class="event-dot-container" style="margin-top: 2px;">
@foreach (var cat in events.Select(x => x.Category).Distinct())
{
<div class="event-dot @cat.ConvertToHumanReadable()" title="@cat.ConvertToHumanReadable()"></div>
}
</div>
}
</div>
}
}
@foreach (var unused in Enumerable.Range(0, EndOffset))
{
<div class="day" style="visibility: hidden"></div>
}
}
else
{
<!-- Vista settimanale -->
@if (_isInitialized && _weekDaysData.Length == 7 && _weekDaysData[0].Date != default)
{
@for (int i = 0; i < 7; i++)
{
var dayData = _weekDaysData[i];
var day = dayData.Date;
<div class="week-day">
<div>@dayData.DayName</div>
<div class="day @dayData.CssClass"
@onclick="() => SelezionaData(day)">
<div>@day.Day</div>
@if (dayData.HasEvents)
{
<div class="event-dot-container" style="margin-top: 2px;">
@foreach (var cat in dayData.EventCategories)
{
<div class="event-dot @cat.CssClass" title="@cat.Title"></div>
}
</div>
}
</div>
</div>
}
}
else
{
var start = GetStartOfWeek(SelectedDate);
var culture = new System.Globalization.CultureInfo("it-IT");
for (var i = 0; i < 7; i++)
{
var day = start.AddDays(i);
var isSelected = IsSameDay(day, SelectedDate);
var isToday = IsSameDay(day, DateTime.Today);
var events = GetEventsForDay(day);
<div class="week-day">
<div>@day.ToString("ddd", culture)</div>
<div class="day @(isSelected ? "selected" : (isToday ? "today" : ""))"
@onclick="() => SelezionaData(day)"
aria-label="@day.ToString("dddd d MMMM", culture)">
<div>@day.Day</div>
@if (events.Any())
{
<div class="event-dot-container" style="margin-top: 2px;">
@foreach (var cat in events.Select(x => x.Category).Distinct())
{
<div class="event-dot @cat.ConvertToHumanReadable()" title="@cat.ConvertToHumanReadable()"></div>
}
</div>
}
</div>
</div>
}
}
}
</div>
<div class="container appointments">
@if (IsLoading)
{
<SpinnerLayout FullScreen="false"/>
}
else if (FilteredActivities is { Count: > 0 })
{
<Virtualize Items="FilteredActivities" Context="activity">
<ActivityCard Activity="activity" ActivityChanged="OnActivityChanged" ActivityDeleted="OnActivityDeleted" />
</Virtualize>
}
else
{
<NoDataAvailable Text="Nessuna attività trovata" ImageSource="_content/salesbook.Shared/images/undraw_file-search_cbur.svg"/>
}
</div>
<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 = "");
private record CategoryData(string CssClass, string Title);
// Cache per rendering
private DayData[] _monthDaysData = [];
private readonly DayData[] _weekDaysData = new DayData[7];
private string _headerTitle = string.Empty;
private readonly Dictionary<DateTime, List<ActivityDTO>> _eventsCache = new();
private readonly Dictionary<DateTime, CategoryData[]> _categoriesCache = new();
private bool _isInitialized = false;
// Stato UI
private bool Expanded { get; set; }
private string SliderAnimation { get; set; } = string.Empty;
private ElementReference _weekSliderRef;
private DotNetObjectReference<Calendar>? _dotNetHelper;
// Stato calendario
private DateTime SelectedDate { get; set; } = DateTime.Today;
private DateTime _internalMonth = DateTime.Today;
private DateTime CurrentMonth => new(_internalMonth.Year, _internalMonth.Month, 1);
// Stato attività
private List<ActivityDTO> MonthActivities { get; set; } = [];
private List<ActivityDTO> FilteredActivities { get; set; } = [];
private bool IsLoading { get; set; } = true;
// Supporto rendering mese
private static readonly string[] GiorniSettimana = ["Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"];
private int DaysInMonth => DateTime.DaysInMonth(CurrentMonth.Year, CurrentMonth.Month);
private int StartOffset => (int)CurrentMonth.DayOfWeek == 0 ? 6 : (int)CurrentMonth.DayOfWeek - 1;
//Filtri
private bool OpenFilter { get; set; }
private FilterActivityDTO Filter { get; set; } = new();
private int EndOffset
{
get
{
var totalCells = (int)Math.Ceiling((DaysInMonth + StartOffset) / 7.0) * 7;
return totalCells - (DaysInMonth + StartOffset);
}
}
protected override void OnInitialized()
{
PrepareRenderingData();
NewActivity.OnActivityCreated += async activityId => await OnActivityCreated(activityId);
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
Filter.User = new HashSet<string> { UserSession.User.Username };
_dotNetHelper = DotNetObjectReference.Create(this);
await JS.InvokeVoidAsync("calendarSwipe.register", _weekSliderRef, _dotNetHelper);
_internalMonth = new DateTime(SelectedDate.Year, SelectedDate.Month, 1);
await LoadMonthData();
_isInitialized = true;
ApplyFilter();
StateHasChanged();
}
}
// Metodo per preparare i dati di rendering una sola volta
private void PrepareRenderingData()
{
PrepareHeaderTitle();
PrepareEventsCache();
if (Expanded)
{
PrepareMonthDaysData();
}
else
{
PrepareWeekDaysData();
}
}
private void PrepareHeaderTitle()
{
_headerTitle = CurrentMonth.ToString("MMMM yyyy", new System.Globalization.CultureInfo("it-IT")).FirstCharToUpper();
}
private void PrepareEventsCache()
{
_eventsCache.Clear();
_categoriesCache.Clear();
// Raggruppa le attività per data
var activitiesByDate = MonthActivities
.GroupBy(x => (x.EffectiveDate ?? x.EstimatedDate!).Value.Date)
.ToDictionary(g => g.Key, g => g.ToList());
foreach (var (date, activities) in activitiesByDate)
{
_eventsCache[date] = activities;
// Pre-calcola le categorie per ogni giorno
var categories = activities
.Select(x => x.Category)
.Distinct()
.Select(cat => new CategoryData(cat.ConvertToHumanReadable(), cat.ConvertToHumanReadable()))
.ToArray();
_categoriesCache[date] = categories;
}
}
private void PrepareMonthDaysData()
{
_monthDaysData = new DayData[DaysInMonth];
var today = DateTime.Today;
for (var d = 1; d <= DaysInMonth; d++)
{
var day = new DateTime(CurrentMonth.Year, CurrentMonth.Month, d);
var isSelected = day.Date == SelectedDate.Date;
var isToday = day.Date == today;
var cssClass = isSelected ? "selected" : (isToday ? "today" : "");
var hasEvents = _eventsCache.ContainsKey(day.Date);
var eventCategories = hasEvents ? GetFilteredCategoriesForDay(day.Date) : [];
_monthDaysData[d - 1] = new DayData(day, cssClass, eventCategories.Length > 0, eventCategories);
}
}
private void PrepareWeekDaysData()
{
var start = GetStartOfWeek(SelectedDate);
var today = DateTime.Today;
var culture = new System.Globalization.CultureInfo("it-IT");
for (var i = 0; i < 7; i++)
{
var day = start.AddDays(i);
var isSelected = day.Date == SelectedDate.Date;
var isToday = day.Date == today;
var cssClass = isSelected ? "selected" : (isToday ? "today" : "");
var dayName = day.ToString("ddd", culture);
var hasEvents = _eventsCache.ContainsKey(day.Date);
var eventCategories = hasEvents ? GetFilteredCategoriesForDay(day.Date) : [];
_weekDaysData[i] = new DayData(day, cssClass, eventCategories.Length > 0, eventCategories, dayName);
}
}
private CategoryData[] GetFilteredCategoriesForDay(DateTime date)
{
if (!_categoriesCache.TryGetValue(date, out var categories))
return [];
if (Filter.ClearFilter)
return categories;
// Applica i filtri alle categorie
var filteredActivities = GetFilteredActivitiesForDay(date);
if (!filteredActivities.Any())
return [];
return filteredActivities
.Select(x => x.Category)
.Distinct()
.Select(cat => new CategoryData(cat.ConvertToHumanReadable(), cat.ConvertToHumanReadable()))
.ToArray();
}
private List<ActivityDTO> GetFilteredActivitiesForDay(DateTime date)
{
if (!_eventsCache.TryGetValue(date, out var activities))
return [];
if (Filter.ClearFilter)
return activities;
var filteredActivity = activities.AsQueryable();
filteredActivity = filteredActivity
.Where(x => Filter.Text.IsNullOrEmpty() || (x.ActivityDescription != null && x.ActivityDescription.ContainsIgnoreCase(Filter.Text!)));
filteredActivity = filteredActivity
.Where(x => Filter.Type.IsNullOrEmpty() || (x.ActivityTypeId != null && x.ActivityTypeId.Equals(Filter.Type)));
filteredActivity = filteredActivity
.Where(x => Filter.Result.IsNullOrEmpty() || (x.ActivityResultId != null && x.ActivityResultId.Equals(Filter.Result)));
filteredActivity = filteredActivity
.Where(x => Filter.User.IsNullOrEmpty() || (x.UserName != null && Filter.User!.Contains(x.UserName)));
filteredActivity = filteredActivity
.Where(x => Filter.Category == null || x.Category.Equals(Filter.Category));
return filteredActivity
.OrderBy(x => x.EffectiveTime ?? x.EstimatedTime)
.ToList();
}
[JSInvokable]
public async Task OnSwipeLeft()
{
await CambiaPeriodo(1);
PrepareRenderingData();
StateHasChanged();
if (Expanded)
{
await LoadMonthData();
}
}
[JSInvokable]
public async Task OnSwipeRight()
{
await CambiaPeriodo(-1);
PrepareRenderingData();
StateHasChanged();
if (Expanded)
{
await LoadMonthData();
}
}
[JSInvokable]
public async Task OnSwipeDown()
{
if (!Expanded)
ToggleExpanded();
}
[JSInvokable]
public async Task OnSwipeUp()
{
if (Expanded)
ToggleExpanded();
}
// Cambio periodo mese/settimana
private async Task CambiaPeriodo(int direzione)
{
if (Expanded)
{
var y = CurrentMonth.Year;
var m = CurrentMonth.Month + direzione;
if (m < 1)
{
y--;
m = 12;
}
if (m > 12)
{
y++;
m = 1;
}
_internalMonth = new DateTime(y, m, 1);
}
else
{
await SelezionaData(SelectedDate.AddDays(7 * direzione));
_internalMonth = new DateTime(SelectedDate.Year, SelectedDate.Month, 1);
}
}
// Cambio modalità
private void ToggleExpanded()
{
if (Expanded)
{
SliderAnimation = "collapse-animation";
Expanded = false;
}
else
{
Expanded = true;
SliderAnimation = "expand-animation";
}
PrepareRenderingData();
StateHasChanged();
SliderAnimation = "";
StateHasChanged();
}
// Caricamento attività al cambio mese
private async Task LoadMonthData()
{
IsLoading = true;
StateHasChanged();
var start = CurrentMonth;
var end = start.AddDays(DaysInMonth - 1);
var activities = await ManageData.GetActivity(x =>
(x.EffectiveDate == null && x.EstimatedDate >= start && x.EstimatedDate <= end) ||
(x.EffectiveDate >= start && x.EffectiveDate <= end));
MonthActivities = activities.OrderBy(x => x.EffectiveDate ?? x.EstimatedDate).ToList();
PrepareRenderingData();
IsLoading = false;
StateHasChanged();
}
// Selezione giorno in settimana
private async Task SelezionaData(DateTime day)
{
SelectedDate = day;
var cacheInternalMonth = _internalMonth;
_internalMonth = new DateTime(day.Year, day.Month, 1);
if (cacheInternalMonth != _internalMonth)
{
await LoadMonthData();
}
else
{
PrepareRenderingData();
}
ApplyFilter();
StateHasChanged();
}
// Selezione giorno dal mese (chiude la vista mese!)
private async Task SelezionaDataDalMese(DateTime day)
{
SelectedDate = day;
SliderAnimation = "collapse-animation";
Expanded = false;
_internalMonth = new DateTime(day.Year, day.Month, 1);
PrepareRenderingData();
ApplyFilter();
StateHasChanged();
SliderAnimation = "";
StateHasChanged();
}
// Utility
private static bool IsSameDay(DateTime d1, DateTime d2) => d1.Date == d2.Date;
private static DateTime GetStartOfWeek(DateTime date)
{
var day = date.DayOfWeek == DayOfWeek.Sunday ? 7 : (int)date.DayOfWeek;
return date.AddDays(-day + 1).Date;
}
private List<ActivityDTO> GetEventsForDay(DateTime day)
=> _eventsCache.TryGetValue(day.Date, out var events) ? events : [];
public void Dispose()
{
_dotNetHelper?.Dispose();
}
private async Task OnActivityDeleted(ActivityDTO activity)
{
IsLoading = true;
await ManageData.DeleteActivity(activity);
var indexActivity = MonthActivities?.FindIndex(x => x.ActivityId.Equals(activity.ActivityId));
if (indexActivity != null)
{
MonthActivities?.RemoveAt(indexActivity.Value);
PrepareRenderingData();
ApplyFilter();
}
IsLoading = false;
}
private async Task OnActivityCreated(string activityId)
{
IsLoading = true;
var activity = (await ManageData.GetActivity(x => x.ActivityId.Equals(activityId))).LastOrDefault();
if (activity == null)
{
IsLoading = false;
return;
}
var date = activity.EffectiveDate ?? activity.EstimatedDate;
if (CurrentMonth.Month != date!.Value.Month)
{
IsLoading = false;
return;
}
MonthActivities.Add(activity);
PrepareRenderingData();
IsLoading = false;
ApplyFilter();
}
private async Task OnActivityChanged(string activityId)
{
var newActivity = await ManageData.GetActivity(x => x.ActivityId.Equals(activityId));
var indexActivity = MonthActivities?.FindIndex(x => x.ActivityId.Equals(activityId));
if (indexActivity != null && !newActivity.IsNullOrEmpty())
{
MonthActivities![indexActivity.Value] = newActivity[0];
PrepareRenderingData(); // Ricalcola i dati di rendering
ApplyFilter();
}
}
private void ToggleFilter()
{
OpenFilter = !OpenFilter;
StateHasChanged();
}
private void ApplyFilter()
{
FilteredActivities = GetFilteredActivitiesForDay(SelectedDate);
// Aggiorna i dati di rendering se il filtro è cambiato
if (Expanded)
{
PrepareMonthDaysData();
}
else
{
PrepareWeekDaysData();
}
StateHasChanged();
}
// Metodo ottimizzato per il rendering dei filtri
private List<ActivityDTO> ReturnFilteredActivity(DateTime day)
{
return GetFilteredActivitiesForDay(day);
}
}

View File

@@ -71,12 +71,12 @@
gap: 0.2rem;
}
.week-day > div:first-child {
font-size: 0.8rem;
color: var(--mud-palette-primary);
margin-bottom: 0.2rem;
font-weight: 500;
}
.week-day > div:first-child {
font-size: 0.8rem;
color: var(--mud-palette-text-primary);
margin-bottom: 0.2rem;
font-weight: 500;
}
.day {
background: var(--mud-palette-surface);
@@ -85,13 +85,14 @@
cursor: pointer;
transition: background 0.3s ease, transform 0.2s ease;
font-size: 0.95rem;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: var(--custom-box-shadow);
width: 38px;
height: 38px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: var(--mud-palette-text-primary);
border: 1px solid var(--mud-palette-surface);
margin: 0 auto;
}
@@ -107,9 +108,9 @@
}
.day.selected {
background: var(--mud-palette-secondary);
border: 1px solid var(--mud-palette-secondary);
color: white;
background: var(--mud-palette-tertiary);
border: 1px solid var(--mud-palette-tertiary);
color: var(--mud-palette-secondary);
}
.day.today { border: 1px solid var(--mud-palette-primary); }
@@ -119,12 +120,14 @@
gap: 1rem;
overflow-y: auto;
flex-direction: column;
height: 75vh;
-ms-overflow-style: none;
scrollbar-width: none;
padding-bottom: 45px;
padding-bottom: 70px;
height: calc(100% - 130px);
}
.appointments.ah-calendar-m { height: calc(100% - 315px) !important; }
.appointments::-webkit-scrollbar { display: none; }
.appointment {
@@ -132,13 +135,13 @@
border-radius: 8px;
padding: 0.8rem;
margin-bottom: 0.5rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
box-shadow: var(--custom-box-shadow);
}
.toggle-month {
background: none;
border: none;
color: var(--mud-palette-primary);
color: var(--mud-palette-text-primary);
font-size: 1rem;
cursor: pointer;
}
@@ -159,4 +162,6 @@
.event-dot.interna { background-color: var(--mud-palette-success-darken); }
.event-dot.commessa { background-color: var(--mud-palette-warning); }
.event-dot.commessa { background-color: var(--mud-palette-warning); }
@supports (-webkit-touch-callout: none) { .appointments { padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important; } }

View File

@@ -1,22 +1,24 @@
@page "/"
@using Template.Shared.Core.Interface
@attribute [Authorize]
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Components.Layout.Spinner
@inject IFormFactor FormFactor
@inject INetworkService NetworkService
<SpinnerLayout FullScreen="true" />
@code
{
protected override Task OnInitializedAsync()
protected override async Task OnInitializedAsync()
{
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
if (!FormFactor.IsWeb() && NetworkService.IsNetworkAvailable() && lastSyncDate.Equals(DateTime.MinValue))
{
NavigationManager.NavigateTo("/sync");
return base.OnInitializedAsync();
return;
}
NavigationManager.NavigateTo("/Calendar");
return base.OnInitializedAsync();
}
}

View File

@@ -1,6 +1,6 @@
@page "/login"
@using Template.Shared.Components.Layout.Spinner
@using Template.Shared.Core.Services
@using salesbook.Shared.Components.Layout.Spinner
@using salesbook.Shared.Core.Services
@inject IUserAccountService UserAccountService
@inject AppAuthenticationStateProvider AuthenticationStateProvider
@@ -10,41 +10,33 @@
}
else
{
<div class="center-box container d-flex justify-content-center align-items-center min-vh-100">
<div class="row rounded-4 bg-white">
<div class="appName rounded-4 d-flex justify-content-center align-items-center flex-column">
<span>Nome App</span>
</div>
<div class="col-md-6 right-box">
<div class="row align-items-center">
<div class="input-group mb-2">
<MudTextField @bind-Value="UserData.Username" Label="Username" Variant="Variant.Text"/>
</div>
<div class="input-group mb-2">
<MudTextField InputType="@_passwordInput" @bind-Value="UserData.Password" Label="Password" Variant="Variant.Text" Adornment="Adornment.End" AdornmentIcon="@_passwordInputIcon" OnAdornmentClick="ShowPassword" AdornmentAriaLabel="Show Password" />
</div>
<div class="input-group mb-4">
<MudTextField @bind-Value="UserData.CodHash" Label="Profilo azienda" Variant="Variant.Text"/>
</div>
<div class="input-group">
<div class="button-login" @onclick="SignInUser">
<span>Login</span>
</div>
</div>
<div class="login-page">
<div class="container container-top-logo">
<img src="_content/salesbook.Shared/images/salesbook-marchio_vers.positiva.svg" class="logo" alt="sales book">
</div>
<div class="container container-login">
<div class="login-form-container">
<div class="input-group">
<MudTextField @bind-Value="UserData.Username" Label="Username" Variant="Variant.Outlined"/>
</div>
<div class="input-group">
<MudTextField InputType="@_passwordInput" @bind-Value="UserData.Password" Label="Password" Variant="Variant.Outlined" Adornment="Adornment.End" AdornmentIcon="@_passwordInputIcon" OnAdornmentClick="ShowPassword" AdornmentAriaLabel="Show Password"/>
</div>
<div class="input-group mb-2">
<MudTextField @bind-Value="UserData.CodHash" Label="Profilo azienda" Variant="Variant.Outlined"/>
</div>
<div class="my-4 login-footer">
<span>Powered by</span>
<img src="_content/Template.Shared/images/logoIntegry.svg" class="img-fluid" alt="Integry">
</div>
<MudButton OnClick="SignInUser" Color="Color.Primary" Variant="Variant.Filled">Login</MudButton>
@if (_attemptFailed)
{
<MudAlert Class="my-3" Dense="true" Severity="Severity.Error" Variant="Variant.Filled">@ErrorMessage</MudAlert>
}
</div>
<div class="my-4 login-footer">
<span>Powered by</span>
<img src="_content/salesbook.Shared/images/logoIntegry.svg" class="img-fluid" alt="Integry">
</div>
</div>
</div>
}

View File

@@ -0,0 +1,54 @@
.login-page {
height: 100%;
display: flex;
flex-direction: column;
background: var(--mud-palette-surface);
}
.container-top-logo > .logo {
width: 50%;
}
.container-login > span {
font-size: large;
font-weight: 900;
text-align: center;
}
.container-top-logo {
height: 35vh;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
}
.login-form-container {
display: flex;
flex-direction: column;
gap: 1rem;
}
.container-login {
height: 100%;
display: flex;
flex-direction: column;
padding: 4px 16px 16px;
justify-content: space-between;
}
.login-footer {
width: 100%;
display: flex;
justify-content: center;
}
.login-footer span {
font-size: 9px;
color: var(--mud-palette-gray-darker);
}
.login-footer img {
height: 15px;
margin-left: 4px;
}

View File

@@ -0,0 +1,14 @@
@page "/Notifications"
@attribute [Authorize]
@using salesbook.Shared.Components.Layout
@using salesbook.Shared.Components.SingleElements
<HeaderLayout Title="Notifiche" />
<div class="container">
<NoDataAvailable Text="Nessuna notifica meno recente" />
</div>
@code {
}

View File

@@ -0,0 +1,164 @@
@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
@inject AppAuthenticationStateProvider AuthenticationStateProvider
@inject INetworkService NetworkService
@inject IFormFactor FormFactor
<HeaderLayout BackTo="Indietro" Back="true" BackOnTop="true" Title="Profilo" ShowProfile="false"/>
@if (IsLoggedIn)
{
<div class="container content">
<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">
@UtilityString.ExtractInitials(UserSession.User.Fullname)
</MudAvatar>
<div class="personal-info">
<span class="info-nome">@UserSession.User.Fullname</span>
@if (UserSession.User.KeyGroup is not null)
{
<span class="info-section">@(((KeyGroupEnum)UserSession.User.KeyGroup).ConvertToHumanReadable())</span>
}
</div>
</div>
<div class="divider"></div>
<div class="section-info">
<div class="section-personal-info">
<div>
<span class="info-title">Telefono</span>
<span class="info-text">000 0000000</span> @*Todo: to implement*@
</div>
<div>
<span class="info-title">Status</span>
@if (NetworkService.IsNetworkAvailable())
{
<div class="status online">
<i class="ri-wifi-line"></i>
<span>Online</span>
</div>
}
else
{
<div class="status offline">
<i class="ri-wifi-off-line"></i>
<span>Offline</span>
</div>
}
</div>
</div>
<div class="section-personal-info">
<div>
<span class="info-title">E-mail</span>
<span class="info-text">
@if (string.IsNullOrEmpty(UserSession.User.Email))
{
@("Nessuna mail configurata")
}
else
{
@UserSession.User.Email
}
</span>
</div>
<div>
<span class="info-title">Ultima sincronizzazione</span>
<span class="info-text">@LastSync.ToString("g")</span>
</div>
</div>
</div>
</div>
<div class="container-button">
<MudButton Class="button-settings green-icon"
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
Size="Size.Medium"
OnClick="() => UpdateDb(true)"
Variant="Variant.Outlined">
Sincronizza
</MudButton>
<div class="divider"></div>
<MudButton Class="button-settings red-icon"
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
Size="Size.Medium"
OnClick="() => UpdateDb()"
Variant="Variant.Outlined">
Ripristina dati
</MudButton>
</div>
<div class="container-button">
<MudButton Class="button-settings exit"
FullWidth="true"
Color="Color.Error"
Size="Size.Medium"
OnClick="Logout"
Variant="Variant.Outlined">
Esci
</MudButton>
</div>
</div>
}
@code {
private bool Unavailable { get; set; }
private bool IsLoggedIn { get; set; }
private DateTime LastSync { get; set; }
protected override async Task OnInitializedAsync()
{
IsLoggedIn = await UserSession.IsLoggedIn();
await LoadData();
}
private async Task LoadData()
{
await Task.Run(() =>
{
Unavailable = FormFactor.IsWeb() || !NetworkService.IsNetworkAvailable();
LastSync = LocalStorage.Get<DateTime>("last-sync");
});
StateHasChanged();
}
private void OpenSettings() =>
NavigationManager.NavigateTo("/settings/Profilo");
private async Task Logout()
{
await AuthenticationStateProvider.SignOut();
IsLoggedIn = await UserSession.IsLoggedIn();
StateHasChanged();
}
private void UpdateDb(bool withData = false)
{
var absoluteUri = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
var pathAndQuery = absoluteUri.Segments.Length > 1 ? absoluteUri.PathAndQuery : null;
string path;
if (withData)
path = pathAndQuery == null ? $"/sync/{DateTime.Today:yyyy-MM-dd}" : $"/sync/{DateTime.Today:yyyy-MM-dd}?path=" + System.Web.HttpUtility.UrlEncode(pathAndQuery);
else
path = pathAndQuery == null ? "/sync" : "/sync?path=" + System.Web.HttpUtility.UrlEncode(pathAndQuery);
NavigationManager.NavigateTo(path, replace: true);
}
}

Some files were not shown because too many files have changed in this diff Show More