From b1fe7dc02e61989e540ed70e4751d377fceca323 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 20 Mar 2026 10:24:08 +0100 Subject: [PATCH] Fix comportamento apgina test x partenza vuota/piena JWD + da nascosto a mostrato --- Test.UI/Components/Pages/BaseEdit.razor.cs | 4 +- Test.UI/Components/Pages/EditJWD.razor | 30 ++++++---- Test.UI/Components/Pages/EditJWD.razor.cs | 57 +++++++++++++------ .../Components/Pages/SimpleEditOld.razor.cs | 2 +- Test.UI/Components/Pages/TestError.razor.cs | 6 +- WebWindowComplex/WebWindowComplex.csproj | 13 ++++- .../WebWindowConfigurator.csproj | 13 ++++- 7 files changed, 89 insertions(+), 36 deletions(-) diff --git a/Test.UI/Components/Pages/BaseEdit.razor.cs b/Test.UI/Components/Pages/BaseEdit.razor.cs index 878e010..3f03d14 100644 --- a/Test.UI/Components/Pages/BaseEdit.razor.cs +++ b/Test.UI/Components/Pages/BaseEdit.razor.cs @@ -296,9 +296,9 @@ namespace Test.UI.Components.Pages Random random = new Random(); CalcUid = Convert.ToString(random.Next(1000, 10000)); windowUid = CalcUid; - //InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd"); + //initialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd"); InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); - //InitialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd"); + //initialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd"); currJwd = InitialJwd; // rileggo altri dati await ReloadData(); diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index 693c30f..6a95742 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -66,20 +66,28 @@ *@ - @if(doEdit) -{ - - +@if (doEdit) +{ + + } else { - +
+
+ +
+
+ @txtEmpty + +
+
} @if (!string.IsNullOrEmpty(outClose)) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 089a306..8e4ae25 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -12,12 +12,6 @@ namespace Test.UI.Components.Pages { public partial class EditJWD : IDisposable { - #region Public Fields - - public string InitialJwd = ""; - - #endregion Public Fields - #region Public Methods public void Dispose() @@ -144,13 +138,9 @@ namespace Test.UI.Components.Pages Random random = new Random(); CalcUid = Convert.ToString(random.Next(1000, 10000)); windowUid = CalcUid; - //InitialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd"); -#if false - InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); -#else - InitialJwd = "{}"; -#endif - currJwd = InitialJwd; + //initialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd"); + //initialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); + currJwd = initialJwd; // rileggo altri dati await ReloadData(); // costruisco lista profili @@ -179,7 +169,7 @@ namespace Test.UI.Components.Pages }; CurrData = new LivePayload() { - CurrJwd = InitialJwd, + CurrJwd = currJwd, SvgPreview = currSvg, DictShape = currGroupShape, DictOptionsXml = currHwOption @@ -419,6 +409,8 @@ namespace Test.UI.Components.Pages {"Frame_Rail_Bottom_DimMax", 80} }; + private bool startEmpty = true; + private List ThresholdProfilo78 = new List() { { new Threshold(3, "Bottom") }, @@ -436,6 +428,26 @@ namespace Test.UI.Components.Pages #endregion Private Fields + #region Private Properties + + private string initialJwd + { + get + { + if (startEmpty) + { + return "{}"; + } + else + { + return File.ReadAllText("Data\\AntaDoppiaInglesine.jwd"); + //return File.ReadAllText("Data\\AntaDoppia.jwd"); + } + } + } + + #endregion Private Properties + #region Private Methods /// @@ -444,9 +456,10 @@ namespace Test.UI.Components.Pages /// private void CloseObj(DataSave reqSave) { - currJwd = reqSave.currJwd; - outClose = !reqSave.ForceSave ? "Richiesto chiusura!" : ""; - outSave = reqSave.ForceSave ? "Richiesto salvataggio!" : ""; + currJwd = reqSave.ForceSave ? reqSave.currJwd : initialJwd; + outClose = !reqSave.ForceSave ? "Richiesto Close!" : ""; + outSave = reqSave.ForceSave ? "Richiesto Close + Save!" : ""; + doEdit = false; } private void ConfInit() @@ -625,6 +638,16 @@ namespace Test.UI.Components.Pages doEdit = true; } + private Task ToggleJwd() + { + startEmpty = !startEmpty; + currJwd = initialJwd; + currSvg = ""; + CurrData.CurrJwd = currJwd; + CurrData.SvgPreview = currSvg; + return InvokeAsync(StateHasChanged); + } + private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile) { var newJwd = SerialMan.MassUpdate(currSer, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile); diff --git a/Test.UI/Components/Pages/SimpleEditOld.razor.cs b/Test.UI/Components/Pages/SimpleEditOld.razor.cs index 292c672..b0d1169 100644 --- a/Test.UI/Components/Pages/SimpleEditOld.razor.cs +++ b/Test.UI/Components/Pages/SimpleEditOld.razor.cs @@ -133,7 +133,7 @@ namespace Test.UI.Components.Pages CalcUid = Convert.ToString(random.Next(1000, 10000)); windowUid = CalcUid; InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd"); - //InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); + //initialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); currJwd = InitialJwd; // rileggo altri dati await ReloadData(); diff --git a/Test.UI/Components/Pages/TestError.razor.cs b/Test.UI/Components/Pages/TestError.razor.cs index 4eb0b6e..a458773 100644 --- a/Test.UI/Components/Pages/TestError.razor.cs +++ b/Test.UI/Components/Pages/TestError.razor.cs @@ -335,7 +335,7 @@ namespace Test.UI.Components.Pages Random random = new Random(); CalcUid = Convert.ToString(random.Next(1000, 10000)); windowUid = CalcUid; - //InitialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd"); + //initialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd"); InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); currJwd = InitialJwd; // rileggo altri dati @@ -611,8 +611,8 @@ namespace Test.UI.Components.Pages } private Task RemoveJwd() { - //InitialJwd = "{}"; - //currJwd = InitialJwd; + //initialJwd = "{}"; + //currJwd = initialJwd; CurrData.CurrJwd = "{}"; // rileggo altri dati return ReloadData(); diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 6e7997c..35f67f3 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.2009 + 3.1.3.2010 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -43,6 +43,17 @@ + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 626c441..e3899b2 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.2009 + 3.1.3.2010 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -45,6 +45,17 @@ + + + + + + + + + + +