From 68f9eef62d346f13e032e9055838f63d395efa3b Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 16 Jun 2026 17:03:38 -0400 Subject: [PATCH] fix(adminui): preserve historize on Galaxy re-pick + clear stale script-create error (review) --- .../Components/Shared/Uns/TagModal.razor | 8 +++++++- .../Components/Shared/Uns/VirtualTagModal.razor | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor index 27e2bac8..b433f723 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor @@ -298,10 +298,16 @@ private void OnGalaxyAddressPicked(string address) { _galaxyAddress = address; - var config = JsonSerializer.Serialize(new { FullName = address }); + // A fresh {FullName} blob would drop any tag-level historize the operator already set on this + // edit; re-merge it so re-picking a Galaxy address never silently clears "Historize this tag". + var config = TagHistorizeConfig.Set( + JsonSerializer.Serialize(new { FullName = address }), + _historizeState.IsHistorized, + _historizeState.HistorianTagname); _form.TagConfig = _galaxyPickedIsAlarm ? NativeAlarmModel.SeedDefaultAlarm(config) : config; + _historizeState = TagHistorizeConfig.Read(_form.TagConfig); } private IDictionary BuildEditorParameters() => new Dictionary diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor index 395e2c61..8c6d5df6 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor @@ -260,6 +260,7 @@ }; } _error = null; + _scriptCreateError = null; _scriptExpanded = false; // Load the bound script's source for the inline panel when editing an existing tag that