feat(adminui): UNS-tree delete for Cluster + Enterprise (refuse-if-children, no rowversion)

This commit is contained in:
Joseph Doherty
2026-06-16 16:35:07 -04:00
parent 6a8020e7e7
commit 526eebb3bb
5 changed files with 349 additions and 3 deletions
@@ -19,7 +19,7 @@
/// <summary>Raised when the user edits a node (Area/Line).</summary>
[Parameter] public EventCallback<UnsNode> OnEdit { get; set; }
/// <summary>Raised when the user deletes a node (Area/Line/Equipment/Tag/VirtualTag).</summary>
/// <summary>Raised when the user deletes a node (Enterprise/Cluster/Area/Line/Equipment/Tag/VirtualTag).</summary>
[Parameter] public EventCallback<UnsNode> OnDelete { get; set; }
/// <summary>Raised when the user toggles a node's expansion; the host owns the resulting state + lazy load.</summary>
@@ -86,13 +86,17 @@
switch (node.Kind)
{
case UnsNodeKind.Enterprise:
// No actions on the enterprise root.
// Deletes every cluster carrying this enterprise label (refuse-if-children).
<button type="button" class="btn btn-sm btn-link p-0 ms-2 text-danger"
@onclick="@(() => OnDelete.InvokeAsync(node))">Delete</button>
break;
case UnsNodeKind.Cluster:
<button type="button" class="btn btn-sm btn-link p-0 ms-2"
@onclick="@(() => OnAddChild.InvokeAsync(node))">+ Area</button>
<a class="btn btn-sm btn-link p-0 ms-2" href="@($"/clusters/{node.ClusterId}")">⚙ settings</a>
<button type="button" class="btn btn-sm btn-link p-0 ms-2 text-danger"
@onclick="@(() => OnDelete.InvokeAsync(node))">Delete</button>
break;
case UnsNodeKind.Area: