From 1294fb6ee53d459a899173db396ff75a2e6fa3d4 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 11 Jun 2026 14:49:23 -0400 Subject: [PATCH] fix(uns): surface stale-row edits + dismiss modal on delete + @key rows (code-review) --- .../Components/Pages/Uns/EquipmentPage.razor | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Uns/EquipmentPage.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Uns/EquipmentPage.razor index 75c7dd69..d25cd9c1 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Uns/EquipmentPage.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Pages/Uns/EquipmentPage.razor @@ -162,7 +162,7 @@ else @foreach (var t in _tags) { - + @t.Name @t.DriverInstanceId @t.DataType @@ -207,7 +207,7 @@ else @foreach (var v in _vtags) { - + @v.Name @v.DataType @v.ScriptId @@ -289,6 +289,7 @@ else private async Task OpenAddTag() { + _tagError = null; _tagModalIsNew = true; _tagModalExisting = null; _tagDriverOptions = await Svc.LoadTagDriversForEquipmentAsync(EquipmentId!); @@ -297,8 +298,9 @@ else private async Task OpenEditTag(string tagId) { + _tagError = null; var dto = await Svc.LoadTagAsync(tagId); - if (dto is null) { return; } + if (dto is null) { _tagError = "That tag no longer exists; the list was refreshed."; await ReloadTagsAsync(); return; } _tagModalIsNew = false; _tagModalExisting = dto; _tagDriverOptions = await Svc.LoadTagDriversForEquipmentAsync(EquipmentId!); @@ -313,6 +315,7 @@ else private async Task DeleteTag(string tagId) { + _tagModalVisible = false; _tagError = null; // Load the tag fresh to capture its current RowVersion for the optimistic-concurrency delete. var dto = await Svc.LoadTagAsync(tagId); @@ -331,6 +334,7 @@ else private async Task OpenAddVirtualTag() { + _vtagError = null; _vtagModalIsNew = true; _vtagModalExisting = null; _vtagScriptOptions = await Svc.LoadScriptsAsync(); @@ -339,8 +343,9 @@ else private async Task OpenEditVirtualTag(string vtagId) { + _vtagError = null; var dto = await Svc.LoadVirtualTagAsync(vtagId); - if (dto is null) { return; } + if (dto is null) { _vtagError = "That virtual tag no longer exists; the list was refreshed."; await ReloadVirtualTagsAsync(); return; } _vtagModalIsNew = false; _vtagModalExisting = dto; _vtagScriptOptions = await Svc.LoadScriptsAsync(); @@ -355,6 +360,7 @@ else private async Task DeleteVirtualTag(string vtagId) { + _vtagModalVisible = false; _vtagError = null; // Load the virtual tag fresh to capture its current RowVersion for the concurrency-guarded delete. var dto = await Svc.LoadVirtualTagAsync(vtagId);