86 Commits

Author SHA1 Message Date
5981691815 Finish v2.0.2(9) 2025-10-03 00:02:12 +02:00
f4621f48c8 -> 2.0.2 (9) 2025-10-03 00:02:08 +02:00
ff36b1cdab Fix salvataggio posizione 2025-10-02 23:48:14 +02:00
36fe05e3c3 Fix apertura fotocamera e fix codJcom interno 2025-10-01 12:35:34 +02:00
0fe1b90417 Finish v2.0.2(8) 2025-09-23 10:44:31 +02:00
7359310c48 Finish v2.0.2(8) 2025-09-23 10:44:31 +02:00
860a25471e -> v2.0.2 (8) 2025-09-23 10:44:25 +02:00
0fab8058f3 Aggiornate librerie per il supporto Android alle pagina da 16 kB 2025-09-23 10:36:02 +02:00
2e51420b2c Finish V2.0.1(7) 2025-09-22 18:16:59 +02:00
fab2836a0e Finish V2.0.1(7) 2025-09-22 18:16:59 +02:00
4521b2a02d -> v2.0.1 (7) 2025-09-22 18:16:52 +02:00
ec7bedeff6 Fix compilazione in release 2025-09-22 18:16:08 +02:00
ea2f2d47c3 Finish v2.0.0(6) 2025-09-22 15:11:22 +02:00
149eb27628 Finish v2.0.0(6) 2025-09-22 15:11:20 +02:00
8b331d5824 -> v2.0.0 (6) 2025-09-22 15:11:15 +02:00
31db52d0d7 Fix vari 2025-09-22 15:10:24 +02:00
ce56e9e57d Migliorata UI 2025-09-22 12:26:10 +02:00
c61093a942 Sistemati caricamenti 2025-09-18 15:47:20 +02:00
4645b2660e Migliorie grefiche 2025-09-18 12:17:45 +02:00
06bda7c881 Gestita fotocamera per allegare immagini 2025-09-18 10:56:21 +02:00
8a45bffebc Fix e migliorati caricamenti 2025-09-18 09:40:31 +02:00
e9a0ffdb7a Fix ui 2025-09-16 10:46:56 +02:00
83264731f3 Migliorato modal activity 2025-09-15 17:11:17 +02:00
0f3047a2b6 Gestito notificationData nelle notifiche push 2025-09-12 17:37:36 +02:00
223e74c490 Migliorata gestione e visualizzazione notifiche 2025-09-12 15:42:56 +02:00
b798b01da0 Sistemazioni grafiche 2025-09-12 09:32:34 +02:00
85f19acda6 Finish Firebase 2025-09-11 16:08:13 +02:00
7bfe67a97c Gestita pagina notifiche 2025-09-11 16:06:19 +02:00
7319378e75 Creata card notifiche 2025-09-09 16:30:51 +02:00
dfb86e3cd7 Implementate notifiche 2025-09-09 11:43:07 +02:00
54be40518a Merge branch 'develop' into feature/Firebase
# Conflicts:
#	salesbook.Shared/Components/Pages/Home.razor
2025-09-08 12:22:24 +02:00
93b1a94c88 Filtrati tipi attività per utente 2025-09-08 12:19:17 +02:00
82d268d9f8 Implementato controllo conessione dispositivo e servizi. Completata pagination commesse e attività per cliente 2025-09-08 10:24:50 +02:00
014e2ffc41 Aggiunta pagination nella tab Commesse 2025-09-05 09:41:22 +02:00
8508820350 Migliorata sincronizzazione dei dati 2025-09-03 17:26:55 +02:00
374b99501e Prima parte di migliorie per la sincronizzazione dei dati 2025-09-03 15:46:49 +02:00
8be3fa9f9e Completata gestione allegati e riepilogo commessa 2025-09-01 17:38:16 +02:00
588dbe308a Creata pagina step della commessa 2025-08-29 18:20:07 +02:00
833a1e456f Iniziata implementazione notifiche firebase 2025-08-25 10:00:41 +02:00
9957229e70 Vario 2025-08-21 10:51:32 +02:00
cd88c79b32 Finish v1.1.0 2025-08-07 09:28:06 +02:00
c9d7091355 Finish v1.1.0 2025-08-07 09:28:05 +02:00
d90a194a4e v1.1.0 -> 5 2025-08-07 09:28:00 +02:00
de9d415f04 Fix posizione 2025-08-07 09:27:07 +02:00
b561405ddc Fix aggiunta nuova persona di riferimento 2025-08-06 16:00:37 +02:00
c93b0c9bec Fix vari 2025-08-06 12:31:52 +02:00
c003c29d83 Aggiunto agente in fase di creazione/modifica cliente 2025-07-31 16:03:07 +02:00
8dfb163cfa Sistemati filtri 2025-07-31 15:24:45 +02:00
068723f31f Implementata gestione allegati 2025-07-30 18:27:24 +02:00
8ebc6e3b8f Gestito aggiornamento elenco contatti in caso di aggiunta o modifica del prospect / cliente 2025-07-25 14:52:00 +02:00
9c69884cc9 Aggiunta ricerca indirizzo 2025-07-24 15:51:01 +02:00
b34f6cb213 Controllo p.Iva 2025-07-22 09:10:30 +02:00
7bcb0581cc Form persone di riferimento e clienti 2025-07-21 10:08:10 +02:00
b2064ad71e Migliorati form Cliente e PersonaRif 2025-07-16 17:24:41 +02:00
8c521dc81e Gestito elenco clienti e prospect in lista contatti 2025-07-10 12:40:30 +02:00
65e48777e6 Creato form per Clienti/Prospect 2025-07-08 15:33:33 +02:00
bf2e1b65f0 Finish v1.0.1(4) 2025-07-04 15:47:50 +02:00
691c132fb6 Finish v1.0.1(4) 2025-07-04 15:47:49 +02:00
5d292a12ef -> v1.0.1 (4) 2025-07-04 15:47:38 +02:00
60f7d14a72 Vario 2025-07-04 15:43:02 +02:00
5fe41f9445 Aggiornamento librerie 2025-07-03 16:59:44 +02:00
e614c83a5b Aggiunto sentry 2025-07-03 16:50:17 +02:00
c2da42a51b Aggiunto dialog promemoria 2025-07-03 16:50:00 +02:00
ca6be0c0a8 Iniziata implementazione filtri utenti 2025-07-03 11:36:44 +02:00
ddbf9c832e Fix searchBox users 2025-07-02 10:32:01 +02:00
201cfd4bc6 Finish v1.0.0(3) 2025-06-30 15:57:41 +02:00
87264cf3aa -> v1.0.0 (3) 2025-06-30 15:57:32 +02:00
dba3cd0357 Fix 2025-06-30 15:56:46 +02:00
516fcca7cb Finish v1.0.0(2) 2025-06-30 15:50:04 +02:00
453e291827 Finish v1.0.0(2) 2025-06-30 15:50:03 +02:00
443ed95013 -> v1.0.0 (2) 2025-06-30 15:49:58 +02:00
a28b8e2f6c Finish v1.0.0(1) 2025-06-30 15:47:47 +02:00
108fa715f0 Finish v1.0.0(1) 2025-06-30 15:47:45 +02:00
3ad3ec23f0 Fix vari 2025-06-30 15:46:11 +02:00
3f2b7a6bb5 Rename salesbook 2025-06-26 10:08:21 +02:00
a34e673cd2 Cancellazione attività 2025-06-26 09:26:50 +02:00
10c1435dba Vario 2025-06-24 10:56:02 +02:00
a97df74ef4 Migliorie form inserimento 2025-06-20 10:58:58 +02:00
6c789a099e Fix filtri 2025-06-20 09:02:17 +02:00
7f8dae7c7d Non si deve poter inserire un esito su un’attività non assegnata all’utente loggato 2025-06-20 08:59:10 +02:00
51a4c7a971 Iniziata creazione pagina contatti 2025-06-20 08:55:30 +02:00
4608c6764b Aggiunta modifica esito 2025-06-17 14:57:21 +02:00
6600660315 Miglioramenti UI 2025-06-17 12:58:12 +02:00
d6c7742501 Vario 2025-06-16 17:38:48 +02:00
3a374baaba Adeguamento ui per ios 2025-06-16 16:04:55 +02:00
7ca4de628b Completato form attività e filtri 2025-06-16 11:58:49 +02:00
307 changed files with 11406 additions and 2691 deletions

View File

@@ -1,91 +0,0 @@
using AutoMapper;
using System.Linq.Expressions;
using Template.Shared.Core.Dto;
using Template.Shared.Core.Entity;
using Template.Shared.Core.Helpers.Enum;
using Template.Shared.Core.Interface;
namespace Template.Maui.Core.Services;
public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManageDataService
{
public Task<List<AnagClie>> GetAnagClie(Expression<Func<AnagClie, bool>>? whereCond = null) =>
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);
public async Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
{
var activities = await localDb.Get(whereCond);
var codJcomList = activities
.Select(x => x.CodJcom)
.Where(x => !string.IsNullOrEmpty(x))
.Distinct().ToList();
var jtbComtList = await localDb.Get<JtbComt>(x => codJcomList.Contains(x.CodJcom));
var commesseDict = jtbComtList.ToDictionary(x => x.CodJcom, x => x.Descrizione);
var codAnagList = activities
.Select(x => x.CodAnag)
.Where(x => !string.IsNullOrEmpty(x))
.Distinct().ToList();
var clientList = await localDb.Get<AnagClie>(x => codAnagList.Contains(x.CodAnag));
var distinctClient = clientList.ToDictionary(x => x.CodAnag, x => x.RagSoc);
var prospectList = await localDb.Get<PtbPros>(x => codAnagList.Contains(x.CodPpro));
var distinctProspect = prospectList.ToDictionary(x => x.CodPpro, x => x.RagSoc);
var returnDto = activities
.Select(activity =>
{
var dto = mapper.Map<ActivityDTO>(activity);
if (activity.CodJcom != null)
{
dto.Category = ActivityCategoryEnum.Commessa;
}
else
{
dto.Category = activity.CodAnag != null ? ActivityCategoryEnum.Interna : ActivityCategoryEnum.Memo;
}
if (dto.Category == ActivityCategoryEnum.Interna && activity.CodAnag != null)
{
string? ragSoc;
if (distinctClient.TryGetValue(activity.CodAnag, out ragSoc) || distinctProspect.TryGetValue(activity.CodAnag, out ragSoc))
{
dto.Cliente = ragSoc;
}
}
dto.Commessa = activity.CodJcom != null && commesseDict.TryGetValue(activity.CodJcom, out var descr)
? descr
: null;
return dto;
})
.ToList();
return returnDto;
}
public Task ClearDb() =>
localDb.ResetDb();
}

View File

@@ -1,12 +0,0 @@
using Template.Shared.Core.Interface;
namespace Template.Maui.Core.Services;
public class NetworkService : INetworkService
{
public bool IsNetworkAvailable()
{
return Connectivity.Current.NetworkAccess == NetworkAccess.Internet;
}
}

View File

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

View File

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

View File

@@ -1,62 +0,0 @@
using CommunityToolkit.Maui;
using IntegryApiClient.MAUI;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Extensions.Logging;
using MudBlazor.Services;
using MudExtensions.Services;
using Template.Maui.Core.Services;
using Template.Shared;
using Template.Shared.Core.Helpers;
using Template.Shared.Core.Interface;
using Template.Shared.Core.Messages;
using Template.Shared.Core.Services;
namespace Template.Maui
{
public static class MauiProgram
{
private const string AppToken = "f0484398-1f8b-42f5-ab79-5282c164e1d8";
public static MauiApp CreateMauiApp()
{
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
})
.UseLoginAzienda(AppToken);
builder.Services.AddMauiBlazorWebView();
builder.Services.AddMudServices();
builder.Services.AddMudExtensions();
builder.Services.AddAutoMapper(typeof(MappingProfile));
builder.Services.AddAuthorizationCore();
builder.Services.AddScoped<AppAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(provider =>
provider.GetRequiredService<AppAuthenticationStateProvider>());
builder.Services.AddScoped<INetworkService, NetworkService>();
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
builder.Services.AddScoped<ISyncDbService, SyncDbService>();
builder.Services.AddScoped<IManageDataService, ManageDataService>();
builder.Services.AddScoped<BackNavigationService>();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
builder.Services.AddSingleton<IFormFactor, FormFactor>();
builder.Services.AddSingleton<LocalDbService>();
return builder.Build();
}
}
}

View File

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

View File

@@ -1,13 +0,0 @@
using Android.App;
using Android.Content.PM;
namespace Template.Maui
{
[Activity(Theme = "@style/Maui.SplashTheme",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode |
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}
}

View File

@@ -1,16 +0,0 @@
using Android.App;
using Android.Runtime;
namespace Template.Maui
{
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}

View File

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

View File

@@ -1,11 +0,0 @@
using Foundation;
using Template.Maui;
namespace Template.Maui
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Before

Width:  |  Height:  |  Size: 229 B

View File

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

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

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

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +0,0 @@
namespace Template.Shared.Core.Interface;
public interface INetworkService
{
public bool IsNetworkAvailable();
}

View File

@@ -1,9 +0,0 @@
namespace Template.Shared.Core.Interface;
public interface ISyncDbService
{
Task GetAndSaveActivity(string? dateFilter = null);
Task GetAndSaveCommesse(string? dateFilter = null);
Task GetAndSaveProspect(string? dateFilter = null);
Task GetAndSaveClienti(string? dateFilter = null);
}

View File

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

View File

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

View File

@@ -1,31 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="8.2.2" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="IntegryApiClient.Core" Version="1.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.5" />
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.5" />
<PackageReference Include="MudBlazor" Version="8.6.0" />
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\css\lineicons\" />
<Folder Include="wwwroot\js\bootstrap\" />
</ItemGroup>
</Project>

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

@@ -1,12 +0,0 @@
using Template.Shared.Core.Interface;
namespace Template.Web.Core.Services;
public class NetworkService : INetworkService
{
public bool IsNetworkAvailable()
{
return true;
}
}

View File

@@ -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>

View File

@@ -1,4 +1,4 @@
namespace Template.Maui namespace salesbook.Maui
{ {
public partial class App : Application public partial class App : Application
{ {

View File

@@ -0,0 +1,10 @@
using System.Text.Json.Serialization;
namespace salesbook.Maui.Core.RestClient.IntegryApi.Dto;
public class RegisterDeviceDTO
{
[JsonPropertyName("userDeviceToken")]
public WtbUserDeviceTokenDTO UserDeviceToken { get; set; }
}

View File

@@ -0,0 +1,22 @@
using System.Text.Json.Serialization;
namespace salesbook.Maui.Core.RestClient.IntegryApi.Dto;
public class WtbUserDeviceTokenDTO
{
[JsonPropertyName("type")]
public string Type => "wtb_user_device_tokens";
[JsonPropertyName("deviceToken")]
public string DeviceToken { get; set; }
[JsonPropertyName("userName")]
public string Username { get; set; }
[JsonPropertyName("appName")]
public int AppName => 7; //salesbook
[JsonPropertyName("platform")]
public string Platform { get; set; }
}

View File

@@ -0,0 +1,38 @@
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
using IntegryApiClient.Core.Domain.RestClient.Contacts;
using Microsoft.Extensions.Logging;
using salesbook.Maui.Core.RestClient.IntegryApi.Dto;
using salesbook.Shared.Core.Interface.IntegryApi;
namespace salesbook.Maui.Core.RestClient.IntegryApi;
public class IntegryRegisterNotificationRestClient(
ILogger<IntegryRegisterNotificationRestClient> logger,
IUserSession userSession,
IIntegryApiRestClient integryApiRestClient
) : IIntegryRegisterNotificationRestClient
{
public async Task Register(string fcmToken, ILogger? logger1 = null)
{
logger1 ??= logger;
var userDeviceToken = new RegisterDeviceDTO()
{
UserDeviceToken = new WtbUserDeviceTokenDTO()
{
DeviceToken = fcmToken,
Platform = OperatingSystem.IsAndroid() ? "Android" : "iOS",
Username = userSession.User.Username
}
};
try
{
await integryApiRestClient.AuthorizedPost<object>($"device_tokens/insert", userDeviceToken,
logger: logger1);
}
catch (Exception ex)
{
SentrySdk.CaptureException(ex);
}
}
}

View File

@@ -0,0 +1,142 @@
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Interface;
namespace salesbook.Maui.Core.Services;
public class AttachedService : IAttachedService
{
public async Task<AttachedDTO?> SelectImageFromCamera()
{
var cameraPerm = await Permissions.RequestAsync<Permissions.Camera>();
var storagePerm = await Permissions.RequestAsync<Permissions.StorageWrite>();
if (cameraPerm != PermissionStatus.Granted || storagePerm != PermissionStatus.Granted)
return null;
FileResult? result = null;
try
{
result = await MediaPicker.Default.CapturePhotoAsync();
}
catch (Exception ex)
{
Console.WriteLine($"Errore cattura foto: {ex.Message}");
SentrySdk.CaptureException(ex);
return null;
}
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
}
public async Task<AttachedDTO?> SelectImageFromGallery()
{
var storagePerm = await Permissions.RequestAsync<Permissions.StorageRead>();
if (storagePerm != PermissionStatus.Granted)
return null;
FileResult? result = null;
try
{
result = await MediaPicker.Default.PickPhotoAsync();
}
catch (Exception ex)
{
Console.WriteLine($"Errore selezione galleria: {ex.Message}");
SentrySdk.CaptureException(ex);
return null;
}
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
}
public async Task<AttachedDTO?> SelectFile()
{
var perm = await Permissions.RequestAsync<Permissions.StorageRead>();
if (perm != PermissionStatus.Granted) return null;
var result = await FilePicker.PickAsync();
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Document);
}
public async Task<AttachedDTO?> SelectPosition()
{
var perm = await Permissions.RequestAsync<Permissions.LocationWhenInUse>();
if (perm != PermissionStatus.Granted) return null;
var loc = await Geolocation.GetLastKnownLocationAsync();
if (loc is null) return null;
return new AttachedDTO
{
Name = "Posizione attuale",
Lat = loc.Latitude,
Lng = loc.Longitude,
Type = AttachedDTO.TypeAttached.Position
};
}
private static async Task<AttachedDTO> ConvertToDto(FileResult file, AttachedDTO.TypeAttached type)
{
var stream = await file.OpenReadAsync();
using var ms = new MemoryStream();
await stream.CopyToAsync(ms);
return new AttachedDTO
{
Name = file.FileName,
Path = file.FullPath,
MimeType = file.ContentType,
DimensionBytes = ms.Length,
FileBytes = ms.ToArray(),
Type = type
};
}
private static async Task<string?> SaveToTempStorage(Stream file, string fileName)
{
var cacheDirectory = FileSystem.CacheDirectory;
var targetDirectory = Path.Combine(cacheDirectory, "file");
if (!Directory.Exists(targetDirectory)) Directory.CreateDirectory(targetDirectory);
var tempFilePath = Path.Combine(targetDirectory, fileName + ".temp");
var filePath = Path.Combine(targetDirectory, fileName);
if (File.Exists(filePath)) return filePath;
try
{
await using var fileStream =
new FileStream(tempFilePath, FileMode.Create, FileAccess.Write, FileShare.None);
await file.CopyToAsync(fileStream);
File.Move(tempFilePath, filePath);
}
catch (Exception e)
{
Console.WriteLine($"Errore durante il salvataggio dello stream: {e.Message}");
SentrySdk.CaptureException(e);
return null;
}
finally
{
if (File.Exists(tempFilePath)) File.Delete(tempFilePath);
}
return filePath;
}
public async Task OpenFile(Stream file, string fileName)
{
var filePath = await SaveToTempStorage(file, fileName);
if (filePath is null) return;
await Launcher.OpenAsync(new OpenFileRequest
{
File = new ReadOnlyFile(filePath)
});
}
}

View File

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

View File

@@ -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,43 @@ 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<SrlActivityTypeUser>();
_connection.CreateTableAsync<StbUser>();
_connection.CreateTableAsync<VtbTipi>();
_connection.CreateTableAsync<Nazioni>();
}
public async Task ResetSettingsDb()
{
try
{
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_activity_result;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_activity_type;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS srl_activity_type_user;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_user;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS vtb_tipi;");
await _connection.ExecuteAsync("DROP TABLE IF EXISTS nazioni;");
await _connection.CreateTableAsync<StbActivityResult>();
await _connection.CreateTableAsync<StbActivityType>();
await _connection.CreateTableAsync<SrlActivityTypeUser>();
await _connection.CreateTableAsync<StbUser>();
await _connection.CreateTableAsync<VtbTipi>();
await _connection.CreateTableAsync<Nazioni>();
}
catch (Exception ex)
{
Console.WriteLine($"Errore durante il reset del database(settings): {ex.Message}");
throw;
}
} }
public async Task ResetDb() 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 +120,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);
} }

View File

@@ -0,0 +1,376 @@
using AutoMapper;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Dto.Activity;
using salesbook.Shared.Core.Dto.Contact;
using salesbook.Shared.Core.Dto.PageState;
using salesbook.Shared.Core.Entity;
using salesbook.Shared.Core.Helpers;
using salesbook.Shared.Core.Helpers.Enum;
using salesbook.Shared.Core.Interface;
using salesbook.Shared.Core.Interface.IntegryApi;
using salesbook.Shared.Core.Interface.System.Network;
using System.Linq.Expressions;
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
namespace salesbook.Maui.Core.Services;
public class ManageDataService(
LocalDbService localDb,
IMapper mapper,
UserListState userListState,
IIntegryApiService integryApiService,
INetworkService networkService,
IUserSession userSession
) : IManageDataService
{
public Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new() =>
localDb.Get(whereCond);
public async Task<List<AnagClie>> GetClienti(WhereCondContact? whereCond)
{
List<AnagClie> clienti = [];
whereCond ??= new WhereCondContact();
whereCond.OnlyContact = true;
if (networkService.ConnectionAvailable)
{
var response = await integryApiService.RetrieveAnagClie(
new CRMAnagRequestDTO
{
CodAnag = whereCond.CodAnag,
FlagStato = whereCond.FlagStato,
PartIva = whereCond.PartIva,
ReturnPersRif = !whereCond.OnlyContact
}
);
clienti = response.AnagClie ?? [];
}
else
{
clienti = await localDb.Get<AnagClie>(x =>
(whereCond.FlagStato != null && x.FlagStato.Equals(whereCond.FlagStato)) ||
(whereCond.PartIva != null && x.PartIva.Equals(whereCond.PartIva)) ||
(whereCond.PartIva == null && whereCond.FlagStato == null)
);
}
return clienti;
}
public async Task<List<PtbPros>> GetProspect(WhereCondContact? whereCond)
{
List<PtbPros> prospect = [];
whereCond ??= new WhereCondContact();
whereCond.OnlyContact = true;
if (networkService.ConnectionAvailable)
{
var response = await integryApiService.RetrieveProspect(
new CRMProspectRequestDTO
{
CodPpro = whereCond.CodAnag,
PartIva = whereCond.PartIva,
ReturnPersRif = !whereCond.OnlyContact
}
);
prospect = response.PtbPros ?? [];
}
else
{
prospect = await localDb.Get<PtbPros>(x =>
(whereCond.PartIva != null && x.PartIva.Equals(whereCond.PartIva)) ||
(whereCond.PartIva == null)
);
}
return prospect;
}
public async Task<List<ContactDTO>> GetContact(WhereCondContact? whereCond, DateTime? lastSync)
{
List<AnagClie>? contactList;
List<PtbPros>? prospectList;
whereCond ??= new WhereCondContact();
if (networkService.ConnectionAvailable)
{
var response = new UsersSyncResponseDTO();
var clienti = await integryApiService.RetrieveAnagClie(
new CRMAnagRequestDTO
{
CodAnag = whereCond.CodAnag,
FlagStato = whereCond.FlagStato,
PartIva = whereCond.PartIva,
ReturnPersRif = !whereCond.OnlyContact,
FilterDate = lastSync
}
);
response.AnagClie = clienti.AnagClie;
response.VtbDest = clienti.VtbDest;
response.VtbCliePersRif = clienti.VtbCliePersRif;
var prospect = await integryApiService.RetrieveProspect(
new CRMProspectRequestDTO
{
CodPpro = whereCond.CodAnag,
PartIva = whereCond.PartIva,
ReturnPersRif = !whereCond.OnlyContact,
FilterDate = lastSync
}
);
response.PtbPros = prospect.PtbPros;
response.PtbProsRif = prospect.PtbProsRif;
_ = UpdateDbUsers(response);
contactList = clienti.AnagClie;
prospectList = prospect.PtbPros;
}
else
{
contactList = await localDb.Get<AnagClie>(x =>
(whereCond.FlagStato != null && x.FlagStato.Equals(whereCond.FlagStato)) ||
(whereCond.PartIva != null && x.PartIva.Equals(whereCond.PartIva)) ||
(whereCond.PartIva == null && whereCond.FlagStato == null)
);
prospectList = await localDb.Get<PtbPros>(x =>
(whereCond.PartIva != null && x.PartIva.Equals(whereCond.PartIva)) ||
(whereCond.PartIva == null)
);
}
// Mappa i contatti
var contactMapper = mapper.Map<List<ContactDTO>>(contactList);
// Mappa i prospects
var prospectMapper = mapper.Map<List<ContactDTO>>(prospectList);
contactMapper.AddRange(prospectMapper);
return contactMapper;
}
public async Task<ContactDTO?> GetSpecificContact(string codAnag, bool isContact)
{
if (isContact)
{
var contact = (await localDb.Get<AnagClie>(x => x.CodAnag != null && x.CodAnag.Equals(codAnag)))
.LastOrDefault();
return contact == null ? null : mapper.Map<ContactDTO>(contact);
}
else
{
var contact = (await localDb.Get<PtbPros>(x => x.CodPpro != null && x.CodPpro.Equals(codAnag)))
.LastOrDefault();
return contact == null ? null : mapper.Map<ContactDTO>(contact);
}
}
public async Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
{
List<StbActivity>? activities;
activities = await localDb.Get<StbActivity>(x =>
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
(whereCond.Start != null && whereCond.End != null && x.EffectiveDate == null &&
x.EstimatedDate >= whereCond.Start && x.EstimatedDate <= whereCond.End) ||
(x.EffectiveDate >= whereCond.Start && x.EffectiveDate <= whereCond.End) ||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
);
if (activities.IsNullOrEmpty() && networkService.ConnectionAvailable)
{
activities = await integryApiService.RetrieveActivity(
new CRMRetrieveActivityRequestDTO
{
StarDate = whereCond.Start,
EndDate = whereCond.End,
ActivityId = whereCond.ActivityId
}
);
_ = UpdateDb(activities);
}
return await MapActivity(activities);
}
public async Task<List<ActivityDTO>> GetActivity(WhereCondActivity whereCond, bool useLocalDb)
{
List<StbActivity>? activities;
if (networkService.ConnectionAvailable && !useLocalDb)
{
activities = await integryApiService.RetrieveActivity(
new CRMRetrieveActivityRequestDTO
{
StarDate = whereCond.Start,
EndDate = whereCond.End,
ActivityId = whereCond.ActivityId
}
);
_ = UpdateDb(activities);
}
else
{
activities = await localDb.Get<StbActivity>(x =>
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
(whereCond.Start != null && whereCond.End != null && x.EffectiveDate == null &&
x.EstimatedDate >= whereCond.Start && x.EstimatedDate <= whereCond.End) ||
(x.EffectiveDate >= whereCond.Start && x.EffectiveDate <= whereCond.End) ||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
);
}
return await MapActivity(activities);
}
public async Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities)
{
if (activities == null) return [];
var codJcomList = activities
.Select(x => x.CodJcom)
.Where(x => !string.IsNullOrEmpty(x))
.Distinct().ToList();
var jtbComtList = await localDb.Get<JtbComt>(x => codJcomList.Contains(x.CodJcom));
var codAnagList = activities
.Select(x => x.CodAnag)
.Where(x => !string.IsNullOrEmpty(x))
.Distinct().ToList();
IDictionary<string, string?>? distinctUser = null;
if (userListState.AllUsers != null)
{
distinctUser = userListState.AllUsers
.Where(x => codAnagList.Contains(x.CodContact))
.ToDictionary(x => x.CodContact, x => x.RagSoc);
}
var returnDto = activities
.Select(activity =>
{
if (activity.CodJcom is "0000" && userSession.ProfileDb != null && userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase))
{
activity.CodJcom = null;
}
var dto = mapper.Map<ActivityDTO>(activity);
if (activity is { AlarmTime: not null, EstimatedTime: not null })
{
var minuteBefore = activity.EstimatedTime.Value - activity.AlarmTime.Value;
dto.MinuteBefore = (int)Math.Abs(minuteBefore.TotalMinutes);
dto.NotificationDate = dto.MinuteBefore == 0 ?
activity.EstimatedTime : activity.AlarmTime;
}
if (activity.CodJcom != null)
{
dto.Category = ActivityCategoryEnum.Commessa;
}
else
{
dto.Category = activity.CodAnag != null ? ActivityCategoryEnum.Interna : ActivityCategoryEnum.Memo;
}
if (dto.Category != ActivityCategoryEnum.Memo && activity.CodAnag != null)
{
string? ragSoc;
if (distinctUser != null && (distinctUser.TryGetValue(activity.CodAnag, out ragSoc) ||
distinctUser.TryGetValue(activity.CodAnag, out ragSoc)))
{
dto.Cliente = ragSoc;
}
}
dto.Commessa = jtbComtList.Find(x => x.CodJcom.Equals(dto.CodJcom));
return dto;
})
.ToList();
return returnDto;
}
private Task UpdateDbUsers(UsersSyncResponseDTO response)
{
return Task.Run(async () =>
{
if (response.AnagClie != null)
{
await localDb.InsertOrUpdate(response.AnagClie);
if (response.VtbDest != null) await localDb.InsertOrUpdate(response.VtbDest);
if (response.VtbCliePersRif != null) await localDb.InsertOrUpdate(response.VtbCliePersRif);
}
if (response.PtbPros != null)
{
await localDb.InsertOrUpdate(response.PtbPros);
if (response.PtbProsRif != null) await localDb.InsertOrUpdate(response.PtbProsRif);
}
});
}
private Task UpdateDb<T>(List<T>? entityList)
{
return Task.Run(() =>
{
if (entityList == null) return;
_ = localDb.InsertOrUpdate(entityList);
});
}
public Task InsertOrUpdate<T>(List<T> listToSave) =>
localDb.InsertOrUpdate(listToSave);
public Task InsertOrUpdate<T>(T objectToSave) =>
localDb.InsertOrUpdate<T>([objectToSave]);
public async Task DeleteProspect(string codPpro)
{
var persRifList = await GetTable<PtbProsRif>(x => x.CodPpro!.Equals(codPpro));
if (!persRifList.IsNullOrEmpty())
{
foreach (var persRif in persRifList)
{
await localDb.Delete(persRif);
}
}
var ptbPros = (await GetTable<PtbPros>(x => x.CodPpro!.Equals(codPpro))).FirstOrDefault();
if (ptbPros != null)
{
await localDb.Delete(ptbPros);
}
}
public Task Delete<T>(T objectToDelete) =>
localDb.Delete(objectToDelete);
public async Task DeleteActivity(ActivityDTO activity)
{
await localDb.Delete(
(await GetTable<StbActivity>(x => x.ActivityId.Equals(activity.ActivityId))).Last()
);
}
public Task ClearDb() =>
localDb.ResetDb();
}

View File

@@ -0,0 +1,45 @@
using salesbook.Shared.Core.Helpers;
using salesbook.Shared.Core.Interface;
using salesbook.Shared.Core.Interface.IntegryApi;
namespace salesbook.Maui.Core.Services;
public class SyncDbService(IIntegryApiService integryApiService, LocalDbService localDb) : ISyncDbService
{
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 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.ActivityTypeUsers.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.ActivityTypeUsers!);
if (!settingsResponse.StbUsers.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.StbUsers!);
if (!settingsResponse.VtbTipi.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.VtbTipi!);
if (!settingsResponse.Nazioni.IsNullOrEmpty())
await localDb.InsertAll(settingsResponse.Nazioni!);
}
}

View File

@@ -0,0 +1,16 @@
using salesbook.Shared.Core.Interface;
using salesbook.Shared.Core.Interface.System.Network;
namespace salesbook.Maui.Core.System.Network;
public class NetworkService : INetworkService
{
public bool ConnectionAvailable { get; set; }
public bool IsNetworkAvailable()
{
//return false;
return Connectivity.Current.NetworkAccess == NetworkAccess.Internet;
}
}

View File

@@ -0,0 +1,37 @@
using salesbook.Shared.Core.Interface;
using salesbook.Shared.Core.Interface.IntegryApi;
using Shiny;
using Shiny.Notifications;
using Shiny.Push;
namespace salesbook.Maui.Core.System.Notification;
public class FirebaseNotificationService(
IPushManager pushManager,
IIntegryRegisterNotificationRestClient integryRegisterNotificationRestClient,
INotificationManager notificationManager
) : IFirebaseNotificationService
{
public async Task InitFirebase()
{
CreateNotificationChannel();
var (accessState, token) = await pushManager.RequestAccess();
if (accessState == AccessState.Denied || token is null) return;
await integryRegisterNotificationRestClient.Register(token);
}
private void CreateNotificationChannel()
{
var channel = new Channel
{
Identifier = "salesbook_push",
Description = "Notifiche push di SalesBook",
Importance = ChannelImportance.High,
Actions = []
};
notificationManager.AddChannel(channel);
}
}

View File

@@ -0,0 +1,63 @@
using CommunityToolkit.Mvvm.Messaging;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Entity;
using salesbook.Shared.Core.Helpers;
using salesbook.Shared.Core.Interface.IntegryApi;
using salesbook.Shared.Core.Messages.Notification.NewPush;
using Shiny.Push;
using System.Text.Json;
namespace salesbook.Maui.Core.System.Notification.Push;
public class PushNotificationDelegate(
IIntegryRegisterNotificationRestClient integryRegisterNotificationRestClient,
IMessenger messenger
) : IPushDelegate
{
public Task OnEntry(PushNotification notification)
{
// fires when the user taps on a push notification
return Task.CompletedTask;
}
public Task OnReceived(PushNotification notification)
{
if (notification.Notification is null) return Task.CompletedTask;
var data = notification.Data;
NotificationDataDTO? notificationDataDto = null;
if (!data.IsNullOrEmpty())
{
var json = JsonSerializer.Serialize(data);
notificationDataDto = JsonSerializer.Deserialize<NotificationDataDTO>(json);
}
if (notificationDataDto?.NotificationId == null) return Task.CompletedTask;
var notificationId = long.Parse(notificationDataDto.NotificationId);
var pushNotification = new WtbNotification
{
Id = notificationId,
Title = notification.Notification.Title,
Body = notification.Notification.Message,
NotificationData = notificationDataDto
};
messenger.Send(new NewPushNotificationMessage(pushNotification));
return Task.CompletedTask;
}
public Task OnNewToken(string token)
{
integryRegisterNotificationRestClient.Register(token);
return Task.CompletedTask;
}
public Task OnUnRegistered(string token)
{
// fires when a push notification change is set by the operating system or provider
return Task.CompletedTask;
}
}

View File

@@ -0,0 +1,9 @@
using salesbook.Shared.Core.Interface.System.Notification;
using Shiny.Notifications;
namespace salesbook.Maui.Core.System.Notification;
public class ShinyNotificationManager(INotificationManager notificationManager) : IShinyNotificationManager
{
public Task RequestAccess() => notificationManager.RequestAccess();
}

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyC_QtQpsVortjzgl-B7__IQZ-85lOct55E</string>
<key>GCM_SENDER_ID</key>
<string>830771692001</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>it.integry.salesbook</string>
<key>PROJECT_ID</key>
<string>salesbook-smetar</string>
<key>STORAGE_BUCKET</key>
<string>salesbook-smetar.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:830771692001:ios:59d8b1d8570ac81f3752a0</string>
</dict>
</plist>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<linker>
<assembly fullname="salesbook.Shared" preserve="all" />
</linker>

View File

@@ -1,9 +1,9 @@
<?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:local="clr-namespace:salesbook.Maui"
xmlns:shared="clr-namespace:Template.Shared;assembly=Template.Shared" xmlns:shared="clr-namespace:salesbook.Shared;assembly=salesbook.Shared"
x:Class="Template.Maui.MainPage" x:Class="salesbook.Maui.MainPage"
BackgroundColor="{DynamicResource PageBackgroundColor}"> BackgroundColor="{DynamicResource PageBackgroundColor}">
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html"> <BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">

View File

@@ -0,0 +1,10 @@
namespace salesbook.Maui
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,110 @@
using CommunityToolkit.Maui;
using CommunityToolkit.Mvvm.Messaging;
using IntegryApiClient.MAUI;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Extensions.Logging;
using MudBlazor.Services;
using MudExtensions.Services;
using salesbook.Maui.Core.RestClient.IntegryApi;
using salesbook.Maui.Core.Services;
using salesbook.Maui.Core.System.Network;
using salesbook.Maui.Core.System.Notification;
using salesbook.Maui.Core.System.Notification.Push;
using salesbook.Shared;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Dto.PageState;
using salesbook.Shared.Core.Helpers;
using salesbook.Shared.Core.Interface;
using salesbook.Shared.Core.Interface.IntegryApi;
using salesbook.Shared.Core.Interface.System.Network;
using salesbook.Shared.Core.Interface.System.Notification;
using salesbook.Shared.Core.Messages.Activity.Copy;
using salesbook.Shared.Core.Messages.Activity.New;
using salesbook.Shared.Core.Messages.Back;
using salesbook.Shared.Core.Messages.Contact;
using salesbook.Shared.Core.Messages.Notification.Loaded;
using salesbook.Shared.Core.Messages.Notification.NewPush;
using salesbook.Shared.Core.Services;
using Shiny;
namespace salesbook.Maui
{
public static class MauiProgram
{
private const string AppToken = "f0484398-1f8b-42f5-ab79-5282c164e1d8";
public static MauiAppBuilder CreateMauiAppBuilder()
{
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseIntegry(appToken: AppToken, useLoginAzienda: true)
.UseMauiCommunityToolkit()
.UseShiny()
.UseSentry(options =>
{
options.Dsn = "https://453b6b38f94fd67e40e0d5306d6caff8@o4508499810254848.ingest.de.sentry.io/4509605099667536";
#if DEBUG
options.Debug = true;
#endif
options.TracesSampleRate = 1.0;
})
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
builder.Services.AddMauiBlazorWebView();
builder.Services.AddMudServices();
builder.Services.AddMudExtensions();
builder.Services.AddAutoMapper(typeof(MappingProfile));
builder.Services.AddAuthorizationCore();
builder.Services.AddScoped<AppAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(provider =>
provider.GetRequiredService<AppAuthenticationStateProvider>());
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
builder.Services.AddScoped<ISyncDbService, SyncDbService>();
builder.Services.AddScoped<IManageDataService, ManageDataService>();
builder.Services.AddScoped<PreloadService>();
//SessionData
builder.Services.AddSingleton<JobSteps>();
builder.Services.AddSingleton<UserPageState>();
builder.Services.AddSingleton<UserListState>();
builder.Services.AddSingleton<NotificationState>();
builder.Services.AddSingleton<FilterUserDTO>();
//Message
builder.Services.AddSingleton<IMessenger, WeakReferenceMessenger>();
builder.Services.AddSingleton<NewActivityService>();
builder.Services.AddSingleton<BackNavigationService>();
builder.Services.AddSingleton<CopyActivityService>();
builder.Services.AddSingleton<NewContactService>();
builder.Services.AddSingleton<NotificationsLoadedService>();
builder.Services.AddSingleton<NewPushNotificationService>();
//Notification
builder.Services.AddNotifications();
builder.Services.AddPush<PushNotificationDelegate>();
builder.Services.AddSingleton<IIntegryRegisterNotificationRestClient, IntegryRegisterNotificationRestClient>();
builder.Services.AddSingleton<IIntegryNotificationRestClient, IntegryNotificationRestClient>();
builder.Services.AddSingleton<IFirebaseNotificationService, FirebaseNotificationService>();
builder.Services.AddSingleton<IShinyNotificationManager, ShinyNotificationManager>();
builder.Services.AddSingleton<INotificationService, NotificationService>();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
builder.Services.AddSingleton<IFormFactor, FormFactor>();
builder.Services.AddSingleton<IAttachedService, AttachedService>();
builder.Services.AddSingleton<INetworkService, NetworkService>();
builder.Services.AddSingleton<LocalDbService>();
return builder;
}
}
}

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="it.integry.salesbook">
<application
android:allowBackup="true"
android:icon="@mipmap/appicon"
android:usesCleartextTraffic="true"
android:supportsRtl="true">
<!-- Firebase push -->
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
</application>
<!-- Rete -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Geolocalizzazione -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- Fotocamera -->
<uses-permission android:name="android.permission.CAMERA" />
<!-- Storage / Media -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Android 10+ -->
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<!-- Android 13+ -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<!-- Background / Notifiche -->
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
</manifest>

View File

@@ -0,0 +1,13 @@
using salesbook.Maui.Core;
using salesbook.Shared.Core.Interface.System.Battery;
namespace salesbook.Maui;
public static class AndroidModule
{
public static MauiAppBuilder RegisterAndroidAppServices(this MauiAppBuilder mauiAppBuilder)
{
mauiAppBuilder.Services.AddSingleton<IBatteryOptimizationManagerService, BatteryOptimizationManagerService>();
return mauiAppBuilder;
}
}

View File

@@ -0,0 +1,28 @@
using Android.App;
using Android.Content;
using Android.OS;
using Android.Provider;
using salesbook.Shared.Core.Interface.System.Battery;
using Application = Android.App.Application;
namespace salesbook.Maui.Core;
public class BatteryOptimizationManagerService : IBatteryOptimizationManagerService
{
public bool IsBatteryOptimizationEnabled()
{
var packageName = AppInfo.PackageName;
var pm = (PowerManager)Application.Context.GetSystemService(Context.PowerService)!;
return !pm.IsIgnoringBatteryOptimizations(packageName);
}
public void OpenBatteryOptimizationSettings(Action<bool> onCompleted)
{
var packageName = AppInfo.PackageName;
var intent = new Intent(Settings.ActionRequestIgnoreBatteryOptimizations);
intent.SetData(Android.Net.Uri.Parse("package:" + packageName));
((MainActivity)Platform.CurrentActivity!).StartActivityForResult(intent, (result, _) => { onCompleted(result == Result.Ok); });
}
}

View File

@@ -0,0 +1,42 @@
using Android.App;
using Android.Content;
using Android.Content.PM;
namespace salesbook.Maui
{
[Activity(
Theme = "@style/Maui.SplashTheme",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode |
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
[IntentFilter(
[
Shiny.ShinyPushIntents.NotificationClickAction
],
Categories =
[
"android.intent.category.DEFAULT"
]
)]
public class MainActivity : MauiAppCompatActivity
{
private readonly IDictionary<int, Action<Result, Intent>> _onActivityResultSubscriber =
new Dictionary<int, Action<Result, Intent>>();
public void StartActivityForResult(Intent intent, Action<Result, Intent> onResultAction)
{
var requestCode = new Random(DateTime.Now.Millisecond).Next();
_onActivityResultSubscriber.Add(requestCode, onResultAction);
StartActivityForResult(intent, requestCode);
}
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
if (_onActivityResultSubscriber.TryGetValue(requestCode, out var value))
value(resultCode, data);
base.OnActivityResult(requestCode, resultCode, data);
}
}
}

View File

@@ -0,0 +1,16 @@
using Android.App;
using Android.Runtime;
namespace salesbook.Maui;
[Application(HardwareAccelerated = true)]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiAppBuilder()
.RegisterAndroidAppServices().Build();
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,24 @@
using Foundation;
using UIKit;
namespace salesbook.Maui
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiAppBuilder()
.RegisterIosAppServices().Build();
[Export("application:didRegisterForRemoteNotificationsWithDeviceToken:")]
public void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
=> global::Shiny.Hosting.Host.Lifecycle.OnRegisteredForRemoteNotifications(deviceToken);
[Export("application:didFailToRegisterForRemoteNotificationsWithError:")]
public void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
=> global::Shiny.Hosting.Host.Lifecycle.OnFailedToRegisterForRemoteNotifications(error);
[Export("application:didReceiveRemoteNotification:fetchCompletionHandler:")]
public void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
=> global::Shiny.Hosting.Host.Lifecycle.OnDidReceiveRemoteNotification(userInfo, completionHandler);
}
}

View File

@@ -0,0 +1,12 @@
using salesbook.Shared.Core.Interface.System.Battery;
namespace salesbook.Maui.Core;
public class BatteryOptimizationManagerService : IBatteryOptimizationManagerService
{
public bool IsBatteryOptimizationEnabled() => true;
public void OpenBatteryOptimizationSettings(Action<bool> onCompleted)
{
}
}

View File

@@ -35,5 +35,22 @@
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
</dict> </dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>L'app utilizza la tua posizione per allegarla alle attività.</string>
<key>NSCameraUsageDescription</key>
<string>Questa app necessita di accedere alla fotocamera per scattare foto.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Questa app necessita di accedere alla libreria foto.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Permette all'app di salvare file o immagini nella tua libreria fotografica se necessario.</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
</dict> </dict>
</plist> </plist>

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>E174.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<!--user info-->
<dict>
<key>NSPrivacyCollectedDataTypeUserID</key>
<string>NSPrivacyCollectedDataTypeLocation</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataTypeEmailAddress</key>
<string>NSPrivacyCollectedDataTypeLocation</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataTypePhoneNumber</key>
<string>NSPrivacyCollectedDataTypeLocation</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<!--crashlytics/analytics-->
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeOtherDiagnosticData</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeCrashData</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
</array>
</dict>
</plist>

View File

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

View File

@@ -0,0 +1,13 @@
using salesbook.Maui.Core;
using salesbook.Shared.Core.Interface.System.Battery;
namespace salesbook.Maui;
public static class iOSModule
{
public static MauiAppBuilder RegisterIosAppServices(this MauiAppBuilder mauiAppBuilder)
{
mauiAppBuilder.Services.AddSingleton<IBatteryOptimizationManagerService, BatteryOptimizationManagerService>();
return mauiAppBuilder;
}
}

View File

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

After

Width:  |  Height:  |  Size: 201 B

View File

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

After

Width:  |  Height:  |  Size: 529 B

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

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

After

Width:  |  Height:  |  Size: 6.1 KiB

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