From a08b8d4eb5699916df1c5343fbbf14ccbc473d6d Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Thu, 6 Nov 2025 15:06:43 +0100 Subject: [PATCH] Eliminato template da WebWindowComplex --- Test.UI/Components/Pages/EditJWD.razor.cs | 42 +-------- Test.UI/Components/Pages/Gerarchia.razor | 4 +- Test.UI/Components/Pages/Gerarchia.razor.cs | 33 ------- WebWindowComplex/Compo/AreaHwOption.razor.cs | 9 +- WebWindowComplex/Compo/AreaSash.razor | 12 --- WebWindowComplex/Compo/CardSashGroup.razor | 1 + WebWindowComplex/Compo/CardSashGroup.razor.cs | 3 + WebWindowComplex/Compo/General.razor | 8 +- WebWindowComplex/DTO/BaseListPayload.cs | 7 +- WebWindowComplex/DTO/SelectPayload.cs | 8 +- WebWindowComplex/DTO/TemplateSelectorDTO.cs | 17 ---- WebWindowComplex/LayoutConst.cs | 5 +- WebWindowComplex/Models/SashDimension.cs | 4 - WebWindowComplex/TableComp.razor | 87 ++++--------------- WebWindowComplex/TableComp.razor.cs | 71 ++------------- WebWindowComplex/Template.cs | 48 ---------- WebWindowComplex/WebWindowComplex.csproj | 14 ++- .../WebWindowConfigurator.csproj | 3 +- 18 files changed, 59 insertions(+), 317 deletions(-) delete mode 100644 WebWindowComplex/DTO/TemplateSelectorDTO.cs delete mode 100644 WebWindowComplex/Template.cs diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index e9d09db..d8a7c98 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -20,12 +20,6 @@ namespace Test.UI.Components.Pages #endregion Public Fields - #region Public Properties - - public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", ""); - - #endregion Public Properties - #region Public Methods public void Dispose() @@ -97,8 +91,6 @@ namespace Test.UI.Components.Pages new string("Profilo90") }; - protected List AvailTemplateList { get; set; } = new List(); - [Inject] protected IConfiguration Config { get; set; } = null!; @@ -147,8 +139,7 @@ namespace Test.UI.Components.Pages Glass = AvailGlassList, Hardware = AvailHardwareList, Material = AvailMaterialList, - Profile = AvailProfileList, - TemplateDTO = null + Profile = AvailProfileList }; CurrData = new LivePayload() { @@ -178,8 +169,6 @@ namespace Test.UI.Components.Pages private string colorMassUpdate; - private TemplateSelectDTO? currSel = null; - private string currSvg = ""; private string familyHWMassUpdate; @@ -352,24 +341,7 @@ namespace Test.UI.Components.Pages private async Task ReloadData() { //return base.OnInitializedAsync(); - AvailTemplateList = new List(); AvailHardwareList = new List(); - // brutale, da rivedere... - if (string.IsNullOrEmpty(InitialJwd)) - { - if (File.Exists(cFileTemplate)) - { - string rawVal = File.ReadAllText(cFileTemplate); - var rawList = JsonConvert.DeserializeObject>(rawVal) ?? new List(); - - // calcolo URL immagini... DTO interno da rivedere? - foreach (var item in rawList) - { - item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName); - AvailTemplateList.Add(item); - } - } - } if (File.Exists(cFileHardware)) { string rawValHW = File.ReadAllText(cFileHardware); @@ -382,18 +354,6 @@ namespace Test.UI.Components.Pages await Task.Delay(100); } - private void SetTemplate(TemplateSelectDTO selTemp) - { - string rawVal = ""; - currSel = selTemp; - // brutale,d a rivedere... - if (File.Exists(selTemp.JwdFileName)) - { - rawVal = File.ReadAllText(selTemp.JwdFileName); - } - SelTemplate = new Template(selTemp.Index, selTemp.Description, selTemp.SVGFileName, rawVal); - } - 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/Gerarchia.razor b/Test.UI/Components/Pages/Gerarchia.razor index 6501d4c..4ff140c 100644 --- a/Test.UI/Components/Pages/Gerarchia.razor +++ b/Test.UI/Components/Pages/Gerarchia.razor @@ -3,9 +3,7 @@ Gerarchia - AvailTemplateList { get; set; } = new List(); protected List AvailHardwareList { get; set; } = new List(); protected List AvailFamilyHardwareList { get; set; } = new List() { @@ -109,7 +106,6 @@ namespace Test.UI.Components.Pages private string CalcUid = "CurrWindow"; private string cFileTemplate = "Data/Setup.json"; private string cFileHardware = "Hardware/Setup.json"; - private TemplateSelectDTO? currSel = null; private string currSvg = ""; private string imgBasePath = ""; @@ -155,24 +151,7 @@ namespace Test.UI.Components.Pages private async Task ReloadData() { //return base.OnInitializedAsync(); - AvailTemplateList = new List(); AvailHardwareList = new List(); - // brutale, da rivedere... - if (string.IsNullOrEmpty(InitialJwd)) - { - if (File.Exists(cFileTemplate)) - { - string rawVal = File.ReadAllText(cFileTemplate); - var rawList = JsonConvert.DeserializeObject>(rawVal) ?? new List(); - - // calcolo URL immagini... DTO interno da rivedere? - foreach (var item in rawList) - { - item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName); - AvailTemplateList.Add(item); - } - } - } if (File.Exists(cFileHardware)) { string rawValHW = File.ReadAllText(cFileHardware); @@ -198,18 +177,6 @@ namespace Test.UI.Components.Pages } } - private void SetTemplate(TemplateSelectDTO selTemp) - { - string rawVal = ""; - currSel = selTemp; - // brutale,d a rivedere... - if (File.Exists(selTemp.JwdFileName)) - { - rawVal = File.ReadAllText(selTemp.JwdFileName); - } - SelTemplate = new Template(selTemp.Index, selTemp.Description, selTemp.SVGFileName, rawVal); - } - #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/Compo/AreaHwOption.razor.cs b/WebWindowComplex/Compo/AreaHwOption.razor.cs index f109208..cf626ef 100644 --- a/WebWindowComplex/Compo/AreaHwOption.razor.cs +++ b/WebWindowComplex/Compo/AreaHwOption.razor.cs @@ -31,17 +31,18 @@ namespace WebWindowComplex.Compo /// [Parameter] public EventCallback EC_FirstHwOptionList { get; set; } - - private bool isLoadingHwOpt { get; set; } - private bool hwOptCollapsed { get; set; } + [Parameter] + public bool isLoadingHwOpt { get; set; } = false; + + private bool hwOptCollapsed { get; set; } = true; private async Task changeCollapsed() { hwOptCollapsed = !hwOptCollapsed; if(CurrSash.HwOptionList.Count == 0) { - isLoadingHwOpt = true; + //isLoadingHwOpt = true; await EC_FirstHwOptionList.InvokeAsync(CurrSash.GroupId); } } diff --git a/WebWindowComplex/Compo/AreaSash.razor b/WebWindowComplex/Compo/AreaSash.razor index ed32baf..b83fde3 100644 --- a/WebWindowComplex/Compo/AreaSash.razor +++ b/WebWindowComplex/Compo/AreaSash.razor @@ -9,18 +9,6 @@ { } - @* - - - - - - - - - - - *@
diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index 8d3124b..1cc4b90 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -92,6 +92,7 @@
diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 534b447..9df8d18 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -80,6 +80,9 @@ namespace WebWindowComplex.Compo [Parameter] public List SashList { get; set; } = null!; + [Parameter] + public bool isLoadingHwOpt { get; set; } = false; + #endregion Public Properties #region Protected Properties diff --git a/WebWindowComplex/Compo/General.razor b/WebWindowComplex/Compo/General.razor index fb2306d..5150c30 100644 --- a/WebWindowComplex/Compo/General.razor +++ b/WebWindowComplex/Compo/General.razor @@ -12,7 +12,7 @@
-
+
diff --git a/WebWindowComplex/DTO/BaseListPayload.cs b/WebWindowComplex/DTO/BaseListPayload.cs index 7690641..4285bcb 100644 --- a/WebWindowComplex/DTO/BaseListPayload.cs +++ b/WebWindowComplex/DTO/BaseListPayload.cs @@ -13,12 +13,7 @@ namespace WebWindowComplex.DTO /// Payload complessivo delle anagrafiche necessarie x Window /// public class BaseListPayload - { - /// - /// Elenco template in formato DTO - /// - public List? TemplateDTO { get; set; } = null; - + { /// /// Elenco Famiglie HW in formato DTO /// diff --git a/WebWindowComplex/DTO/SelectPayload.cs b/WebWindowComplex/DTO/SelectPayload.cs index 4ed2efe..f297485 100644 --- a/WebWindowComplex/DTO/SelectPayload.cs +++ b/WebWindowComplex/DTO/SelectPayload.cs @@ -39,11 +39,6 @@ namespace WebWindowComplex.DTO /// public string Profile { get; set; } = string.Empty; - /// - /// Template selezionato - /// - public Template Template { get; set; } = null!; - /// /// Verifica di validità dell'intero Payload /// @@ -55,8 +50,7 @@ namespace WebWindowComplex.DTO bool glassOk = !string.IsNullOrEmpty(Glass); bool matOK = !string.IsNullOrEmpty(Material); bool profileOK = !string.IsNullOrEmpty(Profile); - bool templateOK = Template != null; - return famHwOK && colorOK && matOK && glassOk && templateOK && profileOK; + return famHwOK && colorOK && matOK && glassOk && profileOK; } } } diff --git a/WebWindowComplex/DTO/TemplateSelectorDTO.cs b/WebWindowComplex/DTO/TemplateSelectorDTO.cs deleted file mode 100644 index 4b145e5..0000000 --- a/WebWindowComplex/DTO/TemplateSelectorDTO.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WebWindowComplex.DTO -{ - public class TemplateSelectDTO - { - public int Index { get; set; } = 0; - public string Description { get; set; } = ""; - public string JwdFileName { get; set; } = ""; - public string SVGFileName { get; set; } = ""; - public string ImageUrl { get; set; } = ""; - } -} diff --git a/WebWindowComplex/LayoutConst.cs b/WebWindowComplex/LayoutConst.cs index 0f70a90..28b2951 100644 --- a/WebWindowComplex/LayoutConst.cs +++ b/WebWindowComplex/LayoutConst.cs @@ -10,9 +10,8 @@ namespace WebWindowComplex { public enum CompileStep { - Template = 0, - Tree = 1, - Frame, + Tree = 0, + Frame = 1, Split, Sash, Fill, diff --git a/WebWindowComplex/Models/SashDimension.cs b/WebWindowComplex/Models/SashDimension.cs index c03399f..4ed2591 100644 --- a/WebWindowComplex/Models/SashDimension.cs +++ b/WebWindowComplex/Models/SashDimension.cs @@ -174,12 +174,8 @@ namespace WebWindowComplex.Models dRes += RelativeDimList[Ind].dDimension; } - //for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - // dRes += RelativeDimList[Ind].dDimension; dRes = (100 - dRes); RelativeDimList[nIndex - 1].SetDimension(dRes); - //for (var nInd = 0; nInd <= nIndex - 1; nInd++) - // RelativeDimList[nInd].SetDimension(dRes); } else { diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 5402f66..bf75163 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -37,83 +37,34 @@ } else { -
+
-
-
+
+
-
-
- @if (currStep != CompileStep.Template) - { - - } +
+
+
-
+
-
+
- @if (string.IsNullOrEmpty(LiveData.CurrJwd)) - { - @if (currStep == CompileStep.Template && ListPayload.TemplateDTO != null) - { - - - - - - - - - - @foreach (var item in ListPayload.TemplateDTO) - { - string colorClass = ""; - @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) - colorClass = "table-success"; - else - colorClass = ""; - - - - - - } - -
#ImageDescription
@item.Index@item.Description
- } - } @if (currStep == CompileStep.Tree) {
- @if (currStep != CompileStep.Template) - { -
- @outSvg -
- } +
+ @outSvg +
if (listWarnings != null && listWarnings.Count > 0) {
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 94f2018..32dea75 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -84,12 +84,6 @@ namespace WebWindowComplex [Parameter] public EventCallback EC_OnClose { get; set; } - /// - /// Evento selezione template - /// - [Parameter] - public EventCallback EC_OnSelectedTemplate { get; set; } - /// /// Sollevo evento errore validazione con una lista di errori rilevati /// @@ -175,7 +169,6 @@ namespace WebWindowComplex protected string SelGlass { get; set; } = ""; protected string SelMaterial { get; set; } = ""!; protected string SelProfile { get; set; } = ""; - protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null; protected List SplitList { @@ -509,6 +502,7 @@ namespace WebWindowComplex { if (m_CurrWindow != null) { + isLoadingHwOpt = true; #if DEBUG var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); #else @@ -580,17 +574,6 @@ namespace WebWindowComplex await EC_OnClose.InvokeAsync(true); } - /// - /// Selezione del template - /// - /// template selezionato - protected async void DoSelect(TemplateSelectDTO newSel) - { - editLock = false; - SelTemplateDTO = newSel; - await EC_OnSelectedTemplate.InvokeAsync(newSel); - } - protected override void OnAfterRender(bool firstRender) { isRendered = true; @@ -738,6 +721,9 @@ namespace WebWindowComplex UpdateDict(); } + /// + /// Aggiornamento dei dati con informazioni ricevute dai dizionari + /// protected void UpdateDict() { // se ho i dizionari delle forme le aggiungo @@ -816,6 +802,8 @@ namespace WebWindowComplex private bool isRendered = false; + private bool isLoadingHwOpt = false; + /// /// ELenco errori di coerenza/link dati (vanno risolti per disegnare/procedere) /// @@ -857,8 +845,6 @@ namespace WebWindowComplex private string m_SelFamilyHardware { get; set; } = ""; - private Template m_SelTemplate { get; set; } = null!; - /// /// Salvataggio JWD precedente x evitare loop su update (aggiornato dopo chiamate redis) /// @@ -925,27 +911,6 @@ namespace WebWindowComplex currSplit = -1; } - /// - /// Calcola larghezza colonna button nav - /// - /// - private string buttonCss() - { - return (currStep == CompileStep.Template) ? "col-4 d-grid gap-1 d-md-flex justify-content-md-end align-items-center" : "col-4 d-grid gap-1 d-md-flex justify-content-md-end align-items-center"; - } - - /// - /// Calcola bottone selezionato per il Fill - /// - /// - private string buttonFillCss(FillTypes currFillTypes) - { - if (FillList.ElementAt(currFill).SelFillType == currFillTypes) - return "btn btn-secondary btn-sm"; - else - return "btn btn-outline-secondary btn-sm"; - } - /// /// Prima chiamata alle opzioni hardware /// @@ -1119,6 +1084,7 @@ namespace WebWindowComplex private void M_CurrWindow_OnHwOption(object? sender, OnReqHwOptEventArgs e) { + isLoadingHwOpt = true; Dictionary Args = new Dictionary(); Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}"); Args.Add("SubMode", $"{(int)Enums.QuestionHwSubModes.HARDWAREOPTIONS}"); @@ -1147,15 +1113,6 @@ namespace WebWindowComplex _ = EC_DoUpdate.InvokeAsync(Args); } - /// - /// Calcola larghezza colonna contenente nav da mostrare - /// - /// - private string mainCss() - { - return (currStep == CompileStep.Template) ? "col-12 d-flex flex-column" : "col-6 d-flex flex-column"; - } - /// /// Metodo per cambiare step /// @@ -1412,20 +1369,6 @@ namespace WebWindowComplex } } - /// - /// Aggiornamento shape dato GroupId - /// - /// nuova sash - /// - private async Task UpdateShape(int groupId) - { - List reqList = new List() { groupId }; - await DoReqShape(reqList); -#if false - await DoReqShape(groupId); -#endif - } - #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/Template.cs b/WebWindowComplex/Template.cs deleted file mode 100644 index 82ba361..0000000 --- a/WebWindowComplex/Template.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WebWindowComplex -{ - public class Template - { - private int m_nIndex; - public int nIndex - { - get - { - return m_nIndex; - } - } - - public string sDescription { get; set; } = ""; - - private string m_JWD; - public string JWD - { - get - { - return m_JWD; - } - } - - private string m_SVG; - public string SVG - { - get - { - return m_SVG; - } - } - - public Template(int nIndex, string sDescription, string SVG, string JWD) - { - m_nIndex = nIndex; - this.sDescription = sDescription; - m_SVG = SVG; - m_JWD = JWD; - } - } -} diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 6ce36b7..b9efbb8 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.610 + 2.7.11.614 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -290,6 +290,18 @@ + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 8cd7f22..8e7d551 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.610 + 2.7.11.614 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -414,5 +414,6 @@ +