diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.Admin/Components/Pages/Clusters/ClusterDetail.razor b/src/Server/ZB.MOM.WW.OtOpcUa.Admin/Components/Pages/Clusters/ClusterDetail.razor index 87f6e26..4bd5120 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.Admin/Components/Pages/Clusters/ClusterDetail.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.Admin/Components/Pages/Clusters/ClusterDetail.razor @@ -101,29 +101,44 @@ else { } - else if (_tab == "equipment" && _currentDraft is not null) + else if (_tab is "equipment" or "uns" or "namespaces" or "drivers" or "tags" or "acls") { - - } - else if (_tab == "uns" && _currentDraft is not null) - { - - } - else if (_tab == "namespaces" && _currentDraft is not null) - { - - } - else if (_tab == "drivers" && _currentDraft is not null) - { - - } - else if (_tab == "tags" && _currentDraft is not null) - { - - } - else if (_tab == "acls" && _currentDraft is not null) - { - + @* Bug #10 fix — these six tabs are scoped to a generation. Per docs/v2/admin-ui.md the + design intent is a read-only view of the published generation when no draft is open + ("Edit in draft" affordance), and the editable view of the draft when one is open. + The earlier implementation rendered nothing in the no-draft case, leaving operators + with just the "Open a draft to edit" placeholder. We now route both states through + the same tab components, gating edits via
so a button click in + the read-only state cannot silently mutate the published rows even though the tab + components themselves haven't been refactored to honor an IsReadOnly flag yet. *@ + var genId = _currentDraft?.GenerationId ?? _currentPublished?.GenerationId; + var isReadOnly = _currentDraft is null; + if (genId is null) + { +
+ No published generation yet. Click New draft above to author this cluster's first generation. +
+ } + else + { + if (isReadOnly) + { +
+ Read-only view of published generation @genId. Click New draft above to make changes. +
+ } +
+ @switch (_tab) + { + case "equipment": break; + case "uns": break; + case "namespaces": break; + case "drivers": break; + case "tags": break; + case "acls": break; + } +
+ } } else if (_tab == "redundancy") { @@ -133,10 +148,6 @@ else { } - else - { -
Open a draft to edit this cluster's content.
- } } @code {