Compare commits

..

9 Commits

Author SHA1 Message Date
544c9e8237 Gestiti allegati da galleria e fotocamera e aggiunto sentry 2026-02-17 10:23:46 +01:00
c1a133c61e Aggiunti nuovi campi al form 2026-02-17 09:47:14 +01:00
69f2dee309 Iniziata implementazione form rilevazione 2026-02-13 17:28:48 +01:00
06cc41ef8b Aggiunte chiamate api per dati utili 2026-02-12 12:59:46 +01:00
5afe4f4745 Aggiunta selezione negozio 2026-02-12 10:43:16 +01:00
d8bef12f30 Creata pagina "user" 2026-02-06 18:08:40 +01:00
755f78ef9d Gestito login 2026-02-06 10:04:36 +01:00
ecafebae7f Prima configurazione e struttura 2026-02-04 17:31:00 +01:00
1a949051ca Rinominati file progetto 2026-02-04 12:14:03 +01:00
192 changed files with 3935 additions and 1440 deletions

15
.idea/.idea.SteUp/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,15 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/projectSettingsUpdater.xml
/.idea.SteUp.iml
/contentModel.xml
# Ignored default folder with query files
/queries/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

1
.idea/.idea.SteUp/.idea/.name generated Normal file
View File

@@ -0,0 +1 @@
SteUp

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="RiderAndroidProjectSystem" />
</component>
</project>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="SteUp.Maui">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

4
.idea/.idea.SteUp/.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

8
.idea/.idea.SteUp/.idea/indexLayout.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.annotation.annotation">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.annotation/1.6.0.4/jar/androidx.annotation.annotation.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.annotation.annotation-jvm">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.annotation.jvm/1.6.0.2/jar/androidx.annotation.annotation-jvm.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.arch.core.core-common">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.arch.core.common/2.2.0.3/jar/androidx.arch.core.core-common.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.collection.collection">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.collection/1.2.0.9/jar/androidx.collection.collection.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.collection.collection-jvm">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.collection.jvm/1.5.0.1/jar/androidx.collection.collection-jvm.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.collection.collection-ktx">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.9/jar/androidx.collection.collection-ktx.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.concurrent.concurrent-futures">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.concurrent.futures/1.1.0.14/jar/androidx.concurrent.concurrent-futures.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.constraintlayout.constraintlayout-core">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.constraintlayout.core/1.0.4.6/jar/androidx.constraintlayout.constraintlayout-core.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.lifecycle.lifecycle-common">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.lifecycle.common/2.6.1.3/jar/androidx.lifecycle.lifecycle-common.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.lifecycle.lifecycle-common-java8">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.lifecycle.common.java8/2.8.7.2/jar/androidx.lifecycle.lifecycle-common-java8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.lifecycle.lifecycle-common-jvm">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.lifecycle.common.jvm/2.8.7.3/jar/androidx.lifecycle.lifecycle-common-jvm.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="androidx.resourceinspection.resourceinspection-annotation">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.resourceinspection.annotation/1.0.1.7/jar/androidx.resourceinspection.resourceinspection-annotation.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="annotations">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.android.glide.annotations/4.15.1.2/jar/annotations.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="disklrucache">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.android.glide.disklrucache/4.15.1.2/jar/disklrucache.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="guava-listenablefuture">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.14/jar/guava-listenablefuture.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.annotations-24.0.1">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.jetbrains.annotations/24.0.1.3/jar/org.jetbrains.annotations-24.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlin.kotlin-stdlib-1.9.0">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlin.stdlib/1.9.0.1/jar/org.jetbrains.kotlin.kotlin-stdlib-1.9.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlin.kotlin-stdlib-common-1.9.0">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlin.stdlib.common/1.9.0.1/jar/org.jetbrains.kotlin.kotlin-stdlib-common-1.9.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlin.kotlin-stdlib-jdk7-1.9.0">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlin.stdlib.jdk7/1.9.0.1/jar/org.jetbrains.kotlin.kotlin-stdlib-jdk7-1.9.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlin.kotlin-stdlib-jdk7-2.0.0">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlin.stdlib.jdk7/2.0.0/jar/org.jetbrains.kotlin.kotlin-stdlib-jdk7-2.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlin.kotlin-stdlib-jdk8-1.9.0">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlin.stdlib.jdk8/1.9.0.1/jar/org.jetbrains.kotlin.kotlin-stdlib-jdk8-1.9.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlin.kotlin-stdlib-jdk8-2.0.0">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlin.stdlib.jdk8/2.0.0/jar/org.jetbrains.kotlin.kotlin-stdlib-jdk8-2.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlinx.kotlinx-coroutines-android-1.7.2">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlinx.coroutines.android/1.7.2.1/jar/org.jetbrains.kotlinx.kotlinx-coroutines-android-1.7.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.2">
<CLASSES>
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.kotlinx.coroutines.core.jvm/1.7.2.1/jar/org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

7
.idea/.idea.SteUp/.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Template.Maui"
x:Class="Template.Maui.App">
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
android:Application.WindowSoftInputModeAdjust="Resize"
x:Class="SteUp.Maui.App">
<Application.Resources>
<ResourceDictionary>
<Color x:Key="PageBackgroundColor">#512bdf</Color>
<Color x:Key="PageBackgroundColor">#dff2ff</Color>
<Color x:Key="PrimaryTextColor">White</Color>
<Style TargetType="Label">
@@ -17,7 +18,7 @@
<Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="BackgroundColor" Value="#2b0b98" />
<Setter Property="BackgroundColor" Value="#dff2ff" />
<Setter Property="Padding" Value="14,10" />
</Style>

15
SteUp.Maui/App.xaml.cs Normal file
View File

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

View File

@@ -0,0 +1,43 @@
using Microsoft.AspNetCore.Components.Authorization;
using SteUp.Maui.Core.Services;
using SteUp.Maui.Core.System;
using SteUp.Maui.Core.System.Network;
using SteUp.Shared.Core.Data;
using SteUp.Shared.Core.Data.Contracts;
using SteUp.Shared.Core.Interface;
using SteUp.Shared.Core.Interface.IntegryApi;
using SteUp.Shared.Core.Interface.System;
using SteUp.Shared.Core.Interface.System.Network;
using SteUp.Shared.Core.Services;
namespace SteUp.Maui.Core;
public static class CoreModule
{
public static void RegisterAppServices(this MauiAppBuilder builder)
{
builder.Services.AddSingleton<IFormFactor, FormFactor>();
builder.Services.AddSingleton<IGenericSystemService, GenericSystemService>();
builder.Services.AddScoped<ISteupDataService, SteupDataService>();
}
public static void RegisterIntegryServices(this MauiAppBuilder builder)
{
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
builder.Services.AddScoped<IIntegrySteupService, IntegrySteupService>();
}
public static void RegisterSystemService(this MauiAppBuilder builder)
{
builder.Services.AddSingleton<INetworkService, NetworkService>();
}
public static void AddAuthorizationCore(this MauiAppBuilder builder)
{
builder.Services.AddAuthorizationCore();
builder.Services.AddScoped<AppAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(provider =>
provider.GetRequiredService<AppAuthenticationStateProvider>());
}
}

View File

@@ -0,0 +1,101 @@
using SteUp.Shared.Core.Dto;
using SteUp.Shared.Core.Interface.System;
namespace SteUp.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;
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;
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);
}
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
};
}
public async Task<string> SaveToTempStorage(Stream file, string fileName, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(file);
if (file.CanSeek)
file.Position = 0;
fileName = Path.GetFileName(fileName);
var dir = FileSystem.CacheDirectory;
var filePath = Path.Combine(dir, fileName);
await using var fileStream = File.Create(filePath);
await file.CopyToAsync(fileStream, ct);
return filePath;
}
public Task OpenFile(string fileName, string filePath)
{
#if IOS
throw new NotImplementedException();
#else
return Launcher.OpenAsync(new OpenFileRequest
{
Title = "Apri file",
File = new ReadOnlyFile(filePath)
});
#endif
}
}

View File

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

View File

@@ -0,0 +1,15 @@
using SteUp.Shared.Core.Interface.System;
namespace SteUp.Maui.Core.System;
public class GenericSystemService : IGenericSystemService
{
public string GetCurrentAppVersion()
{
#if DEBUG
return $"v{AppInfo.VersionString} [DEBUG]";
#else
return $"v{AppInfo.VersionString}";
#endif
}
}

View File

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

View File

@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Template.Maui"
xmlns:shared="clr-namespace:Template.Shared;assembly=Template.Shared"
x:Class="Template.Maui.MainPage"
xmlns:shared="clr-namespace:SteUp.Shared;assembly=SteUp.Shared"
x:Class="SteUp.Maui.MainPage"
BackgroundColor="{DynamicResource PageBackgroundColor}">
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">

View File

@@ -1,4 +1,4 @@
namespace Template.Maui
namespace SteUp.Maui
{
public partial class MainPage : ContentPage
{

53
SteUp.Maui/MauiProgram.cs Normal file
View File

@@ -0,0 +1,53 @@
using CommunityToolkit.Maui;
using IntegryApiClient.MAUI;
using Microsoft.Extensions.Logging;
using MudBlazor.Services;
using MudExtensions.Services;
using SteUp.Maui.Core;
using SteUp.Maui.Core.Services;
using SteUp.Shared;
using SteUp.Shared.Core.Interface;
namespace SteUp.Maui
{
public static class MauiProgram
{
private const string AppToken = "4fef1843-793d-499b-a7ed-1edd8cac465c";
public static MauiApp CreateMauiApp()
{
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseIntegry(appToken: AppToken, useLoginAzienda: true)
.UseMauiCommunityToolkit()
.UseSentry(options =>
{
options.Dsn = "https://c1ff03e3d1d2dd973a1ce73c58f92a8d@o4508499810254848.ingest.de.sentry.io/4510900455866448";
#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();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
builder.AddAuthorizationCore();
builder.RegisterAppServices();
builder.RegisterIntegryServices();
builder.RegisterSystemService();
return builder.Build();
}
}
}

View File

@@ -1,6 +1,13 @@
<?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:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<application
android:allowBackup="true"
android:icon="@mipmap/appicon"
android:usesCleartextTraffic="true"
android:supportsRtl="true">
</application>
<!-- Rete -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@@ -0,0 +1,14 @@
using Android.App;
using Android.Content.PM;
namespace SteUp.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,7 +1,7 @@
using Android.App;
using Android.Runtime;
namespace Template.Maui
namespace SteUp.Maui
{
[Application]
public class MainApplication : MauiApplication

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,7 @@ using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
namespace Template.Maui
namespace SteUp.Maui
{
internal class Program : MauiApplication
{

View File

@@ -1,7 +1,7 @@
<?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">
<ui-application appid="maui-application-id-placeholder" exec="SteUp.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" />

View File

@@ -3,7 +3,7 @@ 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
namespace SteUp.Maui.WinUI
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.

View File

@@ -1,6 +1,6 @@
<?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"/>
<assemblyIdentity version="1.0.0.0" name="SteUp.Maui.WinUI.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>

View File

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

View File

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

View File

@@ -0,0 +1 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 456 456" width="456" height="456"><defs><image width="456" height="456" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAAHIAQMAAADwb+ipAAAAAXNSR0IB2cksfwAAAANQTFRF/ezqqHJq3wAAAGhJREFUeJztyzENAAAMA6DVv+l5aHrCT64V0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN05zNB6OcAcm2KNubAAAAAElFTkSuQmCC"/></defs><style></style><use href="#img1" x="0" y="0"/></svg>

After

Width:  |  Height:  |  Size: 493 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,130 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks);net9.0-android</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net9.0-ios</TargetFrameworks>
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-maccatalyst</TargetFrameworks>-->
<!-- <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>-->
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
<OutputType>Exe</OutputType>
<RootNamespace>SteUp.Maui</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCssItems>false</EnableDefaultCssItems>
<Nullable>enable</Nullable>
<!-- Display name -->
<ApplicationTitle>SteUP</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>it.integry.SteUp</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">-->
<!-- 14.0-->
<!-- </SupportedOSPlatformVersion>-->
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>-->
<!-- <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>-->
<!--slower build, faster runtime in DEBUG-->
<!-- <_MauiForceXamlCForDebug Condition="'$(Configuration)' == 'Debug'">true</_MauiForceXamlCForDebug> -->
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>
<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
<TargetPlatformVersion>35</TargetPlatformVersion>
<!--<EmbedAssembliesIntoApk Condition="'$(Configuration)' == 'Debug'">true</EmbedAssembliesIntoApk>
<AndroidPackageFormats Condition="'$(Configuration)' == 'Release'">aab</AndroidPackageFormats>
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidLinkTool>proguard</AndroidLinkTool>-->
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android' AND '$(Configuration)' == 'Debug'">
<!--these help speed up android builds-->
<!--
<RuntimeIdentifier>android-arm64</RuntimeIdentifier>
<AndroidEnableProfiler>true</AndroidEnableProfiler>
<AndroidPackageFormat>aab</AndroidPackageFormat>
-->
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' AND '$(Configuration)' == 'Debug'">
<!--forces the simulator to pickup entitlements-->
<EnableCodeSigning>true</EnableCodeSigning>
<CodesignRequireProvisioningProfile>true</CodesignRequireProvisioningProfile>
<DisableCodesignVerification>true</DisableCodesignVerification>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion>
<DefineConstants>$(DefineConstants);APPLE;PLATFORM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
<CodesignKey>Apple Development: Massimo Fausto Morelli (6C2CUM53BT)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
</PropertyGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<!--
<BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />
<CustomEntitlements Include="keychain-access-groups" Type="StringArray" Value="%24(AppIdentifierPrefix)$(ApplicationId)" Visible="false" />
<CustomEntitlements Include="aps-environment" Type="string" Value="development" Condition="'$(Configuration)' == 'Debug'" Visible="false" />
<CustomEntitlements Include="aps-environment" Type="string" Value="production" Condition="'$(Configuration)' == 'Release'" Visible="false" />
-->
</ItemGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#FDECEA"/>
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#FDECEA" BaseSize="128,128"/>
<!-- Images -->
<MauiImage Include="Resources\Images\*"/>
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208"/>
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*"/>
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="12.2.0"/>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.3"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.12" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120"/>
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.120"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.120"/>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.12" />
<PackageReference Include="Sentry.Maui" Version="5.16.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SteUp.Shared\SteUp.Shared.csproj"/>
</ItemGroup>
</Project>

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,53 @@
<!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>SteUp.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/SteUp.Shared/css/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="_content/SteUp.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/SteUp.Shared/css/remixicon/remixicon.css"/>
<link rel="stylesheet" href="_content/SteUp.Shared/css/app.css"/>
<link rel="stylesheet" href="_content/SteUp.Shared/css/form.css"/>
<link rel="stylesheet" href="_content/SteUp.Shared/css/default-theme.css"/>
<link rel="stylesheet" href="_content/SteUp.Shared/css/custom-mudBlazor.css"/>
<link rel="stylesheet" href="SteUp.Maui.styles.css"/>
<link rel="icon" type="image/png" href="favicon.png"/>
</head>
<body>
<div class="status-bar-safe-area"></div>
<div id="app">
<div class="spinner-container">
<span class="loader"></span>
</div>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webview.js" autostart="false"></script>
<script src="_content/SteUp.Shared/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
<script src="_content/SteUp.Shared/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,78 @@
@using SteUp.Shared.Core.Helpers
@inject IJSRuntime Js
<div class="@(Back ? "" : "container") header">
<div class="header-content @(Back ? "with-back" : "no-back")">
@if (!SmallHeader)
{
if (Back)
{
<div class="left-section">
<MudButton StartIcon="@(!Cancel ? Icons.Material.Outlined.ArrowBackIosNew : "")"
OnClick="@GoBack"
Color="Color.Info"
Style="text-transform: none"
Variant="Variant.Text">
@BackTo
</MudButton>
</div>
}
<h3 class="page-title">@Title</h3>
<div class="right-section">
@if (!LabelSave.IsNullOrEmpty())
{
<MudButton OnClick="@OnSave"
Color="Color.Info"
Style="text-transform: none"
Variant="Variant.Text">
@LabelSave
</MudButton>
}
</div>
}
else
{
<div class="title">
<MudText Typo="Typo.h6">
<b>@Title</b>
</MudText>
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="@GoBack" />
</div>
}
</div>
</div>
@code{
[Parameter] public string? Title { get; set; }
[Parameter] public bool Back { get; set; }
[Parameter] public string BackTo { get; set; } = "";
[Parameter] public EventCallback OnFilterToggle { get; set; }
[Parameter] public bool Cancel { get; set; }
[Parameter] public EventCallback OnCancel { get; set; }
[Parameter] public string? LabelSave { get; set; }
[Parameter] public EventCallback OnSave { get; set; }
[Parameter] public bool SmallHeader { get; set; }
protected override void OnParametersSet()
{
Back = !Back ? !Back && Cancel : Back;
BackTo = Cancel ? "Annulla" : BackTo;
}
private async Task GoBack()
{
if (Cancel)
{
await OnCancel.InvokeAsync();
return;
}
await Js.InvokeVoidAsync("goBack");
}
}

View File

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

View File

@@ -0,0 +1,173 @@
@using System.Globalization
@using SteUp.Shared.Components.SingleElements
@using SteUp.Shared.Core.Interface.IntegryApi
@using SteUp.Shared.Core.Interface.System.Network
@inherits LayoutComponentBase
@inject INetworkService NetworkService
@inject IIntegryApiService IntegryApiService
<MudThemeProvider Theme="_currentTheme" @ref="@_mudThemeProvider" @bind-IsDarkMode="@IsDarkMode" />
<MudPopoverProvider/>
<MudDialogProvider/>
<MudSnackbarProvider/>
<ConnectionState IsNetworkAvailable="IsNetworkAvailable" ServicesIsDown="ServicesIsDown" ShowWarning="ShowWarning" />
<div class="page">
<NavMenu/>
<main>
<article>
@Body
</article>
</main>
</div>
@code {
private MudThemeProvider _mudThemeProvider = null!;
private bool IsDarkMode { get; set; }
private string _mainContentClass = "";
//Connection state
private bool _isNetworkAvailable;
private bool _servicesIsDown;
private bool _showWarning;
private DateTime _lastApiCheck = DateTime.MinValue;
private const int DelaySeconds = 90;
private CancellationTokenSource? _cts;
private bool ServicesIsDown
{
get => _servicesIsDown;
set
{
if (_servicesIsDown == value) return;
_servicesIsDown = value;
StateHasChanged();
}
}
private bool IsNetworkAvailable
{
get => _isNetworkAvailable;
set
{
if (_isNetworkAvailable == value) return;
_isNetworkAvailable = value;
StateHasChanged();
}
}
private bool ShowWarning
{
get => _showWarning;
set
{
if (_showWarning == value) return;
_showWarning = value;
StateHasChanged();
}
}
private readonly MudTheme _currentTheme = new()
{
PaletteLight = new PaletteLight()
{
Primary = "#ec4c41",
Secondary = "#002339",
Tertiary = "#dff2ff",
TextPrimary = "#000"
},
PaletteDark = new PaletteDark
{
Primary = "#ec4c41",
Secondary = "#002339",
Tertiary = "#dff2ff",
Surface = "#000406",
Background = "#000406",
TextPrimary = "#fff",
GrayDark = "#E0E0E0"
}
};
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// if (firstRender)
// {
// var isDarkMode = LocalStorage.GetString("isDarkMode");
// if (isDarkMode == null && _mudThemeProvider != null)
// {
// IsDarkMode = await _mudThemeProvider.GetSystemPreference();
// await _mudThemeProvider.WatchSystemPreference(OnSystemPreferenceChanged);
// LocalStorage.SetString("isDarkMode", IsDarkMode.ToString());
// StateHasChanged();
// }
// else
// {
// IsDarkMode = bool.Parse(isDarkMode!);
// }
// if (IsDarkMode)
// {
// _mainContentClass += "is-dark";
// StateHasChanged();
// }
// }
}
private async Task OnSystemPreferenceChanged(bool newValue)
{
IsDarkMode = newValue;
}
protected override void OnInitialized()
{
_cts = new CancellationTokenSource();
_ = CheckConnectionState(_cts.Token);
var culture = new CultureInfo("it-IT", false);
CultureInfo.CurrentCulture = culture;
CultureInfo.CurrentUICulture = culture;
}
private Task CheckConnectionState(CancellationToken token)
{
return Task.Run(async () =>
{
while (!token.IsCancellationRequested)
{
var isNetworkAvailable = NetworkService.IsNetworkAvailable();
var servicesDown = ServicesIsDown;
if (isNetworkAvailable && (DateTime.UtcNow - _lastApiCheck).TotalSeconds >= DelaySeconds)
{
servicesDown = !await IntegryApiService.SystemOk();
_lastApiCheck = DateTime.UtcNow;
}
await InvokeAsync(async () =>
{
IsNetworkAvailable = isNetworkAvailable;
ServicesIsDown = servicesDown;
await Task.Delay(1500, token);
ShowWarning = !(IsNetworkAvailable && !ServicesIsDown);
NetworkService.ConnectionAvailable = !ShowWarning;
});
await Task.Delay(500, token);
}
}, token);
}
public void Dispose()
{
_cts?.Cancel();
_cts?.Dispose();
}
}

View File

@@ -0,0 +1,99 @@
@using SteUp.Shared.Core.Interface.System.Network
@inject INetworkService NetworkService
@inject IDialogService Dialog
<div
class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
<div class="container-navbar">
<ul class="navbar-nav flex-row nav-justified align-items-center w-100 text-center">
<li class="nav-item">
<NavLink class="nav-link" href="ispezioni" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-file-list-3-line"></i>
<span>Ispezioni</span>
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="user" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-user-line"></i>
<span>Profilo</span>
</div>
</NavLink>
</li>
</ul>
</div>
@if (PlusVisible)
{
<MudMenu PopoverClass="custom_popover" AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomRight">
<ActivatorContent>
<MudFab Class="custom-plus-button" OnClick="OnOpenMenu" Color="Color.Surface" Size="Size.Medium" IconSize="Size.Medium"
IconColor="Color.Primary" StartIcon="@Icons.Material.Filled.Add"/>
</ActivatorContent>
<ChildContent>
@if (SchedaVisible)
{
<MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@NewScheda">
Nuova scheda
</MudMenuItem>
}
else
{
<MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@NewActivity">
Nuova ispezione
</MudMenuItem>
}
</ChildContent>
</MudMenu>
}
</nav>
</div>
@code
{
private bool IsVisible { get; set; } = true;
private bool PlusVisible { get; set; } = true;
private bool SchedaVisible { get; set; }
protected override Task OnInitializedAsync()
{
NavigationManager.LocationChanged += (_, args) =>
{
var location = args.Location.Remove(0, NavigationManager.BaseUri.Length);
var newIsVisible = new List<string> { "ispezioni", "ispezione", "user" }
.Contains(location);
var newPlusVisible = new List<string> { "ispezioni", "ispezione", "user" }
.Contains(location);
if (IsVisible == newIsVisible && PlusVisible == newPlusVisible) return;
IsVisible = newIsVisible;
PlusVisible = newPlusVisible;
StateHasChanged();
};
return Task.CompletedTask;
}
private void NewActivity()
{
_ = ModalHelper.OpenSelectShop(Dialog);
}
private void NewScheda()
{
_ = ModalHelper.OpenFormScheda(Dialog);
}
private void OnOpenMenu()
{
var location = NavigationManager.Uri.Remove(0, NavigationManager.BaseUri.Length);
SchedaVisible = new List<string> { "ispezione" }.Contains(location);
StateHasChanged();
}
}

View File

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

View File

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

View File

@@ -0,0 +1,8 @@
<div class="spinner-container @(FullScreen ? "" : "not-fullScreen")">
<span class="loader"></span>
</div>
@code
{
[Parameter] public bool FullScreen { get; set; } = true;
}

View File

@@ -0,0 +1,43 @@
.spinner-container {
display: flex;
justify-content: center;
height: calc(100vh - 10.1rem);
align-items: center;
color: var(--mud-palette-primary);
}
.not-fullScreen {
height: auto !important;
padding: 2rem 0 !important;
}
.loader {
width: 50px;
aspect-ratio: 1;
border-radius: 50%;
border: 8px solid #0000;
border-right-color: var(--mud-palette-primary);
position: relative;
animation: l24 1s infinite linear;
}
.loader:before,
.loader:after {
content: "";
position: absolute;
inset: -8px;
border-radius: 50%;
border: inherit;
animation: inherit;
animation-duration: 2s;
}
.loader:after {
animation-duration: 4s;
}
@keyframes l24 {
100% {
transform: rotate(1turn)
}
}

View File

@@ -0,0 +1,12 @@
@page "/"
@using SteUp.Shared.Components.Layout.Spinner
@attribute [Authorize]
<SpinnerLayout FullScreen="true"/>
@code {
protected override void OnInitialized()
{
NavigationManager.NavigateTo("/ispezioni");
}
}

View File

@@ -0,0 +1,51 @@
@page "/ispezione"
@using SteUp.Shared.Components.Layout
<HeaderLayout Title="Ispezione" BackTo="Indietro" Back="true"/>
<div class="container content pb-safe-area">
<div class="container-primary-info">
<div class="section-primary-info">
<div class="inspection-info">
<span class="info-title">
@SteupDataService.Inspection.PuntoVendita!.CodMdep - @SteupDataService.Inspection.PuntoVendita.Descrizione
</span>
<span class="info-subtitle">
@SteupDataService.Inspection.PuntoVendita.Indirizzo
</span>
</div>
</div>
<div class="divider"></div>
<div class="section-info">
<div class="section-inspection-info">
<div>
<span class="info-inspection-title">Data ispezione</span>
<MudChip T="string" Size="Size.Small" Color="Color.Default">
@SteupDataService.Inspection.DateInspection.ToString("d")
</MudChip>
</div>
</div>
<div class="section-inspection-info">
<div>
<span class="info-inspection-title">Stato ispezione</span>
<MudChip T="string" Size="Size.Small" Color="Color.Warning">
IN CORSO
</MudChip>
</div>
</div>
</div>
</div>
</div>
@code {
protected override async Task OnInitializedAsync()
{
}
}

View File

@@ -0,0 +1,69 @@
.container-primary-info {
background: var(--light-card-background);
width: 100%;
margin-bottom: 2rem;
border-radius: 12px;
}
.container-primary-info .divider {
margin: .25rem 0;
}
.section-primary-info {
display: flex;
flex-direction: row;
align-items: center;
gap: 1.5rem;
padding: .8rem 1.2rem .4rem;
}
.personal-info {
display: flex;
flex-direction: column;
align-items: flex-start;
line-height: normal;
}
.info-title {
color: var(--mud-palette-text-primary);
font-weight: 800;
font-size: x-large;
line-height: normal;
}
.info-subtitle {
color: var(--mud-palette-gray-default);
font-size: medium;
font-weight: 600;
line-height: normal;
}
.section-info {
display: flex;
justify-content: space-between;
flex-direction: row;
padding: .4rem 1.2rem .8rem;
}
.section-inspection-info {
display: flex;
flex-direction: column;
}
.section-inspection-info > div {
display: flex;
flex-direction: column;
line-height: normal;
margin: .25rem 0;
}
.info-inspection-title {
color: var(--mud-palette-gray-darker);
font-weight: 800;
}
.info-inspection-text {
color: var(--mud-palette-text-secondary);
font-weight: 700;
font-size: small;
}

View File

@@ -0,0 +1,9 @@
@page "/ispezioni"
@attribute [Authorize]
@using SteUp.Shared.Components.Layout
<HeaderLayout Title="Ispezioni"/>
<div class="container">
</div>

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,116 @@
@page "/login"
@using SteUp.Shared.Components.Layout.Spinner
@using SteUp.Shared.Core.Interface.System
@using SteUp.Shared.Core.Services
@inject IUserAccountService UserAccountService
@inject AppAuthenticationStateProvider AuthenticationStateProvider
@inject IGenericSystemService GenericSystemService
@if (Spinner)
{
<SpinnerLayout/>
}
else
{
<div class="login-page">
<div class="container container-top-logo">
<img src="_content/SteUp.Shared/images/logo_steup.svg" class="logo" alt="sales book">
</div>
<div class="container container-login">
<div class="login-form-container">
<div class="input-group">
<MudTextField @bind-Value="UserData.Username" Label="Username" Variant="Variant.Outlined"/>
</div>
<div class="input-group">
<MudTextField InputType="@_passwordInput" @bind-Value="UserData.Password" Label="Password" Variant="Variant.Outlined" Adornment="Adornment.End" AdornmentIcon="@_passwordInputIcon" OnAdornmentClick="ShowPassword" AdornmentAriaLabel="Show Password"/>
</div>
<div class="input-group mb-2">
<MudTextField @bind-Value="UserData.CodHash" Label="Profilo azienda" Variant="Variant.Outlined"/>
</div>
<MudButton OnClick="@SignInUser" Color="Color.Primary" Variant="Variant.Filled">Login</MudButton>
@if (_attemptFailed)
{
<MudAlert Class="my-3" Dense="true" Severity="Severity.Error" Variant="Variant.Filled">@ErrorMessage</MudAlert>
}
</div>
<div class="my-4 login-footer">
<span>@GenericSystemService.GetCurrentAppVersion() | Powered by")</span>
<img src="_content/SteUp.Shared/images/logoIntegry.svg" class="img-fluid" alt="Integry">
</div>
</div>
</div>
}
@code {
private SignIn UserData { get; } = new();
private bool Spinner { get; set; }
private string ErrorMessage { get; set; } = "";
private bool _attemptFailed;
private bool _isShow;
private InputType _passwordInput = InputType.Password;
private string _passwordInputIcon = Icons.Material.Rounded.VisibilityOff;
private void ShowPassword()
{
if (_isShow)
{
_isShow = false;
_passwordInputIcon = Icons.Material.Rounded.VisibilityOff;
_passwordInput = InputType.Password;
}
else
{
_isShow = true;
_passwordInputIcon = Icons.Material.Rounded.Visibility;
_passwordInput = InputType.Text;
}
}
protected override void OnInitialized()
{
UserData.CodHash = LocalStorage.GetString("codHash");
StateHasChanged();
}
private async Task SignInUser()
{
_attemptFailed = false;
if (!string.IsNullOrEmpty(UserData.Username) && !string.IsNullOrEmpty(UserData.Password) && !string.IsNullOrEmpty(UserData.CodHash))
{
Spinner = true;
StateHasChanged();
try
{
await UserAccountService.Login(UserData.Username, UserData.Password, UserData.CodHash);
AuthenticationStateProvider.NotifyAuthenticationState(); //Chiamato per forzare il refresh
await SteupDataService.Init();
LocalStorage.SetString("codHash", UserData.CodHash);
NavigationManager.NavigateTo("/");
StateHasChanged();
}
catch (Exception e)
{
Spinner = false;
StateHasChanged();
ErrorMessage = e.Message;
_attemptFailed = true;
Console.WriteLine(e);
}
}
}
public class SignIn
{
public string? Username { get; set; }
public string? Password { get; set; }
public string? CodHash { get; set; }
}
}

View File

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

View File

@@ -0,0 +1,115 @@
@page "/user"
@attribute [Authorize]
@using SteUp.Shared.Components.Layout
@using SteUp.Shared.Components.SingleElements
@using SteUp.Shared.Core.Authorization.Enum
@using SteUp.Shared.Core.Helpers
@using SteUp.Shared.Core.Interface.System.Network
@using SteUp.Shared.Core.Services
@using SteUp.Shared.Core.Utility
@inject AppAuthenticationStateProvider AuthenticationStateProvider
@inject INetworkService NetworkService
<HeaderLayout Title="Profilo"/>
@if (IsLoggedIn)
{
<div class="container content pb-safe-area">
<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">Profilo azienda</span>
<span class="info-text">@CodHash</span>
</div>
</div>
<div class="section-personal-info">
<div>
<span class="info-title">Status</span>
@if (NetworkService.ConnectionAvailable)
{
<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>
</div>
<div class="container-button">
<MudButton Class="button-settings green-icon"
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
Size="Size.Medium"
OnClick="@UpdateDb"
Variant="Variant.Outlined">
Sincronizza ispezioni
</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>
<AppVersion/>
</div>
}
@code {
private bool IsLoggedIn { get; set; }
private string? CodHash { get; set; } = "";
protected override async Task OnInitializedAsync()
{
IsLoggedIn = await UserSession.IsLoggedIn();
CodHash = LocalStorage.GetString("codHash");
StateHasChanged();
}
private void UpdateDb()
{
}
private async Task Logout()
{
await AuthenticationStateProvider.SignOut();
IsLoggedIn = await UserSession.IsLoggedIn();
StateHasChanged();
}
}

View File

@@ -0,0 +1,83 @@
.container-primary-info {
background: var(--light-card-background);
width: 100%;
margin-bottom: 2rem;
border-radius: 12px;
}
.container-primary-info .divider {
margin: 0 0 0 7rem;
width: unset;
}
.section-primary-info {
display: flex;
flex-direction: row;
align-items: center;
gap: 1.5rem;
padding: .8rem 1.2rem .4rem;
}
.personal-info {
display: flex;
flex-direction: column;
align-items: flex-start;
line-height: normal;
}
.info-nome {
color: var(--mud-palette-text-primary);
font-weight: 800;
font-size: x-large;
}
.info-section {
color: var(--mud-palette-gray-default);
font-size: medium;
font-weight: 600;
}
.section-info {
display: flex;
justify-content: space-between;
flex-direction: row;
padding: .4rem 1.2rem .8rem;
}
.section-personal-info {
display: flex;
flex-direction: column;
}
.section-personal-info > div {
display: flex;
flex-direction: column;
line-height: normal;
margin: .25rem 0;
}
.info-title {
color: var(--mud-palette-gray-darker);
font-weight: 800;
}
.info-text {
color: var(--mud-palette-text-secondary);
font-weight: 700;
font-size: small;
}
.content ::deep .user-button { border: 1px solid var(--card-border-color) !important; }
.user-button > i { font-size: large; }
.user-button > span {
font-size: medium;
font-weight: 600;
}
.status { font-weight: 700; }
.status.online { color: var(--mud-palette-success); }
.status.offline { color: var(--mud-palette-error); }

View File

@@ -0,0 +1,53 @@
@using SteUp.Shared.Components.SingleElements.Modal.ExceptionModal
@inject NavigationManager NavigationManager
<ErrorBoundary @ref="ErrorBoundary">
<ChildContent>
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Routes).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
<Authorizing>
<p>Authorizing page</p>
</Authorizing>
<NotAuthorized>
@if (context.User.Identity?.IsAuthenticated != true)
{
NavigationManager.NavigateTo("/login");
}
else
{
<p role="alert">You are not authorized to access this resource.</p>
}
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView>
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
</ChildContent>
<ErrorContent>
<ExceptionModal @ref="ExceptionModal"
Exception="@context"
ErrorBoundary="@ErrorBoundary"
OnRetry="() => ErrorBoundary?.Recover()"/>
</ErrorContent>
</ErrorBoundary>
@code {
private ErrorBoundary? ErrorBoundary { get; set; }
private ExceptionModal ExceptionModal { get; set; }
protected override async Task OnInitializedAsync()
{
await SteupDataService.Init();
}
}

View File

@@ -0,0 +1,6 @@
@using SteUp.Shared.Core.Interface.System
@inject IGenericSystemService GenericSystemService
<div class="app-version">
<span>@GenericSystemService.GetCurrentAppVersion()</span>
</div>

View File

@@ -0,0 +1,11 @@
.app-version{
width: 100%;
display: flex;
justify-content: center;
margin: 8px 0;
}
.app-version span{
font-size: smaller;
color: var(--mud-palette-gray-darker);
}

View File

@@ -0,0 +1,48 @@
@using SteUp.Shared.Core.Dto
@using SteUp.Shared.Core.Dto.PageState
<div class="shop-card ripple-container" @onclick="StartInspection">
<div class="shop-body-section">
<div class="title-section">
<MudText Class="shop-title" Typo="Typo.subtitle1">
<b>@PuntoVendita.CodMdep</b> - @PuntoVendita.Descrizione
</MudText>
</div>
@if (!PuntoVendita.Indirizzo.IsNullOrEmpty())
{
<div class="subtitle-section">
<MudText Class="shop-title" Typo="Typo.subtitle1">
@PuntoVendita.Indirizzo
</MudText>
</div>
<div class="sub-info-section">
<MudChip T="string" Icon="@Icons.Material.Filled.LocationCity" Size="Size.Small" Color="Color.Default">
@PuntoVendita.Citta
</MudChip>
<MudChip T="string" Size="Size.Small" Color="Color.Default">
@PuntoVendita.Cap
</MudChip>
<MudChip T="string" Size="Size.Small" Color="Color.Default">
@PuntoVendita.Provincia
</MudChip>
</div>
}
</div>
</div>
@code {
[Parameter] public PuntoVenditaDto PuntoVendita { get; set; } = null!;
private void StartInspection()
{
SteupDataService.Inspection = new InspectionPageState
{
DateInspection = DateTime.Today,
PuntoVendita = PuntoVendita
};
NavigationManager.NavigateTo("/ispezione");
}
}

View File

@@ -0,0 +1,5 @@
.shop-card{
padding: .5rem 1rem;
background-color: var(--mud-palette-background-gray);
border-radius: 1em;
}

View File

@@ -0,0 +1,26 @@
<div class="Connection @(ShowWarning ? "Show" : "Hide") @(IsNetworkAvailable? ServicesIsDown ? "ServicesIsDown" : "SystemOk" : "NetworkKo")">
@if (IsNetworkAvailable)
{
if(ServicesIsDown)
{
<i class="ri-cloud-off-fill"></i>
<span>Servizi offline</span>
}
else
{
<i class="ri-cloud-fill"></i>
<span>Online</span>
}
}
else
{
<i class="ri-wifi-off-line"></i>
<span>Nessuna connessione</span>
}
</div>
@code{
[Parameter] public bool IsNetworkAvailable { get; set; }
[Parameter] public bool ServicesIsDown { get; set; }
[Parameter] public bool ShowWarning { get; set; }
}

View File

@@ -0,0 +1,59 @@
<div class="container container-modal">
<div class="c-modal">
<div class="exception-header mb-2">
<i class="ri-emotion-unhappy-line"></i>
<span>Ops</span>
</div>
<div class="text">
@if (Exception != null)
{
<code>@Message</code>
}
</div>
<div class="button-container">
<div @onclick="OnRetryClick" class="card-button">
<span>Riprova</span>
</div>
<div @onclick="OnContinueClick" class="card-button">
<span>Continua</span>
</div>
</div>
</div>
</div>
@code {
[Parameter] public Exception? Exception { get; set; }
[Parameter] public EventCallback OnRetry { get; set; }
[Parameter] public ErrorBoundary? ErrorBoundary { get; set; }
private string Message { get; set; } = "";
protected override void OnInitialized()
{
if (Exception == null) return;
if (Exception.Message.Contains("Failed to connect to"))
{
var ipPort = Exception.Message.Split("to /")[1];
Message = $"Impossibile collegarsi al server ({ipPort})";
}
else
{
Message = Exception.Message;
}
StateHasChanged();
}
private async Task OnRetryClick()
{
await OnRetry.InvokeAsync();
}
private async Task OnContinueClick()
{
NavigationManager.NavigateTo("/");
await OnRetry.InvokeAsync();
}
}

View File

@@ -0,0 +1,61 @@
.container-modal {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}
.c-modal {
border-radius: 16px;
box-shadow: var(--exception-box-shadow);
padding: 16px;
}
.button-container {
display: flex;
gap: 1rem;
flex-direction: row;
align-items: center;
width: 100%;
justify-content: space-between;
margin: 1.5rem 0 0 0;
}
.text {
font-size: medium;
font-weight: 500;
display: flex;
text-align: center;
}
.card-button {
text-align: center;
background-color: transparent;
padding: .3rem 1rem;
font-weight: 700;
color: var(--bs-primary-text-emphasis);
}
.exception-header {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.exception-header > i {
font-size: 3rem;
line-height: normal;
color: var(--bs-danger);
}
.exception-header > span {
font-size: x-large;
font-weight: 700;
}
code {
width: 100%;
height: auto;
color: var(--bs-gray-dark);
}

View File

@@ -0,0 +1,121 @@
@using SteUp.Shared.Components.Layout
@using SteUp.Shared.Core.Dto
@using SteUp.Shared.Core.Interface.System
@inject IAttachedService AttachedService
<MudDialog Class="customDialog-form disable-safe-area">
<DialogContent>
<HeaderLayout SmallHeader="true" Cancel="true" OnCancel="@(() => MudDialog.Cancel())" Title="@TitleModal"/>
@if (RequireNewName)
{
<MudTextField @bind-Value="NewName" Class="px-3" Variant="Variant.Outlined"/>
}
else
{
<div style="margin-bottom: 1rem;" class="content attached">
<MudFab Size="Size.Small" Color="Color.Primary"
StartIcon="@Icons.Material.Rounded.CameraAlt"
Label="Camera" OnClick="@OnCamera"/>
<MudFab Size="Size.Small" Color="Color.Primary"
StartIcon="@Icons.Material.Rounded.Image"
Label="Galleria" OnClick="@OnGallery"/>
</div>
}
</DialogContent>
<DialogActions>
@if (RequireNewName)
{
<MudButton Disabled="NewName.IsNullOrEmpty()" Class="my-3" Size="Size.Small" Variant="Variant.Filled"
Color="Color.Primary"
StartIcon="@Icons.Material.Rounded.Check" OnClick="@OnNewName">
Salva
</MudButton>
}
</DialogActions>
</MudDialog>
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!;
[Parameter] public bool CanAddPosition { get; set; }
private AttachedDto? Attached { get; set; }
private bool _requireNewName;
private bool RequireNewName
{
get => _requireNewName;
set
{
_requireNewName = value;
TitleModal = _requireNewName ? "Nome allegato" : "Aggiungi allegati";
StateHasChanged();
}
}
private string TitleModal { get; set; } = "Aggiungi allegati";
private string? _newName;
private string? NewName
{
get => _newName;
set
{
_newName = value;
StateHasChanged();
}
}
protected override void OnInitialized()
{
RequireNewName = false;
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
}
private async Task OnCamera()
{
Attached = await AttachedService.SelectImageFromCamera();
if (Attached != null)
{
RequireNewName = true;
StateHasChanged();
}
}
private async Task OnGallery()
{
Attached = await AttachedService.SelectImageFromGallery();
if (Attached != null)
{
RequireNewName = true;
StateHasChanged();
}
}
private void OnNewName()
{
if (Attached != null)
{
switch (Attached.Type)
{
case AttachedDto.TypeAttached.Image:
{
var extension = Path.GetExtension(Attached.Name);
Attached.Name = NewName! + extension;
break;
}
default:
throw new ArgumentOutOfRangeException();
}
}
MudDialog.Close(Attached);
}
}

View File

@@ -0,0 +1,9 @@
.content.attached {
display: flex;
gap: 2rem;
padding: 1rem;
height: unset;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}

View File

@@ -0,0 +1,237 @@
@using SteUp.Shared.Components.Layout
@using SteUp.Shared.Components.Layout.Overlay
@using SteUp.Shared.Core.Dto
@using SteUp.Shared.Core.Interface.IntegryApi
@using SteUp.Shared.Core.Interface.System.Network
@inject INetworkService NetworkService
@inject IDialogService Dialog
@inject IIntegryApiService IntegryApiService
<MudDialog Class="customDialog-form">
<DialogContent>
<HeaderLayout Cancel="true" OnCancel="@(() => MudDialog.Cancel())" LabelSave="@LabelSave"
OnSave="Save" Title="Scheda"/>
<div class="content">
<div class="input-card">
<div class="form-container">
<span class="disable-full-width">Reparto</span>
@if (SteupDataService.Reparti.IsNullOrEmpty())
{
<MudSkeleton/>
}
else
{
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="JtbFasiDto?" Variant="Variant.Text"
@bind-Value="SchedaDto.Reparto" AdornmentIcon="@Icons.Material.Filled.Code"
ToStringFunc="@(x => x?.Descrizione)"
@bind-Value:after="OnAfterChangeValue" Class="customIcon-select">
@foreach (var fasi in SteupDataService.Reparti)
{
<MudSelectItemExtended Class="custom-item-select" Value="@fasi">
@fasi.Descrizione
</MudSelectItemExtended>
}
</MudSelectExtended>
}
</div>
<div class="divider"></div>
<div class="form-container">
<span class="disable-full-width">Motivo</span>
@if (SteupDataService.TipiAttività.IsNullOrEmpty())
{
<MudSkeleton/>
}
else
{
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text"
@bind-Value="SchedaDto.ActivityTypeId" Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code"
@bind-Value:after="OnAfterChangeValue">
@foreach (var type in SteupDataService.TipiAttività)
{
<MudSelectItemExtended Class="custom-item-select"
Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
}
</MudSelectExtended>
}
</div>
</div>
@* <div class="container-chip-attached"> *@
@* @if (!AttachedList.IsNullOrEmpty()) *@
@* { *@
@* foreach (var item in AttachedList!.Select((p, index) => new { p, index })) *@
@* { *@
@* if (item.p.Type == AttachedDTO.TypeAttached.Position) *@
@* { *@
@* <MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success" *@
@* OnClick="@(() => OpenPosition(item.p))" *@
@* OnClose="@(() => OnRemoveAttached(item.index))"> *@
@* @item.p.Description *@
@* </MudChip> *@
@* } *@
@* else *@
@* { *@
@* <MudChip T="string" Color="Color.Default" OnClick="@(() => OpenAttached(item.p))" *@
@* OnClose="@(() => OnRemoveAttached(item.index))"> *@
@* @item.p.Name *@
@* </MudChip> *@
@* } *@
@* } *@
@* } *@
@* *@
@* @if (!IsLoading) *@
@* { *@
@* if (ActivityFileList != null) *@
@* { *@
@* foreach (var file in ActivityFileList) *@
@* { *@
@* <MudChip T="string" OnClick="@(() => OpenAttached(file.FileName))" *@
@* OnClose="@(() => DeleteAttach(file))" Color="Color.Default"> *@
@* @file.FileName *@
@* </MudChip> *@
@* } *@
@* } *@
@* } *@
@* else *@
@* { *@
@* <MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/> *@
@* } *@
@* </div> *@
@if (!IsView)
{
<div class="container-button">
<MudButton Class="button-settings green-icon"
FullWidth="true"
StartIcon="@Icons.Material.Rounded.AttachFile"
Size="Size.Medium"
OnClick="@OpenAddAttached"
Variant="Variant.Outlined">
Aggiungi allegati
</MudButton>
</div>
}
<div class="input-card">
<div class="form-container">
<span class="disable-full-width">Scadenza</span>
<MudSelectExtended FullWidth="true" ReadOnly="@IsView" T="int" Variant="Variant.Text"
@bind-Value="@SchedaDto.Scadenza" @bind-Value:after="OnAfterChangeValue"
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
<MudSelectItemExtended Class="custom-item-select" Text="24H" Value="24" />
<MudSelectItemExtended Class="custom-item-select" Text="1 Settimana" Value="168" />
<MudSelectItemExtended Class="custom-item-select" Text="1 Mese" Value="730" />
<MudSelectItemExtended Class="custom-item-select" Text="2 Mesi" Value="1460" />
</MudSelectExtended>
</div>
<div class="divider"></div>
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Responsabile" Variant="Variant.Text"
@bind-Value="SchedaDto.Responsabile" @bind-Value:after="OnAfterChangeValue"
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
<div class="divider"></div>
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Note" Variant="Variant.Text" Lines="3"
@bind-Value="SchedaDto.Note" @bind-Value:after="OnAfterChangeValue"
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
</div>
<div class="container-button">
<MudButton Class="button-settings blue-icon"
FullWidth="true"
StartIcon="@Icons.Material.Rounded.Description"
Size="Size.Medium"
OnClick="@SuggestActivityDescription"
Variant="Variant.Outlined">
Suggerisci note descrittive
</MudButton>
</div>
</div>
</DialogContent>
</MudDialog>
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!;
private SchedaDto SchedaDto { get; set; } = new();
private bool IsNew { get; set; }
private bool IsLoading { get; set; }
private bool IsView => !NetworkService.ConnectionAvailable;
//Overlay
private bool VisibleOverlay { get; set; }
private bool SuccessAnimation { get; set; }
private string? LabelSave { get; set; }
protected override async Task OnInitializedAsync()
{
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
}
private async Task Save()
{
}
private async Task OpenAddAttached()
{
var result = await ModalHelper.OpenAddAttached(Dialog);
// if (result is { Canceled: false, Data: not null } && result.Data.GetType() == typeof(AttachedDTO))
// {
// var attached = (AttachedDTO)result.Data;
//
// if (attached.Type == AttachedDTO.TypeAttached.Position)
// CanAddPosition = false;
//
// AttachedList ??= [];
// AttachedList.Add(attached);
// }
}
private void OnAfterChangeValue()
{
if (!IsNew)
LabelSave = "Aggiorna";
StateHasChanged();
}
private void SuggestActivityDescription()
{
if (SchedaDto.ActivityTypeId == null)
{
Snackbar.Add("Indicare prima il motivo", Severity.Error);
return;
}
VisibleOverlay = true;
StateHasChanged();
_ = Task.Run(async () =>
{
var activityDescriptions = await IntegryApiService.SuggestActivityDescription(SchedaDto.ActivityTypeId);
var modal = await ModalHelper.OpenSuggestActivityDescription(Dialog, activityDescriptions);
if (modal is { Canceled: false, Data: not null })
SchedaDto.Note = modal.Data!.ToString();
VisibleOverlay = false;
await InvokeAsync(StateHasChanged);
});
}
}

View File

@@ -0,0 +1,13 @@
.container-chip-attached {
width: 100%;
margin-bottom: 1rem;
}
.container-button {
background: var(--mud-palette-background-gray) !important;
box-shadow: unset;
}
.input-card {
margin-bottom: 1.5rem;
}

View File

@@ -0,0 +1,86 @@
@using SteUp.Shared.Components.SingleElements.Card
@using SteUp.Shared.Core.Dto
<MudDialog OnBackdropClick="Cancel">
<DialogContent>
<div class="select-shop-content">
<div class="shop-header">
<div class="shop-title">
<MudText Typo="Typo.h5"><b>Seleziona il negozio</b></MudText>
<MudIconButton Icon="@Icons.Material.Rounded.Close" Size="Size.Small" OnClick="@Cancel"/>
</div>
<div class="input-card clearButton">
<MudTextField T="string?" Placeholder="Cerca..." Variant="Variant.Text"
@bind-Value="FilterText" DebounceInterval="500"
OnDebounceIntervalElapsed="ApplyFilters"/>
</div>
</div>
<div class="shop-body">
@if (_afterRender)
{
if (FilteredList.IsNullOrEmpty())
{
<MudText Typo="Typo.body2">Nessun negozio trovato</MudText>
}
else
{
<Virtualize Items="FilteredList" Context="puntoVendita">
<ShopCard PuntoVendita="puntoVendita"/>
</Virtualize>
}
}
</div>
</div>
</DialogContent>
</MudDialog>
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!;
private List<PuntoVenditaDto>? FilteredList { get; set; }
private string? FilterText { get; set; }
private bool _afterRender;
private void Cancel() => MudDialog.Cancel();
protected override void OnInitialized()
{
_afterRender = false;
}
protected override void OnAfterRender(bool firstRender)
{
if (_afterRender) return;
_afterRender = true;
ApplyFilters();
}
private void ApplyFilters()
{
if (FilterText.IsNullOrEmpty())
{
FilteredList = SteupDataService.PuntiVenditaList;
StateHasChanged();
return;
}
FilteredList = SteupDataService.PuntiVenditaList.FindAll(x =>
(x.Indirizzo != null && x.Indirizzo.ContainsIgnoreCase(FilterText!)) ||
(x.Descrizione != null && x.Descrizione.ContainsIgnoreCase(FilterText!)) ||
(x.CodMdep != null && x.CodMdep.ContainsIgnoreCase(FilterText!)) ||
(x.Citta != null && x.Citta.ContainsIgnoreCase(FilterText!)) ||
(x.Cap != null && x.Cap.ContainsIgnoreCase(FilterText!)) ||
(x.Provincia != null && x.Provincia.ContainsIgnoreCase(FilterText!))
);
StateHasChanged();
}
}

View File

@@ -0,0 +1,18 @@
.shop-header{
display: flex;
flex-direction: column;
gap: .5rem;
}
.shop-title{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.shop-body{
display: flex;
flex-direction: column;
gap: 1rem;
}

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