Skip to content

feat: route dashboard pages through shared IOperationsService#28

Merged
Theauxm merged 1 commit intomainfrom
feat/operations-service-integration
May 8, 2026
Merged

feat: route dashboard pages through shared IOperationsService#28
Theauxm merged 1 commit intomainfrom
feat/operations-service-integration

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented May 8, 2026

Summary

Refactors five Blazor pages to call `IOperationsService` in Trax.Scheduler instead of issuing EF queries / mutating config singletons inline. This is the prerequisite for the React dashboard rebuild: Blazor and React both read from / write to the same code path through the GraphQL `operations.*` namespace, so the two surfaces can never diverge in behaviour.

What changes

Page Before After
QueueTrainDialog Inline JSON deserialization + WorkQueue insert `OperationsService.QueueTrainAsync`
WorkQueueDetailPage Inline status check + update `OperationsService.CancelWorkQueueEntryAsync`
ManifestGroupDetailPage Inline SaveSettings + 90-line cross-group dependency query `UpdateManifestGroupAsync` + `GetManifestGroupDependencyGraphAsync`
Index ~300 lines of EF / aggregation for KPIs, charts, top failures, durations, throughput `GetDashboardMetricsAsync` for everything DB-driven; CPU% sampling kept local since it needs per-instance state
ServerSettingsPage In-memory singleton mutation only (lost on restart) `UpdateSchedulerConfigAsync` (mutates singleton AND persists `trax.scheduler_config` row)

Net diff: +200 / -464, with about 200 lines of inline DB logic deleted from the dashboard layer.

Bug fix bundled in

The old `QueueTrainDialog` matched user input against `TrainRegistration.ServiceTypeName` (a friendly name like `IServiceTrain<X, Y>`) instead of `ServiceType.FullName`. The shared service compares against FullName per the Train Type Naming Rules in `CLAUDE.md`. The fix lands automatically through this refactor.

Coordinated changes

Depends on Trax.Effect `feat/scheduler-config-model` and Trax.Scheduler `feat/operations-service` for the service and persistence model.

Test plan

  • Trax.Dashboard.csproj builds clean with 0 warnings.
  • Manual smoke: queue a train via the dialog, verify the work queue entry exists and dispatches.
  • Manual smoke: cancel a queued entry, verify it transitions to `Cancelled`.
  • Manual smoke: edit manifest group settings, save, verify persistence (restart, settings should survive).
  • Manual smoke: edit scheduler settings on ServerSettingsPage, save, restart the app, verify the row was loaded by `SchedulerConfigBootstrapHostedService`.
  • Manual smoke: KPIs / charts / top failures / durations / throughput all populate on the Index page.

Replaces inline EF queries and config mutation in five Blazor pages with
calls to IOperationsService (Trax.Scheduler). The dashboard and the
GraphQL operations.* namespace in Trax.Api now share validation,
persistence, and metrics computation by construction, which is the
prerequisite for the React dashboard rebuild reading from the same API.

  - QueueTrainDialog: queueTrain via service (validation + JSON
    deserialization moved to service; fixes a latent bug where lookup
    used ServiceTypeName instead of ServiceType.FullName)
  - WorkQueueDetailPage.CancelEntry: shared cancel path
  - ManifestGroupDetailPage: SaveSettings -> updateManifestGroup;
    LoadDependencyGraph -> getManifestGroupDependencyGraph (returns
    plain DTOs which the page maps to DagLayout for Radzen rendering)
  - Index: KPIs / charts / top-failures / durations / throughput series
    all sourced from getDashboardMetricsAsync; CPU% sampling stays
    local since it requires per-instance state
  - ServerSettingsPage.SaveScheduler: now persists via the service
    (previously only mutated the in-memory singleton, lost on restart)

About 200 lines of inline DB / mutation logic removed from the
dashboard layer.
@Theauxm Theauxm merged commit 258f953 into main May 8, 2026
1 of 2 checks passed
@Theauxm Theauxm deleted the feat/operations-service-integration branch May 8, 2026 15:29
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented May 8, 2026

This PR is included in version 1.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant