diff --git a/Template.Maui/App.xaml b/Template.Maui/App.xaml index 4430642..c00d694 100644 --- a/Template.Maui/App.xaml +++ b/Template.Maui/App.xaml @@ -7,7 +7,7 @@ - #512bdf + #dff2ff White diff --git a/Template.Maui/Platforms/Android/Resources/values/colors.xml b/Template.Maui/Platforms/Android/Resources/values/colors.xml index fbaa64a..b37dd4c 100644 --- a/Template.Maui/Platforms/Android/Resources/values/colors.xml +++ b/Template.Maui/Platforms/Android/Resources/values/colors.xml @@ -1,6 +1,6 @@ - #512BD4 - #2B0B98 - #2B0B98 + #dff2ff + #00a0de + #00a0de diff --git a/Template.Maui/Platforms/Tizen/Main.cs b/Template.Maui/Platforms/Tizen/Main.cs deleted file mode 100644 index 2c4e844..0000000 --- a/Template.Maui/Platforms/Tizen/Main.cs +++ /dev/null @@ -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); - } - } -} diff --git a/Template.Maui/Platforms/Tizen/tizen-manifest.xml b/Template.Maui/Platforms/Tizen/tizen-manifest.xml deleted file mode 100644 index a5a25be..0000000 --- a/Template.Maui/Platforms/Tizen/tizen-manifest.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - maui-appicon-placeholder - - - - - http://tizen.org/privilege/internet - - - - diff --git a/Template.Maui/Resources/AppIcon/appicon.svg b/Template.Maui/Resources/AppIcon/appicon.svg index 456d120..869321d 100644 --- a/Template.Maui/Resources/AppIcon/appicon.svg +++ b/Template.Maui/Resources/AppIcon/appicon.svg @@ -1,4 +1 @@ - - - - + \ No newline at end of file diff --git a/Template.Maui/Resources/AppIcon/appiconfg.svg b/Template.Maui/Resources/AppIcon/appiconfg.svg index 14f4932..beb8682 100644 --- a/Template.Maui/Resources/AppIcon/appiconfg.svg +++ b/Template.Maui/Resources/AppIcon/appiconfg.svg @@ -1,8 +1 @@ - - - - - - - - + \ No newline at end of file diff --git a/Template.Maui/Resources/Splash/splash.svg b/Template.Maui/Resources/Splash/splash.svg index 14f4932..23cbbe4 100644 --- a/Template.Maui/Resources/Splash/splash.svg +++ b/Template.Maui/Resources/Splash/splash.svg @@ -1,8 +1,40 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Template.Maui/Template.Maui.csproj b/Template.Maui/Template.Maui.csproj index e19f527..02b1387 100644 --- a/Template.Maui/Template.Maui.csproj +++ b/Template.Maui/Template.Maui.csproj @@ -23,7 +23,7 @@ enable - Template.Maui + sales book it.integry.template.maui @@ -94,10 +94,10 @@ - + - + diff --git a/Template.Shared/Components/Layout/HeaderLayout.razor b/Template.Shared/Components/Layout/HeaderLayout.razor index afde371..19f494c 100644 --- a/Template.Shared/Components/Layout/HeaderLayout.razor +++ b/Template.Shared/Components/Layout/HeaderLayout.razor @@ -22,7 +22,7 @@ { @if (ShowFilter) { - + } @* @if (ShowCalendarToggle) @@ -32,7 +32,7 @@ @if (ShowProfile) { - + } } else diff --git a/Template.Shared/Components/Layout/HeaderLayout.razor.css b/Template.Shared/Components/Layout/HeaderLayout.razor.css index 5d06b34..146d09f 100644 --- a/Template.Shared/Components/Layout/HeaderLayout.razor.css +++ b/Template.Shared/Components/Layout/HeaderLayout.razor.css @@ -14,8 +14,6 @@ font-size: larger; } -.right-section { min-height: 45px; } - .left-section ::deep button, .right-section ::deep button { font-size: 1.1rem; } .left-section ::deep .mud-button-icon-start { margin-right: 3px !important; } diff --git a/Template.Shared/Components/Layout/MainLayout.razor b/Template.Shared/Components/Layout/MainLayout.razor index b86279f..fc60a41 100644 --- a/Template.Shared/Components/Layout/MainLayout.razor +++ b/Template.Shared/Components/Layout/MainLayout.razor @@ -4,13 +4,13 @@ @inject IJSRuntime JS @inject BackNavigationService BackService - - - - + + + +
- +
@@ -21,22 +21,65 @@
@code { + private MudThemeProvider? _mudThemeProvider; + private bool IsDarkMode { get; set; } + private string _mainContentClass = ""; + private readonly MudTheme _currentTheme = new() { PaletteLight = new PaletteLight() { - Primary = "#ABA9BF", - Secondary = "#BEB7DF", - Tertiary = "#B2FDAD" + Primary = "#00a0de", + Secondary = "#002339", + Tertiary = "#dff2ff", + TextPrimary = "#000" + }, + PaletteDark = new PaletteDark + { + Primary = "#00a0de", + Secondary = "#002339", + Tertiary = "#dff2ff", + Surface = "#000406", + Background = "#000406", + TextPrimary = "#fff", + GrayDark = "#E0E0E0" } }; + protected override async Task OnAfterRenderAsync(bool firstRender) + { + // if (firstRender) + // { + // var isDarkMode = LocalStorage.GetString("isDarkMode"); + + // if (isDarkMode == null && _mudThemeProvider != null) + // { + // IsDarkMode = await _mudThemeProvider.GetSystemPreference(); + // await _mudThemeProvider.WatchSystemPreference(OnSystemPreferenceChanged); + // LocalStorage.SetString("isDarkMode", IsDarkMode.ToString()); + // StateHasChanged(); + // } + // else + // { + // IsDarkMode = bool.Parse(isDarkMode!); + // } + + // if (IsDarkMode) + // { + // _mainContentClass += "is-dark"; + // StateHasChanged(); + // } + // } + } + + private async Task OnSystemPreferenceChanged(bool newValue) + { + IsDarkMode = newValue; + } + protected override void OnInitialized() { - BackService.OnHardwareBack += async () => - { - await JS.InvokeVoidAsync("goBack"); - }; + BackService.OnHardwareBack += async () => { await JS.InvokeVoidAsync("goBack"); }; var culture = new CultureInfo("it-IT", false); diff --git a/Template.Shared/Components/Layout/NavMenu.razor.css b/Template.Shared/Components/Layout/NavMenu.razor.css index fb5ee34..e73f065 100644 --- a/Template.Shared/Components/Layout/NavMenu.razor.css +++ b/Template.Shared/Components/Layout/NavMenu.razor.css @@ -83,7 +83,9 @@ .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:not(.active) > div { + color: var(--mud-palette-text-primary); + } .nav-item ::deep a i { font-size: 1.65rem; } diff --git a/Template.Shared/Components/Pages/Calendar.razor b/Template.Shared/Components/Pages/Calendar.razor index f0204f3..8fa93bc 100644 --- a/Template.Shared/Components/Pages/Calendar.razor +++ b/Template.Shared/Components/Pages/Calendar.razor @@ -350,13 +350,24 @@ if (Filter.ClearFilter) return activities; - return activities.Where(x => - (!Filter.Text.IsNullOrEmpty() && x.ActivityDescription != null && x.ActivityDescription.ContainsIgnoreCase(Filter.Text!)) && - (x.ActivityTypeId != null && !Filter.Type.IsNullOrEmpty() && x.ActivityTypeId.Equals(Filter.Type)) && - (x.ActivityResultId != null && !Filter.Result.IsNullOrEmpty() && x.ActivityResultId.Equals(Filter.Result)) && - (x.UserName != null && !Filter.User.IsNullOrEmpty() && Filter.User!.Contains(x.UserName)) && - (Filter.Category != null && x.Category.Equals(Filter.Category)) - ).ToList(); + var filteredActivity = activities.AsQueryable(); + + filteredActivity = filteredActivity + .Where(x => Filter.Text.IsNullOrEmpty() || (x.ActivityDescription != null && x.ActivityDescription.ContainsIgnoreCase(Filter.Text!))); + + filteredActivity = filteredActivity + .Where(x => Filter.Type.IsNullOrEmpty() || (x.ActivityTypeId != null && x.ActivityTypeId.Equals(Filter.Type))); + + filteredActivity = filteredActivity + .Where(x => Filter.Result.IsNullOrEmpty() || (x.ActivityResultId != null && x.ActivityResultId.Equals(Filter.Result))); + + filteredActivity = filteredActivity + .Where(x => Filter.User.IsNullOrEmpty() || (x.UserName != null && Filter.User!.Contains(x.UserName))); + + filteredActivity = filteredActivity + .Where(x => Filter.Category == null || x.Category.Equals(Filter.Category)); + + return filteredActivity.ToList(); } [JSInvokable] @@ -511,7 +522,7 @@ } private List GetEventsForDay(DateTime day) - => _eventsCache.TryGetValue(day.Date, out var events) ? events : new List(); + => _eventsCache.TryGetValue(day.Date, out var events) ? events : []; public void Dispose() { diff --git a/Template.Shared/Components/Pages/Calendar.razor.css b/Template.Shared/Components/Pages/Calendar.razor.css index b1091fc..b2b2641 100644 --- a/Template.Shared/Components/Pages/Calendar.razor.css +++ b/Template.Shared/Components/Pages/Calendar.razor.css @@ -71,12 +71,12 @@ gap: 0.2rem; } -.week-day > div:first-child { - font-size: 0.8rem; - color: var(--mud-palette-primary); - margin-bottom: 0.2rem; - font-weight: 500; -} + .week-day > div:first-child { + font-size: 0.8rem; + color: var(--mud-palette-text-primary); + margin-bottom: 0.2rem; + font-weight: 500; + } .day { background: var(--mud-palette-surface); @@ -85,13 +85,14 @@ cursor: pointer; transition: background 0.3s ease, transform 0.2s ease; font-size: 0.95rem; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: var(--custom-box-shadow); width: 38px; height: 38px; display: flex; flex-direction: column; justify-content: center; align-items: center; + color: var(--mud-palette-text-primary); border: 1px solid var(--mud-palette-surface); margin: 0 auto; } @@ -107,9 +108,9 @@ } .day.selected { - background: var(--mud-palette-secondary); - border: 1px solid var(--mud-palette-secondary); - color: white; + background: var(--mud-palette-tertiary); + border: 1px solid var(--mud-palette-tertiary); + color: var(--mud-palette-secondary); } .day.today { border: 1px solid var(--mud-palette-primary); } @@ -134,13 +135,13 @@ border-radius: 8px; padding: 0.8rem; margin-bottom: 0.5rem; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + box-shadow: var(--custom-box-shadow); } .toggle-month { background: none; border: none; - color: var(--mud-palette-primary); + color: var(--mud-palette-text-primary); font-size: 1rem; cursor: pointer; } diff --git a/Template.Shared/Components/Pages/Login.razor b/Template.Shared/Components/Pages/Login.razor index 845df71..96b768f 100644 --- a/Template.Shared/Components/Pages/Login.razor +++ b/Template.Shared/Components/Pages/Login.razor @@ -12,7 +12,7 @@ else { @@ -53,10 +54,9 @@ await OnRetry.InvokeAsync(); } - private async Task OnLogoutClick() + private async Task OnContinueClick() { - LocalStorage.Remove("last-sync"); - AuthenticationStateProvider.SignOut(); + NavigationManager.NavigateTo("/"); await OnRetry.InvokeAsync(); } } \ No newline at end of file diff --git a/Template.Shared/Components/SingleElements/Modal/ActivityForm.razor b/Template.Shared/Components/SingleElements/Modal/ActivityForm.razor index caca54b..6f3c661 100644 --- a/Template.Shared/Components/SingleElements/Modal/ActivityForm.razor +++ b/Template.Shared/Components/SingleElements/Modal/ActivityForm.razor @@ -33,7 +33,7 @@ @foreach (var com in Commesse) { - @com.Descrizione + @($"{com.CodJcom} - {com.Descrizione}") } @@ -160,6 +160,8 @@ private async Task Save() { + if (!CheckPreSave()) return; + VisibleOverlay = true; StateHasChanged(); @@ -180,6 +182,17 @@ MudDialog.Close(newActivity); } + private bool CheckPreSave() + { + Snackbar.Clear(); + Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter; + + if (!ActivityModel.ActivityTypeId.IsNullOrEmpty()) return true; + Snackbar.Add("Tipo attività obbligatorio!", Severity.Error); + + return false; + } + private async Task LoadData() { Users = await ManageData.GetTable(); @@ -187,6 +200,11 @@ Clienti = await ManageData.GetTable(x => x.FlagStato.Equals("A")); Pros = await ManageData.GetTable(); ActivityType = await ManageData.GetTable(x => x.FlagTipologia.Equals("A")); + + if (IsNew) + { + await LoadCommesse(); + } } private async Task LoadCommesse() => @@ -246,9 +264,10 @@ private void OnAfterChangeValue() { - LabelSave = !OriginalModel.Equals(ActivityModel) ? "Aggiorna" : null; - - StateHasChanged(); + if (!IsNew) + { + LabelSave = !OriginalModel.Equals(ActivityModel) ? "Aggiorna" : null; + } } private void OpenSelectEsito() diff --git a/Template.Shared/Core/Utility/UtilityString.cs b/Template.Shared/Core/Utility/UtilityString.cs index 13b3ce2..cfd385a 100644 --- a/Template.Shared/Core/Utility/UtilityString.cs +++ b/Template.Shared/Core/Utility/UtilityString.cs @@ -1,4 +1,6 @@ -namespace Template.Shared.Core.Utility; +using System.Globalization; + +namespace Template.Shared.Core.Utility; public static class UtilityString { @@ -15,6 +17,22 @@ public static class UtilityString { null => throw new ArgumentNullException(nameof(input)), "" => throw new ArgumentException($"{nameof(input)} cannot be empty", nameof(input)), - _ => input[0].ToString().ToUpper() + input.Substring(1) + _ => input[0].ToString().ToUpper() + input[1..] }; + + public static (string Upper, string Lower, string SentenceCase, string TitleCase) FormatString(string input) + { + if (string.IsNullOrWhiteSpace(input)) + return (string.Empty, string.Empty, string.Empty, string.Empty); + + var upper = input.ToUpper(); + var lower = input.ToLower(); + + var sentenceCase = char.ToUpper(lower[0]) + lower[1..]; + + var textInfo = CultureInfo.CurrentCulture.TextInfo; + var titleCase = textInfo.ToTitleCase(lower); + + return (upper, lower, sentenceCase, titleCase); + } } \ No newline at end of file diff --git a/Template.Shared/_Imports.razor b/Template.Shared/_Imports.razor index 6be6c89..10c37f4 100644 --- a/Template.Shared/_Imports.razor +++ b/Template.Shared/_Imports.razor @@ -21,3 +21,4 @@ @inject NavigationManager NavigationManager @inject IUserSession UserSession @inject ILocalStorage LocalStorage +@inject ISnackbar Snackbar diff --git a/Template.Shared/wwwroot/css/app.css b/Template.Shared/wwwroot/css/app.css index 57219df..969ce4e 100644 --- a/Template.Shared/wwwroot/css/app.css +++ b/Template.Shared/wwwroot/css/app.css @@ -97,7 +97,9 @@ h1:focus { outline: none; } color: var(--mud-palette-text-primary) !important; } -.custom_popover .mud-divider { border-color: var(--mud-palette-text-primary) !important; } + .custom_popover .mud-divider { + border-color: var(--mud-palette-text-primary) !important; + } .custom_popover .mud-list-padding { padding: 3px 0px 3px 0px !important; } diff --git a/Template.Shared/wwwroot/css/default-theme.css b/Template.Shared/wwwroot/css/default-theme.css index bd04eff..c8253c7 100644 --- a/Template.Shared/wwwroot/css/default-theme.css +++ b/Template.Shared/wwwroot/css/default-theme.css @@ -1,10 +1,10 @@ :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%); + --gray-for-shadow: hsl(from var(--mud-palette-overlay-dark)h s 40%); /*Utility*/ --card-shadow: 5px 5px 10px 0 var(--gray-for-shadow); - --custom-box-shadow: 1px 2px 5px rgba(165, 165, 165, 0.5); + --custom-box-shadow: 1px 2px 5px var(--gray-for-shadow); --mud-default-borderradius: 12px !important; --m-page-x: 1.25rem; } diff --git a/Template.Shared/wwwroot/images/salesbook-marchio_vers.positiva.svg b/Template.Shared/wwwroot/images/salesbook-marchio_vers.positiva.svg new file mode 100644 index 0000000..23cbbe4 --- /dev/null +++ b/Template.Shared/wwwroot/images/salesbook-marchio_vers.positiva.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Template.Shared/wwwroot/images/undraw_file-search_cbur.svg b/Template.Shared/wwwroot/images/undraw_file-search_cbur.svg index c7cb8da..7568f4d 100644 --- a/Template.Shared/wwwroot/images/undraw_file-search_cbur.svg +++ b/Template.Shared/wwwroot/images/undraw_file-search_cbur.svg @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + \ No newline at end of file