fix(adminui): preserve historize on Galaxy re-pick + clear stale script-create error (review)

This commit is contained in:
Joseph Doherty
2026-06-16 17:03:38 -04:00
parent 069a5f3165
commit 68f9eef62d
2 changed files with 8 additions and 1 deletions
@@ -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<string, object> BuildEditorParameters() => new Dictionary<string, object>
@@ -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