refactor(uns): modal-polish nits on the global UNS page (task #137)

Low-severity review nits, no behaviour change to the happy path:
- CloseModals() now also resets the leftover _*ModalIsNew / parent-id fields
  (area ClusterId, line AreaId, equipment LineId, tag/vtag) for symmetry —
  harmless today (always set before a modal opens) but consistent.
- HandleAddChild / HandleAddVirtualTag / HandleEdit gain a _modalBusy guard
  (try/finally) so a rapid double-action can't race two service loads into the
  same modal state. The switch bodies are re-indented under the try block.
- VirtualTagModal DataType is now an InputSelect over the standard OPC UA type
  list (the same set TagModal uses) instead of free-text InputText.
- RefreshEquipmentChildrenAsync documents that callers own StateHasChanged()
  and the full-reload fallback is spelled out as a block with a comment.

Build clean; AdminUI.Tests 216/216.
This commit is contained in:
Joseph Doherty
2026-06-09 08:18:15 -04:00
parent f19f2ee73b
commit b87d877270
2 changed files with 147 additions and 93 deletions
@@ -38,8 +38,12 @@
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label" for="vtag-dtype">DataType</label>
<InputText id="vtag-dtype" @bind-Value="_form.DataType" class="form-control form-control-sm mono"
placeholder="Double" />
<InputSelect id="vtag-dtype" @bind-Value="_form.DataType" class="form-select form-select-sm">
@foreach (var dt in DataTypes)
{
<option value="@dt">@dt</option>
}
</InputSelect>
</div>
<div class="col-md-6 mb-3">
<label class="form-label" for="vtag-script">Script</label>
@@ -101,6 +105,11 @@
}
@code {
/// <summary>The OPC UA data types offered for a virtual tag — the same set the TagModal uses.</summary>
private static readonly string[] DataTypes =
["Boolean", "SByte", "Byte", "Int16", "UInt16", "Int32", "UInt32",
"Int64", "UInt64", "Float", "Double", "String", "DateTime", "Guid", "ByteString"];
/// <summary>Whether the modal is shown. The host owns this flag.</summary>
[Parameter] public bool Visible { get; set; }