Compare commits
23 Commits
0032648e76
...
feature/Na
| Author | SHA1 | Date | |
|---|---|---|---|
| ddc596ef58 | |||
| ddbf9c832e | |||
| 201cfd4bc6 | |||
| 87264cf3aa | |||
| dba3cd0357 | |||
| 516fcca7cb | |||
| 453e291827 | |||
| 443ed95013 | |||
| a28b8e2f6c | |||
| 108fa715f0 | |||
| 3ad3ec23f0 | |||
| 3f2b7a6bb5 | |||
| a34e673cd2 | |||
| 10c1435dba | |||
| a97df74ef4 | |||
| 6c789a099e | |||
| 7f8dae7c7d | |||
| 51a4c7a971 | |||
| 4608c6764b | |||
| 6600660315 | |||
| d6c7742501 | |||
| 3a374baaba | |||
| 7ca4de628b |
@@ -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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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>
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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>
|
|
||||||
@@ -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>
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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>
|
|
||||||
@@ -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>
|
|
||||||
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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>
|
|
||||||
@@ -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");
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
@page "/Users"
|
|
||||||
@attribute [Authorize]
|
|
||||||
@using Template.Shared.Components.Layout
|
|
||||||
|
|
||||||
<HeaderLayout Title="Contatti" />
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Template.Shared.Core.Dto;
|
|
||||||
|
|
||||||
public class ActivityResultDTO
|
|
||||||
{
|
|
||||||
public string ActivityResultId { get; set; }
|
|
||||||
}
|
|
||||||
@@ -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)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Template.Shared.Core.Helpers.Enum;
|
|
||||||
|
|
||||||
public enum ActivityStatusEnum
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
@@ -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)!;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
window.goBack = function () {
|
|
||||||
history.back();
|
|
||||||
};
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,11 +3,11 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
|
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
|
||||||
android:Application.WindowSoftInputModeAdjust="Resize"
|
android:Application.WindowSoftInputModeAdjust="Resize"
|
||||||
x:Class="Template.Maui.App">
|
x:Class="salesbook.Maui.App">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
|
||||||
<Color x:Key="PageBackgroundColor">#512bdf</Color>
|
<Color x:Key="PageBackgroundColor">#dff2ff</Color>
|
||||||
<Color x:Key="PrimaryTextColor">White</Color>
|
<Color x:Key="PrimaryTextColor">White</Color>
|
||||||
|
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
|
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
|
||||||
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
||||||
<Setter Property="BackgroundColor" Value="#2b0b98" />
|
<Setter Property="BackgroundColor" Value="#dff2ff" />
|
||||||
<Setter Property="Padding" Value="14,10" />
|
<Setter Property="Padding" Value="14,10" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
15
salesbook.Maui/App.xaml.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
|
|
||||||
|
namespace salesbook.Maui
|
||||||
|
{
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
public App(IMessenger messenger)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
MainPage = new NavigationPage(new MainPage(messenger));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
public class FormFactor : IFormFactor
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using SQLite;
|
using SQLite;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Template.Shared.Core.Entity;
|
using salesbook.Shared.Core.Entity;
|
||||||
namespace Template.Maui.Core.Services;
|
|
||||||
|
namespace salesbook.Maui.Core.Services;
|
||||||
|
|
||||||
public class LocalDbService
|
public class LocalDbService
|
||||||
{
|
{
|
||||||
@@ -19,10 +20,34 @@ public class LocalDbService
|
|||||||
_connection.CreateTableAsync<StbActivity>();
|
_connection.CreateTableAsync<StbActivity>();
|
||||||
_connection.CreateTableAsync<VtbCliePersRif>();
|
_connection.CreateTableAsync<VtbCliePersRif>();
|
||||||
_connection.CreateTableAsync<VtbDest>();
|
_connection.CreateTableAsync<VtbDest>();
|
||||||
|
_connection.CreateTableAsync<StbActivityResult>();
|
||||||
|
_connection.CreateTableAsync<StbActivityType>();
|
||||||
|
_connection.CreateTableAsync<StbUser>();
|
||||||
|
}
|
||||||
|
|
||||||
|
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.CreateTableAsync<StbActivityResult>();
|
||||||
|
await _connection.CreateTableAsync<StbActivityType>();
|
||||||
|
await _connection.CreateTableAsync<StbUser>();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Errore durante il reset del database(settings): {ex.Message}");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ResetDb()
|
public async Task ResetDb()
|
||||||
{
|
{
|
||||||
|
await ResetSettingsDb();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _connection.ExecuteAsync("DROP TABLE IF EXISTS anag_clie;");
|
await _connection.ExecuteAsync("DROP TABLE IF EXISTS anag_clie;");
|
||||||
@@ -86,4 +111,7 @@ public class LocalDbService
|
|||||||
: _connection.Table<T>().Where(whereCond).ToListAsync();
|
: _connection.Table<T>().Where(whereCond).ToListAsync();
|
||||||
|
|
||||||
public List<T> Get<T>(string sql) where T : new() => _connection.QueryAsync<T>(sql).Result;
|
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);
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,15 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Template.Shared.Core.Dto;
|
using salesbook.Shared.Core.Dto;
|
||||||
using Template.Shared.Core.Entity;
|
using salesbook.Shared.Core.Entity;
|
||||||
using Template.Shared.Core.Helpers.Enum;
|
using salesbook.Shared.Core.Helpers.Enum;
|
||||||
using Template.Shared.Core.Interface;
|
using salesbook.Shared.Core.Interface;
|
||||||
|
|
||||||
namespace Template.Maui.Core.Services;
|
namespace salesbook.Maui.Core.Services;
|
||||||
|
|
||||||
public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManageDataService
|
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 Task<List<PtbPros>> GetPtbPros(Expression<Func<PtbPros, bool>>? whereCond = null) =>
|
|
||||||
localDb.Get(whereCond);
|
|
||||||
|
|
||||||
public Task<List<PtbProsRif>> GetPtbProsRif(Expression<Func<PtbProsRif, bool>>? whereCond = null) =>
|
|
||||||
localDb.Get(whereCond);
|
|
||||||
|
|
||||||
public Task<List<StbActivity>> GetStbActivity(Expression<Func<StbActivity, bool>>? whereCond = null) =>
|
|
||||||
localDb.Get(whereCond);
|
|
||||||
|
|
||||||
public Task<List<VtbCliePersRif>> GetVtbCliePersRif(Expression<Func<VtbCliePersRif, bool>>? whereCond = null) =>
|
|
||||||
localDb.Get(whereCond);
|
|
||||||
|
|
||||||
public Task<List<VtbDest>> GetVtbDest(Expression<Func<VtbDest, bool>>? whereCond = null) =>
|
|
||||||
localDb.Get(whereCond);
|
localDb.Get(whereCond);
|
||||||
|
|
||||||
public async Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
|
public async Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
|
||||||
@@ -66,11 +48,12 @@ public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManage
|
|||||||
dto.Category = activity.CodAnag != null ? ActivityCategoryEnum.Interna : ActivityCategoryEnum.Memo;
|
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;
|
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;
|
dto.Cliente = ragSoc;
|
||||||
}
|
}
|
||||||
@@ -86,6 +69,19 @@ public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManage
|
|||||||
return returnDto;
|
return returnDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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() =>
|
public Task ClearDb() =>
|
||||||
localDb.ResetDb();
|
localDb.ResetDb();
|
||||||
}
|
}
|
||||||
15
salesbook.Maui/Core/Services/NavigationService.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using salesbook.Shared.Core.Interface;
|
||||||
|
|
||||||
|
namespace salesbook.Maui.Core.Services;
|
||||||
|
|
||||||
|
public class NavigationService(IServiceProvider serviceProvider) : INavigationService
|
||||||
|
{
|
||||||
|
public async Task NavigateToDetailsAsync()
|
||||||
|
{
|
||||||
|
var detailsPage = serviceProvider.GetService<PersonalInfo>();
|
||||||
|
if (Application.Current.MainPage is NavigationPage nav && detailsPage != null)
|
||||||
|
{
|
||||||
|
await nav.Navigation.PushAsync(detailsPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
public class NetworkService : INetworkService
|
||||||
{
|
{
|
||||||
18
salesbook.Maui/Core/Services/PageTitleService.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using salesbook.Shared.Core.Interface;
|
||||||
|
|
||||||
|
namespace salesbook.Maui.Core.Services;
|
||||||
|
|
||||||
|
public class PageTitleService(IDispatcher dispatcher) : IPageTitleService
|
||||||
|
{
|
||||||
|
public void SetTitle(string title)
|
||||||
|
{
|
||||||
|
dispatcher.Dispatch(() =>
|
||||||
|
{
|
||||||
|
if (Application.Current?.MainPage is NavigationPage nav &&
|
||||||
|
nav.CurrentPage is ContentPage cp)
|
||||||
|
{
|
||||||
|
cp.Title = title;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
86
salesbook.Maui/Core/Services/SyncDbService.cs
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
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!);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:local="clr-namespace:Template.Maui"
|
xmlns:shared="clr-namespace:salesbook.Shared;assembly=salesbook.Shared"
|
||||||
xmlns:shared="clr-namespace:Template.Shared;assembly=Template.Shared"
|
x:Class="salesbook.Maui.MainPage"
|
||||||
x:Class="Template.Maui.MainPage"
|
|
||||||
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
||||||
|
|
||||||
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
|
<BlazorWebView HostPage="wwwroot/index.html">
|
||||||
<BlazorWebView.RootComponents>
|
<BlazorWebView.RootComponents>
|
||||||
<RootComponent Selector="#app" ComponentType="{x:Type shared:Components.Routes}" />
|
<RootComponent Selector="#app" ComponentType="{x:Type shared:Components.Routes}" />
|
||||||
</BlazorWebView.RootComponents>
|
</BlazorWebView.RootComponents>
|
||||||
25
salesbook.Maui/MainPage.xaml.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
Title = "Home";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnBackButtonPressed()
|
||||||
|
{
|
||||||
|
_messenger.Send(new HardwareBackMessage("back"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,21 @@
|
|||||||
using CommunityToolkit.Maui;
|
using CommunityToolkit.Maui;
|
||||||
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
using IntegryApiClient.MAUI;
|
using IntegryApiClient.MAUI;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using MudBlazor.Services;
|
using MudBlazor.Services;
|
||||||
using MudExtensions.Services;
|
using MudExtensions.Services;
|
||||||
using Template.Maui.Core.Services;
|
using salesbook.Maui.Core.Services;
|
||||||
using Template.Shared;
|
using salesbook.Shared;
|
||||||
using Template.Shared.Core.Helpers;
|
using salesbook.Shared.Core.Helpers;
|
||||||
using Template.Shared.Core.Interface;
|
using salesbook.Shared.Core.Interface;
|
||||||
using Template.Shared.Core.Messages;
|
using salesbook.Shared.Core.Messages.Activity.Copy;
|
||||||
using Template.Shared.Core.Services;
|
using salesbook.Shared.Core.Messages.Activity.New;
|
||||||
|
using salesbook.Shared.Core.Messages.Back;
|
||||||
|
using salesbook.Shared.Core.Services;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
public static class MauiProgram
|
public static class MauiProgram
|
||||||
{
|
{
|
||||||
@@ -21,14 +25,14 @@ namespace Template.Maui
|
|||||||
{
|
{
|
||||||
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
|
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
|
||||||
|
|
||||||
|
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("it-IT");
|
||||||
|
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("it-IT");
|
||||||
|
|
||||||
var builder = MauiApp.CreateBuilder();
|
var builder = MauiApp.CreateBuilder();
|
||||||
builder
|
builder
|
||||||
.UseMauiApp<App>()
|
.UseMauiApp<App>()
|
||||||
.UseMauiCommunityToolkit()
|
.UseMauiCommunityToolkit()
|
||||||
.ConfigureFonts(fonts =>
|
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); })
|
||||||
{
|
|
||||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
||||||
})
|
|
||||||
.UseLoginAzienda(AppToken);
|
.UseLoginAzienda(AppToken);
|
||||||
|
|
||||||
builder.Services.AddMauiBlazorWebView();
|
builder.Services.AddMauiBlazorWebView();
|
||||||
@@ -46,7 +50,12 @@ namespace Template.Maui
|
|||||||
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
|
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
|
||||||
builder.Services.AddScoped<ISyncDbService, SyncDbService>();
|
builder.Services.AddScoped<ISyncDbService, SyncDbService>();
|
||||||
builder.Services.AddScoped<IManageDataService, ManageDataService>();
|
builder.Services.AddScoped<IManageDataService, ManageDataService>();
|
||||||
|
|
||||||
|
//Message
|
||||||
|
builder.Services.AddScoped<IMessenger, WeakReferenceMessenger>();
|
||||||
|
builder.Services.AddScoped<NewActivityService>();
|
||||||
builder.Services.AddScoped<BackNavigationService>();
|
builder.Services.AddScoped<BackNavigationService>();
|
||||||
|
builder.Services.AddScoped<CopyActivityService>();
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
builder.Services.AddBlazorWebViewDeveloperTools();
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||||
@@ -56,6 +65,10 @@ namespace Template.Maui
|
|||||||
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
||||||
builder.Services.AddSingleton<LocalDbService>();
|
builder.Services.AddSingleton<LocalDbService>();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<INavigationService, NavigationService>();
|
||||||
|
builder.Services.AddSingleton<IPageTitleService, PageTitleService>();
|
||||||
|
builder.Services.AddTransient<PersonalInfo>();
|
||||||
|
|
||||||
return builder.Build();
|
return builder.Build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
14
salesbook.Maui/PersonalInfo.xaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:components="clr-namespace:salesbook.Shared.Components;assembly=salesbook.Shared"
|
||||||
|
x:Class="salesbook.Maui.PersonalInfo"
|
||||||
|
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
||||||
|
|
||||||
|
<BlazorWebView HostPage="wwwroot/index.html" StartPath="/PersonalInfo">
|
||||||
|
<BlazorWebView.RootComponents>
|
||||||
|
<RootComponent Selector="#app" ComponentType="{x:Type components:Routes}" />
|
||||||
|
</BlazorWebView.RootComponents>
|
||||||
|
</BlazorWebView>
|
||||||
|
|
||||||
|
</ContentPage>
|
||||||
11
salesbook.Maui/PersonalInfo.xaml.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace salesbook.Maui;
|
||||||
|
|
||||||
|
public partial class PersonalInfo : ContentPage
|
||||||
|
{
|
||||||
|
public PersonalInfo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
Title = "Profilo";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Content.PM;
|
using Android.Content.PM;
|
||||||
|
using AndroidX.AppCompat.App;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
[Activity(Theme = "@style/Maui.SplashTheme",
|
[Activity(Theme = "@style/Maui.SplashTheme",
|
||||||
MainLauncher = true,
|
MainLauncher = true,
|
||||||
@@ -9,5 +10,9 @@ namespace Template.Maui
|
|||||||
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
||||||
public class MainActivity : MauiAppCompatActivity
|
public class MainActivity : MauiAppCompatActivity
|
||||||
{
|
{
|
||||||
|
public MainActivity()
|
||||||
|
{
|
||||||
|
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Runtime;
|
using Android.Runtime;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
[Application]
|
[Application]
|
||||||
public class MainApplication : MauiApplication
|
public class MainApplication : MauiApplication
|
||||||
@@ -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>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Foundation;
|
using Foundation;
|
||||||
using Template.Maui;
|
using salesbook.Maui;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public class AppDelegate : MauiUIApplicationDelegate
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using ObjCRuntime;
|
using ObjCRuntime;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Foundation;
|
using Foundation;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public class AppDelegate : MauiUIApplicationDelegate
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
@@ -35,5 +35,8 @@
|
|||||||
<key>NSAllowsArbitraryLoads</key>
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
||||||
|
<key>UIUserInterfaceStyle</key>
|
||||||
|
<string>Light</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
1
salesbook.Maui/Resources/AppIcon/appicon.svg
Normal 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 |
1
salesbook.Maui/Resources/AppIcon/appiconfg.svg
Normal 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 |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
40
salesbook.Maui/Resources/Splash/splash.svg
Normal 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 |
@@ -15,7 +15,7 @@
|
|||||||
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||||
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>Template.Maui</RootNamespace>
|
<RootNamespace>salesbook.Maui</RootNamespace>
|
||||||
<UseMaui>true</UseMaui>
|
<UseMaui>true</UseMaui>
|
||||||
<SingleProject>true</SingleProject>
|
<SingleProject>true</SingleProject>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
@@ -23,14 +23,14 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
<!-- Display name -->
|
<!-- Display name -->
|
||||||
<ApplicationTitle>Template.Maui</ApplicationTitle>
|
<ApplicationTitle>salesbook</ApplicationTitle>
|
||||||
|
|
||||||
<!-- App Identifier -->
|
<!-- App Identifier -->
|
||||||
<ApplicationId>it.integry.template.maui</ApplicationId>
|
<ApplicationId>it.integry.salesbook</ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>1.0.0</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>1</ApplicationVersion>
|
<ApplicationVersion>3</ApplicationVersion>
|
||||||
|
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
||||||
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||||
@@ -92,12 +92,19 @@
|
|||||||
-->
|
-->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
|
||||||
<!-- App Icon -->
|
<!-- Android App Icon -->
|
||||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
|
<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 -->
|
<!-- 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 -->
|
<!-- Images -->
|
||||||
<MauiImage Include="Resources\Images\*" />
|
<MauiImage Include="Resources\Images\*" />
|
||||||
@@ -123,7 +130,19 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Template.Shared\Template.Shared.csproj" />
|
<ProjectReference Include="..\salesbook.Shared\salesbook.Shared.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="PersonalInfo.xaml.cs">
|
||||||
|
<DependentUpon>PersonalInfo.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<MauiXaml Update="PersonalInfo.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</MauiXaml>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
59
salesbook.Maui/wwwroot/index.html
Normal 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>
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
|
@using Microsoft.Maui.Controls
|
||||||
|
@using salesbook.Shared.Core.Interface
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
|
@inject INavigationService NavigationService
|
||||||
|
|
||||||
<div class="container header">
|
<div class="@(Back ? "" : "container") header">
|
||||||
<div class="header-content @(Back ? "with-back" : "no-back")">
|
<div class="header-content @(Back ? "with-back" : "no-back")">
|
||||||
@if (Back)
|
@if (Back)
|
||||||
{
|
{
|
||||||
@@ -22,15 +25,17 @@
|
|||||||
{
|
{
|
||||||
@if (ShowFilter)
|
@if (ShowFilter)
|
||||||
{
|
{
|
||||||
<MudIconButton Icon="@Icons.Material.Outlined.FilterAlt" Color="Color.Dark"/>
|
<MudIconButton OnClick="OnFilterToggle" Icon="@Icons.Material.Outlined.FilterAlt"/>
|
||||||
}
|
}
|
||||||
@if (ShowNotifications)
|
|
||||||
{
|
@* @if (ShowCalendarToggle)
|
||||||
@* <MudIconButton Icon="@Icons.Material.Filled.Notifications" Color="Color.Dark"/> *@
|
|
||||||
}
|
|
||||||
@if (ShowCalendarToggle)
|
|
||||||
{
|
{
|
||||||
<MudIconButton OnClick="OnCalendarToggle" Icon="@Icons.Material.Filled.CalendarMonth" Color="Color.Dark"/>
|
<MudIconButton OnClick="OnCalendarToggle" Icon="@Icons.Material.Filled.CalendarMonth" Color="Color.Dark"/>
|
||||||
|
} *@
|
||||||
|
|
||||||
|
@if (ShowProfile)
|
||||||
|
{
|
||||||
|
<MudIconButton Class="user" OnClick="OpenPersonalInfo" Icon="@Icons.Material.Filled.Person"/>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -49,10 +54,13 @@
|
|||||||
@code{
|
@code{
|
||||||
[Parameter] public string? Title { get; set; }
|
[Parameter] public string? Title { get; set; }
|
||||||
[Parameter] public bool ShowFilter { get; set; }
|
[Parameter] public bool ShowFilter { get; set; }
|
||||||
[Parameter] public bool ShowNotifications { get; set; } = true;
|
[Parameter] public bool ShowProfile { get; set; } = true;
|
||||||
[Parameter] public bool Back { get; set; }
|
[Parameter] public bool Back { get; set; }
|
||||||
|
[Parameter] public bool BackOnTop { get; set; }
|
||||||
[Parameter] public string BackTo { get; set; } = "";
|
[Parameter] public string BackTo { get; set; } = "";
|
||||||
|
|
||||||
|
[Parameter] public EventCallback OnFilterToggle { get; set; }
|
||||||
|
|
||||||
[Parameter] public bool Cancel { get; set; }
|
[Parameter] public bool Cancel { get; set; }
|
||||||
[Parameter] public EventCallback OnCancel { get; set; }
|
[Parameter] public EventCallback OnCancel { get; set; }
|
||||||
[Parameter] public string? LabelSave { get; set; }
|
[Parameter] public string? LabelSave { get; set; }
|
||||||
@@ -76,7 +84,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
await JS.InvokeVoidAsync("goBack");
|
await JS.InvokeVoidAsync("goBack");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OpenPersonalInfo()
|
||||||
|
{
|
||||||
|
await NavigationService.NavigateToDetailsAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-content.with-back { margin: .6rem 0 0 0; }
|
|
||||||
|
|
||||||
.header-content.with-back .page-title {
|
.header-content.with-back .page-title {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@@ -16,14 +14,8 @@
|
|||||||
font-size: larger;
|
font-size: larger;
|
||||||
}
|
}
|
||||||
|
|
||||||
.left-section ::deep button, .right-section ::deep button {
|
.left-section ::deep button, .right-section ::deep button { font-size: 1.1rem; }
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-section ::deep .mud-button-icon-start {
|
.left-section ::deep .mud-button-icon-start { margin-right: 3px !important; }
|
||||||
margin-right: 3px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-content.no-back .page-title {
|
.header-content.no-back .page-title { margin: 0; }
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
92
salesbook.Shared/Components/Layout/MainLayout.razor
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
@using System.Globalization
|
||||||
|
@using salesbook.Shared.Core.Interface
|
||||||
|
@using salesbook.Shared.Core.Messages.Back
|
||||||
|
@inherits LayoutComponentBase
|
||||||
|
@inject IJSRuntime JS
|
||||||
|
@inject BackNavigationService BackService
|
||||||
|
@inject INavigationService NavigationService
|
||||||
|
|
||||||
|
<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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
96
salesbook.Shared/Components/Layout/NavMenu.razor
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
@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
|
||||||
|
@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 Disabled="true">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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,17 +1,41 @@
|
|||||||
.navbar {
|
.animated-navbar {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1001;
|
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-bottom: 1rem;
|
||||||
padding-top: 0 !important;
|
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 {
|
.container-navbar {
|
||||||
background: var(--mud-palette-surface);
|
background: var(--mud-palette-surface);
|
||||||
border-radius: 15px;
|
border-radius: 50px;
|
||||||
|
padding: 0 10px;
|
||||||
box-shadow: var(--custom-box-shadow);
|
box-shadow: var(--custom-box-shadow);
|
||||||
|
transition: all 0.3s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item { font-size: 0.9rem; }
|
.nav-item { font-size: 0.9rem; }
|
||||||
@@ -21,29 +45,33 @@
|
|||||||
bottom: 15px;
|
bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item ::deep .custom-plus-button .mud-icon-root {
|
.navbar ::deep .custom-plus-button .mud-icon-root {
|
||||||
transition: .513s;
|
transition: .5s;
|
||||||
transform: rotate(0);
|
transform: rotate(0);
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item ::deep .custom-plus-button:focus .mud-icon-root {
|
.navbar ::deep .custom-plus-button {
|
||||||
transform: rotate(225deg);
|
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 {
|
.nav-item ::deep a {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding-top: .5rem !important;
|
padding-top: .25rem !important;
|
||||||
padding-bottom: .5rem !important;
|
padding-bottom: .25rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-item ::deep a > div {
|
.nav-item ::deep a > div {
|
||||||
-webkit-transition: all .1s ease-out;
|
-webkit-transition: all .1s ease-out;
|
||||||
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); }
|
.nav-item ::deep a.active > div { color: var(--mud-palette-primary); }
|
||||||
@@ -66,8 +94,4 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
@supports (-webkit-touch-callout: none) {
|
@supports (-webkit-touch-callout: none) { .navbar { padding-bottom: env(safe-area-inset-bottom); } }
|
||||||
.nav-item { padding-bottom: env(safe-area-inset-bottom) !important; }
|
|
||||||
|
|
||||||
.nav-item ::deep > .nav-link { padding-bottom: 0 !important; }
|
|
||||||
}
|
|
||||||
23
salesbook.Shared/Components/Layout/Overlay/SaveOverlay.razor
Normal 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; }
|
||||||
|
}
|
||||||
156
salesbook.Shared/Components/Layout/Overlay/SaveOverlay.razor.css
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
626
salesbook.Shared/Components/Pages/Calendar.razor
Normal file
@@ -0,0 +1,626 @@
|
|||||||
|
@page "/Calendar"
|
||||||
|
@using salesbook.Shared.Core.Dto
|
||||||
|
@using salesbook.Shared.Core.Interface
|
||||||
|
@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
|
||||||
|
@inject IPageTitleService PageTitleService
|
||||||
|
|
||||||
|
@* <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();
|
||||||
|
PageTitleService?.SetTitle(_headerTitle);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -71,12 +71,12 @@
|
|||||||
gap: 0.2rem;
|
gap: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.week-day > div:first-child {
|
.week-day > div:first-child {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: var(--mud-palette-primary);
|
color: var(--mud-palette-text-primary);
|
||||||
margin-bottom: 0.2rem;
|
margin-bottom: 0.2rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.day {
|
.day {
|
||||||
background: var(--mud-palette-surface);
|
background: var(--mud-palette-surface);
|
||||||
@@ -85,13 +85,14 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background 0.3s ease, transform 0.2s ease;
|
transition: background 0.3s ease, transform 0.2s ease;
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
box-shadow: var(--custom-box-shadow);
|
||||||
width: 38px;
|
width: 38px;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
color: var(--mud-palette-text-primary);
|
||||||
border: 1px solid var(--mud-palette-surface);
|
border: 1px solid var(--mud-palette-surface);
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
@@ -107,9 +108,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.day.selected {
|
.day.selected {
|
||||||
background: var(--mud-palette-secondary);
|
background: var(--mud-palette-tertiary);
|
||||||
border: 1px solid var(--mud-palette-secondary);
|
border: 1px solid var(--mud-palette-tertiary);
|
||||||
color: white;
|
color: var(--mud-palette-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.day.today { border: 1px solid var(--mud-palette-primary); }
|
.day.today { border: 1px solid var(--mud-palette-primary); }
|
||||||
@@ -119,12 +120,14 @@
|
|||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 75vh;
|
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
scrollbar-width: 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; }
|
.appointments::-webkit-scrollbar { display: none; }
|
||||||
|
|
||||||
.appointment {
|
.appointment {
|
||||||
@@ -132,13 +135,13 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 0.8rem;
|
padding: 0.8rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
box-shadow: var(--custom-box-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-month {
|
.toggle-month {
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
color: var(--mud-palette-primary);
|
color: var(--mud-palette-text-primary);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@@ -160,3 +163,5 @@
|
|||||||
.event-dot.interna { background-color: var(--mud-palette-success-darken); }
|
.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; } }
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
@page "/"
|
@page "/"
|
||||||
@using Template.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@inject IFormFactor FormFactor
|
@inject IFormFactor FormFactor
|
||||||
@inject INetworkService NetworkService
|
@inject INetworkService NetworkService
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
@page "/login"
|
@page "/login"
|
||||||
@using Template.Shared.Components.Layout.Spinner
|
@using salesbook.Shared.Components.Layout.Spinner
|
||||||
@using Template.Shared.Core.Services
|
@using salesbook.Shared.Core.Services
|
||||||
@inject IUserAccountService UserAccountService
|
@inject IUserAccountService UserAccountService
|
||||||
@inject AppAuthenticationStateProvider AuthenticationStateProvider
|
@inject AppAuthenticationStateProvider AuthenticationStateProvider
|
||||||
|
|
||||||
@@ -10,41 +10,33 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="center-box container d-flex justify-content-center align-items-center min-vh-100">
|
<div class="login-page">
|
||||||
<div class="row rounded-4 bg-white">
|
<div class="container container-top-logo">
|
||||||
|
<img src="_content/salesbook.Shared/images/salesbook-marchio_vers.positiva.svg" class="logo" alt="sales book">
|
||||||
<div class="appName rounded-4 d-flex justify-content-center align-items-center flex-column">
|
|
||||||
<span>Nome App</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="container container-login">
|
||||||
<div class="col-md-6 right-box">
|
<div class="login-form-container">
|
||||||
<div class="row align-items-center">
|
<div class="input-group">
|
||||||
<div class="input-group mb-2">
|
<MudTextField @bind-Value="UserData.Username" Label="Username" Variant="Variant.Outlined"/>
|
||||||
<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>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="button-login" @onclick="SignInUser">
|
<MudTextField InputType="@_passwordInput" @bind-Value="UserData.Password" Label="Password" Variant="Variant.Outlined" Adornment="Adornment.End" AdornmentIcon="@_passwordInputIcon" OnAdornmentClick="ShowPassword" AdornmentAriaLabel="Show Password"/>
|
||||||
<span>Login</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="input-group mb-2">
|
||||||
|
<MudTextField @bind-Value="UserData.CodHash" Label="Profilo azienda" Variant="Variant.Outlined"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="my-4 login-footer">
|
<MudButton OnClick="SignInUser" Color="Color.Primary" Variant="Variant.Filled">Login</MudButton>
|
||||||
<span>Powered by</span>
|
|
||||||
<img src="_content/Template.Shared/images/logoIntegry.svg" class="img-fluid" alt="Integry">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (_attemptFailed)
|
@if (_attemptFailed)
|
||||||
{
|
{
|
||||||
<MudAlert Class="my-3" Dense="true" Severity="Severity.Error" Variant="Variant.Filled">@ErrorMessage</MudAlert>
|
<MudAlert Class="my-3" Dense="true" Severity="Severity.Error" Variant="Variant.Filled">@ErrorMessage</MudAlert>
|
||||||
}
|
}
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
54
salesbook.Shared/Components/Pages/Login.razor.css
Normal 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;
|
||||||
|
}
|
||||||
19
salesbook.Shared/Components/Pages/Notifications.razor
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
@page "/Notifications"
|
||||||
|
@attribute [Authorize]
|
||||||
|
@using salesbook.Shared.Components.SingleElements
|
||||||
|
@using salesbook.Shared.Core.Interface
|
||||||
|
@inject IPageTitleService PageTitleService
|
||||||
|
|
||||||
|
@* <HeaderLayout Title="Notifiche" /> *@
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<NoDataAvailable Text="Nessuna notifica meno recente" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
PageTitleService?.SetTitle("Notifiche");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
163
salesbook.Shared/Components/Pages/PersonalInfo.razor
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
@page "/PersonalInfo"
|
||||||
|
@attribute [Authorize]
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
83
salesbook.Shared/Components/Pages/PersonalInfo.razor.css
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
.container-primary-info {
|
||||||
|
box-shadow: var(--custom-box-shadow);
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-primary-info .divider {
|
||||||
|
margin: 0 0 0 7rem;
|
||||||
|
width: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-primary-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1.5rem;
|
||||||
|
padding: .8rem 1.2rem .4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.personal-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-nome {
|
||||||
|
color: var(--mud-palette-text-primary);
|
||||||
|
font-weight: 800;
|
||||||
|
font-size: x-large;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-section {
|
||||||
|
color: var(--mud-palette-gray-default);
|
||||||
|
font-size: medium;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-info {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: row;
|
||||||
|
padding: .4rem 1.2rem .8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-personal-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-personal-info > div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
line-height: normal;
|
||||||
|
margin: .25rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-title {
|
||||||
|
color: var(--mud-palette-gray-darker);
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-text {
|
||||||
|
color: var(--mud-palette-text-secondary);
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content ::deep .user-button { border: 1px solid var(--card-border-color) !important; }
|
||||||
|
|
||||||
|
.user-button > i { font-size: large; }
|
||||||
|
|
||||||
|
.user-button > span {
|
||||||
|
font-size: medium;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status { font-weight: 700; }
|
||||||
|
|
||||||
|
.status.online { color: var(--mud-palette-success); }
|
||||||
|
|
||||||
|
.status.offline { color: var(--mud-palette-error); }
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
@page "/settings"
|
@page "/settings"
|
||||||
@page "/settings/{BackTo}"
|
@page "/settings/{BackTo}"
|
||||||
@using Template.Shared.Components.Layout
|
@using salesbook.Shared.Components.Layout
|
||||||
|
|
||||||
<HeaderLayout BackTo="@BackTo" ShowNotifications="false" Back="true" Title="Impostazioni"/>
|
<HeaderLayout BackTo="@BackTo" Back="true" Title="Impostazioni"/>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||