test(ui): retain ScadaBridge synthetic consumer validation host

This commit is contained in:
Joseph Doherty
2026-11-13 19:43:32 -05:00
parent e61af09c2e
commit 3c1eada677
22 changed files with 579 additions and 0 deletions
@@ -0,0 +1,41 @@
@page "/accent"
<PageTitle>Four-family accent component canary</PageTitle>
<h1>Four-family accent component canary</h1>
<p>Fixture-only shared components under the actual CentralUI stylesheet. These four cases use the release-decision table and validate the shared light scheme, not a full sister application.</p>
<nav aria-label="Accent fixture cases">
<a href="/accent?family=default">Default blue</a> ·
<a href="/accent?family=historian">Historian green</a> ·
<a href="/accent?family=btdb">BTDB teal</a> ·
<a href="/accent?family=overview">Overview purple</a> ·
<a href="/">Actual CentralUI component fixture</a>
</nav>
<ThemeShell Product="@Selected.Label" Accent="@Selected.Accent" AccentDeep="@Selected.Deep"
AccentTint="@Selected.Tint" AccentBorder="@Selected.Border" AccentFocus="@Selected.Deep">
<Nav>
<NavRailItem Href="/accent" Text="Selected sample" Match="NavLinkMatch.All" />
</Nav>
<ChildContent>
<h2 id="accent-family-title">@Selected.Label</h2>
<p><a id="canary-family-link" href="#accent-family-title">An actual theme-styled link</a></p>
<div class="canary-action-row">
<TechButton id="canary-family-primary" @onclick="CountClick">Local primary action</TechButton>
<TechButton id="canary-family-ghost" Variant="ButtonVariant.Ghost" @onclick="CountClick">Local ghost action</TechButton>
<TechButton id="canary-family-disabled" disabled="true">Disabled primary action</TechButton>
</div>
<StatusPill State="StatusState.Info">Independent semantic information</StatusPill>
<p id="canary-family-outcome" role="status">Synthetic local clicks: @_clicks</p>
</ChildContent>
</ThemeShell>
@code {
[SupplyParameterFromQuery(Name = "family")] public string? Family { get; set; }
private int _clicks;
private void CountClick() => _clicks++;
private AccentCase Selected => Family?.ToLowerInvariant() switch
{
"historian" => new("Historian green", "#2f855a", "#1c6540", "#edf5f0", "#bddbc9"),
"btdb" => new("BTDB teal", "#1b7f8e", "#125764", "#eaf5f6", "#b7d9dd"),
"overview" => new("Overview purple", "#6d28d9", "#4c1d95", "#f2ecfc", "#d7c5f2"),
_ => new("Default blue", "#2f5fd0", "#1e3f99", "#eef2fc", "#cdd9f7")
};
private sealed record AccentCase(string Label, string Accent, string Deep, string Tint, string Border);
}
@@ -0,0 +1,27 @@
@page "/batch-two"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
@using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit
@using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit
@if (Sample == "dashboard") { <h2 class="h6">Local state and UTC verification</h2> } else { <h1>Local state and UTC verification</h1> }
<p>Actual components, synthetic read-only dependencies; no backend queries or write operations. Direct composition is not application authorization verification.</p>
@if (Sample == "dashboard")
{
<ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Dashboard />
}
else if (Sample == "toast")
{
<ToastNotification @ref="_toast" />
<button class="btn btn-secondary" id="show-toast" @onclick="ShowToast">Show local notifications</button>
}
else
{
<AuditFilterBar OnFilterChanged="Capture" />
<output id="local-filter-result">@_result</output>
}
@code {
[SupplyParameterFromQuery] public string? Sample { get; set; }
private ToastNotification? _toast;
private string _result = "No local filter applied";
private void Capture(AuditLogQueryFilter filter) => _result = $"From={filter.FromUtc:O};To={filter.ToUtc:O};FromKind={filter.FromUtc?.Kind};ToKind={filter.ToUtc?.Kind}";
private void ShowToast() { _toast!.ShowError("Synthetic save feedback", "Local configuration", 60000); _toast.ShowInfo("Synthetic read feedback", "Local audit query", 60000); }
}
@@ -0,0 +1,20 @@
@page "/"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
@inject IDialogService Dialogs
<PageTitle>ScadaBridge local component canary</PageTitle>
<h1>ScadaBridge local component canary</h1>
<p>Actual CentralUI MainLayout, DateTimeRangeFilter, LoadingSpinner and DialogHost with synthetic local content. This is not the complete application.</p>
<p><a href="/login">Actual CentralUI login</a> · <a href="/canary-provenance">Fixture provenance</a></p>
<section class="panel rise" id="canary-rise">
<div class="panel-head">Synthetic local filter</div>
<div class="panel-body">
<DateTimeRangeFilter IdPrefix="canary" />
<LoadingSpinner IsLoading="true" Message="Synthetic pending state" />
<p>These controls have no fleet service behind them.</p>
<TechButton @onclick="ShowDialog">Open local confirmation</TechButton>
</div>
</section>
@code {
private async Task ShowDialog() => await Dialogs.ConfirmAsync(
"Local fixture confirmation", "Synthetic dialog. Confirm and Cancel only dismiss this local fixture.");
}
@@ -0,0 +1,61 @@
@page "/"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
@inject IDialogService Dialogs
<PageTitle>ScadaBridge local component canary</PageTitle>
<h1>ScadaBridge local component canary</h1>
<p>Actual CentralUI MainLayout, DateTimeRangeFilter, LoadingSpinner and DialogHost with synthetic local content. This is not the complete application.</p>
<p><a href="/login">Actual CentralUI login</a> · <a href="/canary-provenance">Fixture provenance</a></p>
<section class="panel rise" id="canary-rise">
<div class="panel-head">Synthetic local filter</div>
<div class="panel-body">
<DateTimeRangeFilter IdPrefix="canary" />
<LoadingSpinner IsLoading="true" Message="Synthetic pending state" />
<p>These controls have no fleet service behind them.</p>
<TechField Label="Synthetic label" For="canary-field" Hint="Local-only fixture value; no credential or backend."
HintId="canary-field-hint" Error="@_fieldError" ErrorId="canary-field-error">
<input id="canary-field" class="form-control" @bind="_sample" @bind:event="oninput" @bind:after="ValidateSample"
aria-describedby="@FieldDescription" aria-invalid="@(_fieldError is not null ? "true" : "false")" />
</TechField>
<div class="canary-status-row" aria-label="Synthetic status samples">
<StatusPill State="StatusState.Ok">OK sample</StatusPill>
<StatusPill State="StatusState.Warn">Warning sample</StatusPill>
<StatusPill State="StatusState.Bad">Failure sample</StatusPill>
<StatusPill State="StatusState.Idle">Idle sample</StatusPill>
<StatusPill State="StatusState.Info">Information sample</StatusPill>
</div>
<div class="canary-action-row">
<TechButton id="canary-busy-success" Busy="@SuccessBusy" BusyText="Saving local sample…"
disabled="@IsWorking" @onclick="() => WorkAsync(false)">Save local sample</TechButton>
<TechButton id="canary-busy-failure" Variant="ButtonVariant.Secondary" Busy="@FailureBusy" BusyText="Trying local sample…"
disabled="@IsWorking" @onclick="() => WorkAsync(true)">Simulate local failure</TechButton>
<TechButton id="canary-caller-disabled" disabled="true">Caller-disabled local action</TechButton>
<TechButton @onclick="ShowDialog">Open local confirmation</TechButton>
</div>
<div id="canary-outcome" role="status" aria-live="polite">@_outcome</div>
<p>Supported dark tokens come from actual CentralUI site.css under the limited candidate adoption; this host still uses synthetic local data only.</p>
</div>
</section>
@code {
private string _sample = "";
private string? _fieldError = "Synthetic validation error. Enter a label to clear it.";
private string? _workingAction;
private string _outcome = "No local operation has run.";
private bool IsWorking => _workingAction is not null;
private bool SuccessBusy => _workingAction == "success";
private bool FailureBusy => _workingAction == "failure";
private string FieldDescription => _fieldError is null
? "canary-field-hint" : "canary-field-hint canary-field-error";
private void ValidateSample() => _fieldError = string.IsNullOrWhiteSpace(_sample)
? "Synthetic validation error. Enter a label to clear it." : null;
private async Task WorkAsync(bool failure)
{
if (IsWorking) return;
_workingAction = failure ? "failure" : "success";
_outcome = "Local sample pending.";
await Task.Delay(800);
_outcome = failure ? "Local sample failed. Try again." : "Local sample saved.";
_workingAction = null;
}
private async Task ShowDialog() => await Dialogs.ConfirmAsync(
"Local fixture confirmation", "Synthetic dialog. Confirm and Cancel only dismiss this local fixture.");
}
@@ -0,0 +1,44 @@
@page "/form-samples"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
@using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Forms
@using ZB.MOM.WW.ScadaBridge.Commons.Types.DataConnections
@if (View is "sms" or "smtp") { <h2 class="h6">Local form association samples</h2> } else { <h1>Local form association samples</h1> }
<p>Actual consumer components with synthetic local values. Empty repository reads only; all repository mutations are rejected. Direct notification component composition is not application authorization verification.</p>
@if (View == "sms")
{
<ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.SmsConfiguration />
}
else if (View == "smtp")
{
<ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.SmtpConfiguration />
}
else
{
<section id="gateway-samples">
<MxGatewayEndpointEditor Config="_primary" Title="Synthetic primary" IdPrefix="sample-primary" />
<MxGatewayEndpointEditor Config="_backup" Title="Synthetic backup" IdPrefix="sample-backup" />
</section>
<section id="parameter-samples">
<h2>Repeated parameter editors</h2>
<ParameterValueForm ParameterDefinitions="@_schema" />
<ParameterValueForm ParameterDefinitions="@_schema" />
</section>
<section id="tree-samples">
<h2>Transport selection component</h2>
<TreeView TItem="string" Items="_nodes" ChildrenSelector="_ => Array.Empty<string>()" HasChildrenSelector="_ => false"
KeySelector="s => s" SelectionMode="TreeViewSelectionMode.Checkbox">
<NodeContent Context="node"><span>@node</span></NodeContent>
</TreeView>
</section>
<section id="monaco-sample">
<h2>Actual JSON editor</h2>
<MonacoEditor Language="json" AriaLabel="Synthetic local JSON payload" Value="{}" Height="150px" ShowToolbar="false" />
</section>
}
@code {
[SupplyParameterFromQuery] public string? View { get; set; }
private readonly MxGatewayEndpointConfig _primary = new();
private readonly MxGatewayEndpointConfig _backup = new();
private readonly string[] _nodes = ["Plant A configuration", "Plant B configuration"];
private const string _schema = """{"type":"object","properties":{"count":{"type":"integer"},"details":{"type":"object","properties":{"name":{"type":"string"}}}}}""";
}
@@ -0,0 +1,3 @@
@page "/login"
<PageTitle>ScadaBridge actual login component canary</PageTitle>
<ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Login />
@@ -0,0 +1,4 @@
@page "/operations-canary"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
<p class="notice">Local synthetic observations only. No database, actor system, LDAP or fleet is connected.</p>
<ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Monitoring.Health />
@@ -0,0 +1,20 @@
@page "/overlays"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
@using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit
@using ZB.MOM.WW.ScadaBridge.CentralUI.Services
@using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums
@inject IDialogService Dialogs
<h1>Local overlay verification</h1>
<p>Actual CentralUI dialogs and audit drawer, synthetic read-only data. No fleet services.</p>
<button id="open-confirm" class="btn btn-primary" @onclick="Confirm">Open local confirmation</button>
<button id="open-prompt" class="btn btn-secondary" @onclick="Prompt">Open local prompt</button>
<button id="open-drawer" class="btn btn-secondary" @onclick="() => _drawer = true">Open synthetic audit drawer</button>
<div id="local-result" role="status">@_result</div>
<AuditDrilldownDrawer Event="_event" IsOpen="_drawer" OnClose="() => _drawer = false" />
@code {
private bool _drawer;
private string _result = "No local action";
private readonly AuditEventView _event = new() { EventId = Guid.Parse("11111111-2222-3333-4444-555555555555"), OccurredAtUtc = DateTime.UtcNow, IngestedAtUtc = DateTime.UtcNow, Channel = AuditChannel.ApiOutbound, Kind = AuditKind.ApiCall, Status = AuditStatus.Delivered, SourceSiteId = "local-sample", Actor = "local-fixture", Target = "synthetic" };
private async Task Confirm() => _result = await Dialogs.ConfirmAsync("Local confirmation", "Synthetic confirmation body") ? "Confirmed locally" : "Cancelled locally";
private async Task Prompt() => _result = await Dialogs.PromptAsync("Local prompt", "Local sample value") ?? "Cancelled locally";
}
@@ -0,0 +1,26 @@
@page "/presentation"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
@using ZB.MOM.WW.ScadaBridge.Commons.Types.Debugging
@using ZB.MOM.WW.ScadaBridge.ScriptAnalysis
<h1>Local flow and table presentation samples</h1>
<p>Actual flow/list/table components, synthetic outcomes and long values only. No live/replay command or backend is called.</p>
<section id="utility-samples">
<span class="text-success">Successful sample</span> · <span class="text-warning">Warning sample</span> ·
<span class="text-danger">Failure sample</span> · <span class="text-info">Information sample</span> ·
<span class="text-muted">Muted sample</span> · <span class="text-secondary">Secondary sample</span>
</section>
<FlowGraphView Graph="_graph" Predicted="_prediction" />
<FlowTraceList Graph="_graph" />
<DataTable TableLabel="Synthetic records" TItem="string" Items="_items" SearchFilter="@((item, search) => item.Contains(search, StringComparison.OrdinalIgnoreCase))">
<HeaderContent><th scope="col">Synthetic identifier</th><th scope="col">Details</th></HeaderContent>
<RowContent Context="item"><tr><th scope="row">@item</th><td><span class="mono text-nowrap">@LongValue</span></td></tr></RowContent>
</DataTable>
@code {
private static readonly string LongValue = "synthetic.identifier." + new string('x', 200);
private readonly string[] _items = ["Plant A", "Plant B"];
private static readonly FlowStep[] Steps = Enum.GetValues<FlowStepOutcome>().Select((outcome, i) => new FlowStep(Guid.NewGuid(), null, null,
FlowStepKind.ApiCall, FlowLane.Site, "Synthetic " + outcome, "Illustrative outcome", DateTimeOffset.UnixEpoch.AddSeconds(i), i * 10, outcome,
null, null, null, "local", null, null, null, null)).ToArray();
private readonly PredictedFlow _prediction = new([new PredictedNode("ghost", FlowStepKind.ScriptRun, FlowLane.Site, "Synthetic predicted-only branch", false, "Not observed in this synthetic run")], []);
private readonly FlowGraph _graph = new(Steps, Steps.Zip(Steps.Skip(1)).Select(pair => new FlowEdge(pair.First.EventId, pair.Second.EventId, false, false)).ToArray(), false, false);
}
@@ -0,0 +1,4 @@
@page "/secrets-canary"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
<p class="notice">Actual delivered Secrets UI in ScadaBridge shell. Synthetic metadata only; value reads, encryption, audit and all writes are rejected.</p>
<ZB.MOM.WW.Secrets.Ui.SecretsPage />
@@ -0,0 +1,4 @@
@page "/topology-canary"
@layout ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout
<p class="notice">Local synthetic sites and areas only. Load/search/selection can be inspected; deployment and mutation services reject writes.</p>
<ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deployment.Topology />