-
Notifications
You must be signed in to change notification settings - Fork 11
Hypershell-154 UI with adjustments #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import type { | ||
| DashboardControlPlane, | ||
| DashboardInvocationContext, | ||
| } from "@openshift-online/hypershell-operational-dashboard-ui"; | ||
| import { mockOperationalDashboardMetrics } from "@openshift-online/hypershell-operational-dashboard-ui/fixtures"; | ||
|
|
||
| export function createMockDashboardControlPlane(): DashboardControlPlane { | ||
| return { | ||
| async getOperationalMetrics(context: DashboardInvocationContext) { | ||
| context.signal?.throwIfAborted(); | ||
|
|
||
| await new Promise((resolve) => setTimeout(resolve, 2000)); // This is just for demos for now | ||
|
|
||
| return { | ||
| ...mockOperationalDashboardMetrics, | ||
| lastSuccessfulRefresh: new Date(), | ||
| }; | ||
| }, | ||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { createDashboardOperations } from "@openshift-online/hypershell-operational-dashboard-ui"; | ||
|
|
||
| import { createMockDashboardControlPlane } from "../adapters/mock/dashboard-control-plane"; | ||
|
|
||
| export const dashboardOperations = createDashboardOperations({ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] Dashboard domain probes are never wired into the fan-out publisher in production. |
||
| controlPlane: createMockDashboardControlPlane(), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Major] The mock control-plane adapter is wired here as the production dependency, so authenticated admins are shown fabricated metrics (see the artificial 2s delay in |
||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 2s artificial delay ("just for demos") sits in the composition wired into the real application shell, so it ships in the actual web console, not just Storybook. It is also not abort-aware:
throwIfAborted()runs before the wait but a cancellation during the 2s is ignored, so a navigation-away still resolves the promise. Remove the delay or move this artificial latency into a Storybook/fixture-only adapter.