refactor(browse): rename OPC-UA browse service + dialog to protocol-agnostic

IOpcUaBrowseService/OpcUaBrowseService -> IBrowseService/BrowseService,
OpcUaBrowserDialog -> NodeBrowserDialog, and neutralize 'Browse OPC UA' UI
strings to 'Browse'. Updates DI, InstanceConfigure, TestBindingsDialog, TreeRow,
BindingTester, and tests. 574 CentralUI tests green.
This commit is contained in:
Joseph Doherty
2026-05-29 07:59:56 -04:00
parent 5461e4968e
commit cb0d17dabd
10 changed files with 20 additions and 20 deletions
@@ -1,7 +1,7 @@
@using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol
@using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management
@using ZB.MOM.WW.ScadaBridge.CentralUI.Services
@inject IOpcUaBrowseService BrowseService
@inject IBrowseService BrowseService
@if (_isVisible)
{
@@ -9,7 +9,7 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Browse OPC UA — @ConnectionName</h5>
<h5 class="modal-title">Browse — @ConnectionName</h5>
<button type="button" class="btn-close" @onclick="Cancel"></button>
</div>
<div class="modal-body">
@@ -143,7 +143,7 @@
/// <summary>
/// Opens the dialog and triggers an immediate one-shot read. Method-arg
/// pattern (mirroring <c>OpcUaBrowserDialog.ShowAsync</c>) — Razor
/// pattern (mirroring <c>NodeBrowserDialog.ShowAsync</c>) — Razor
/// parameter binding would propagate on the next render and race the
/// LoadAsync below.
/// </summary>
@@ -46,8 +46,8 @@
</li>
@code {
[Parameter] public OpcUaBrowserDialog.TreeNode Node { get; set; } = default!;
[Parameter] public EventCallback<OpcUaBrowserDialog.TreeNode> OnToggle { get; set; }
[Parameter] public EventCallback<OpcUaBrowserDialog.TreeNode> OnSelect { get; set; }
[Parameter] public NodeBrowserDialog.TreeNode Node { get; set; } = default!;
[Parameter] public EventCallback<NodeBrowserDialog.TreeNode> OnToggle { get; set; }
[Parameter] public EventCallback<NodeBrowserDialog.TreeNode> OnSelect { get; set; }
[Parameter] public string? SelectedNodeId { get; set; }
}
@@ -144,7 +144,7 @@
{
<button class="btn btn-sm btn-outline-primary"
disabled="@(!canBrowse)"
title="@(canBrowse ? "Browse OPC UA address space" : "Pick a connection first")"
title="@(canBrowse ? "Browse address space" : "Pick a connection first")"
@onclick="() => OpenBrowser(attr.Name)">
Browse…
</button>
@@ -367,7 +367,7 @@
@* OPC UA Tag Browser dialog (Task 18) — rendered once; OpenBrowser
tracks which binding row's override input receives the picked node id. *@
<OpcUaBrowserDialog @ref="_browserRef"
<NodeBrowserDialog @ref="_browserRef"
SiteId="@_browserSiteIdentifier"
ConnectionName="@_browserConnectionName"
InitialNodeId="@_browserInitial"
@@ -375,7 +375,7 @@
@* Test Bindings dialog — one-shot live read of every bound attribute.
Method-arg ShowAsync(siteId, rows) — no Razor parameter propagation
race (same pattern as OpcUaBrowserDialog). *@
race (same pattern as NodeBrowserDialog). *@
<TestBindingsDialog @ref="_testBindingsRef" />
}
</div>
@@ -407,7 +407,7 @@
// OPC UA tag browser (Task 18) — single dialog rendered at page bottom;
// _browserAttrInEdit tracks which row gets the picked node id on Select.
private OpcUaBrowserDialog? _browserRef;
private NodeBrowserDialog? _browserRef;
private string? _browserAttrInEdit;
private string _browserSiteIdentifier = "";
private string _browserConnectionName = "";
@@ -53,7 +53,7 @@ public static class ServiceCollectionExtensions
// OPC UA Tag Browser (Task 14): facade over CommunicationService.BrowseNodeAsync
// that enforces the CentralUI-side Design-role trust boundary and translates
// transport failures into typed BrowseFailure results for the dialog.
services.AddScoped<IOpcUaBrowseService, OpcUaBrowseService>();
services.AddScoped<IBrowseService, BrowseService>();
// Test Bindings: facade over CommunicationService.ReadTagValuesAsync —
// same Design-role guard + typed-failure translation as the browse
@@ -10,7 +10,7 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
/// <see cref="CommunicationService.ReadTagValuesAsync"/> that enforces the
/// CentralUI-side <c>Design</c>-role trust boundary and translates transport
/// exceptions into a typed <see cref="ReadTagValuesFailure"/> result. Mirrors
/// <see cref="OpcUaBrowseService"/>.
/// <see cref="BrowseService"/>.
/// </summary>
public sealed class BindingTester : IBindingTester
{
@@ -7,7 +7,7 @@ using ZB.MOM.WW.ScadaBridge.Security;
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
/// <summary>
/// Default <see cref="IOpcUaBrowseService"/> implementation — a thin facade over
/// Default <see cref="IBrowseService"/> implementation — a thin facade over
/// <see cref="CommunicationService.BrowseNodeAsync"/> that enforces the
/// CentralUI-side <c>Design</c>-role trust boundary and translates transport
/// exceptions into a typed <see cref="BrowseFailure"/> result.
@@ -19,17 +19,17 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
/// <c>ServerError</c> so the dialog can show an inline banner while leaving the
/// manual node-id paste field usable.
/// </remarks>
public sealed class OpcUaBrowseService : IOpcUaBrowseService
public sealed class BrowseService : IBrowseService
{
private readonly CommunicationService _communication;
private readonly AuthenticationStateProvider _auth;
/// <summary>
/// Initializes a new instance of the <see cref="OpcUaBrowseService"/>.
/// Initializes a new instance of the <see cref="BrowseService"/>.
/// </summary>
/// <param name="communication">Central-side cluster communication service.</param>
/// <param name="auth">Authentication state provider used for the Design-role guard.</param>
public OpcUaBrowseService(CommunicationService communication, AuthenticationStateProvider auth)
public BrowseService(CommunicationService communication, AuthenticationStateProvider auth)
{
_communication = communication ?? throw new ArgumentNullException(nameof(communication));
_auth = auth ?? throw new ArgumentNullException(nameof(auth));
@@ -16,7 +16,7 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
/// envelope. Transport failures (timeouts, unreachable sites) are translated
/// into a typed <see cref="ReadTagValuesFailure"/> so the dialog can render an
/// inline banner without crashing — same shape as
/// <see cref="IOpcUaBrowseService"/>.
/// <see cref="IBrowseService"/>.
/// </remarks>
public interface IBindingTester
{
@@ -17,7 +17,7 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
/// <see cref="BrowseFailure"/> so the dialog can render an inline error and
/// remain usable (manual node-id paste still works).
/// </remarks>
public interface IOpcUaBrowseService
public interface IBrowseService
{
/// <summary>
/// Enumerates the immediate children of an OPC UA node on the live server