feat(ui): warn on bare ns= node bindings in the browse picker (v3 cutover #14)

This commit is contained in:
Joseph Doherty
2026-07-23 15:18:36 -04:00
parent 97afa84fcd
commit e04c2617cc
@@ -1,6 +1,7 @@
@using Microsoft.AspNetCore.Components.Web
@using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol
@using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management
@using ZB.MOM.WW.ScadaBridge.Commons.Types.DataConnections
@using ZB.MOM.WW.ScadaBridge.CentralUI.Services
@inject IBrowseService BrowseService
@@ -89,9 +90,17 @@
<div class="input-group">
<span class="input-group-text">Manual node id:</span>
<input class="form-control" @bind="_manualNodeId" placeholder="ns=2;s=..." />
<input class="form-control" @bind="_manualNodeId" @bind:event="oninput" placeholder="nsu=&lt;namespace-uri&gt;;s=..." />
<button class="btn btn-outline-secondary" @onclick="UseManual" disabled="@string.IsNullOrWhiteSpace(_manualNodeId)">Use</button>
</div>
@if (!OpcUaReferenceForm.IsDurable(_manualNodeId))
{
<small class="text-warning-emphasis d-block mt-1" data-test="ns-index-warning">
This is a bare namespace-<em>index</em> binding. Indexes can silently re-point after a
server namespace change — prefer selecting from the tree above (it stores the durable
<code>nsu=&lt;uri&gt;;…</code> form).
</small>
}
</div>
<div class="modal-footer">
<span class="me-auto text-muted">Selected: <code>@(_selectedNodeId ?? "(none)")</code></span>