@shipfox/client-workflows 12.0.2 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +16 -1
- package/.storybook/preview.tsx +3 -3
- package/.storybook/workspace-source.ts +31 -0
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +79 -0
- package/dist/components/job-graph/job-duration-format.d.ts +2 -2
- package/dist/components/job-graph/job-duration-format.d.ts.map +1 -1
- package/dist/components/job-graph/job-duration-format.js +4 -2
- package/dist/components/job-graph/job-duration-format.js.map +1 -1
- package/dist/components/job-graph/job-duration-label.js +1 -1
- package/dist/components/job-graph/job-duration-label.js.map +1 -1
- package/dist/components/job-graph/job-graph-content.d.ts +2 -1
- package/dist/components/job-graph/job-graph-content.d.ts.map +1 -1
- package/dist/components/job-graph/job-graph-content.js +3 -3
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/job-graph/job-graph-view.d.ts +2 -1
- package/dist/components/job-graph/job-graph-view.d.ts.map +1 -1
- package/dist/components/job-graph/job-graph-view.js +2 -2
- package/dist/components/job-graph/job-graph-view.js.map +1 -1
- package/dist/components/job-graph/job-node.d.ts +1 -1
- package/dist/components/job-graph/job-node.d.ts.map +1 -1
- package/dist/components/job-graph/job-node.js +10 -9
- package/dist/components/job-graph/job-node.js.map +1 -1
- package/dist/components/job-graph/types.d.ts +2 -1
- package/dist/components/job-graph/types.d.ts.map +1 -1
- package/dist/components/job-graph/types.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +2 -2
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.js +1 -1
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/job-status-strip.d.ts +21 -0
- package/dist/components/workflow-run-list/job-status-strip.d.ts.map +1 -0
- package/dist/components/workflow-run-list/job-status-strip.js +185 -0
- package/dist/components/workflow-run-list/job-status-strip.js.map +1 -0
- package/dist/components/workflow-run-list/run-display.d.ts +27 -3
- package/dist/components/workflow-run-list/run-display.d.ts.map +1 -1
- package/dist/components/workflow-run-list/run-display.js +78 -7
- package/dist/components/workflow-run-list/run-display.js.map +1 -1
- package/dist/components/workflow-run-list/types.d.ts +23 -24
- package/dist/components/workflow-run-list/types.d.ts.map +1 -1
- package/dist/components/workflow-run-list/types.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.d.ts +22 -0
- package/dist/components/workflow-run-list/workflow-run-filter-menu.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js +68 -0
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-filters.d.ts +18 -0
- package/dist/components/workflow-run-list/workflow-run-filters.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-filters.js +236 -0
- package/dist/components/workflow-run-list/workflow-run-filters.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts +8 -4
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-content.js +40 -12
- package/dist/components/workflow-run-list/workflow-run-list-content.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts +29 -2
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-states.js +103 -44
- package/dist/components/workflow-run-list/workflow-run-list-states.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js +60 -43
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.d.ts +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.js +20 -8
- package/dist/components/workflow-run-list/workflow-run-list.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.d.ts +19 -9
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +179 -112
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-number-label.d.ts +15 -0
- package/dist/components/workflow-run-number-label.d.ts.map +1 -0
- package/dist/components/workflow-run-number-label.js +41 -0
- package/dist/components/workflow-run-number-label.js.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts +3 -3
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +10 -9
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +4 -9
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +107 -74
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +6 -0
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/index.js +7 -0
- package/dist/components/workflow-run-tabs/index.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts +11 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js +71 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts +2 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.js +11 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts +18 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.js +107 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts +6 -0
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-count.js +27 -0
- package/dist/components/workflow-run-tabs/run-tab-count.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts +8 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.js +82 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.js.map +1 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts +2 -2
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts.map +1 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.js +4 -4
- package/dist/components/workflow-run-view/agent-config-failure-callout.js.map +1 -1
- package/dist/components/workflow-run-view/job-card.d.ts +2 -2
- package/dist/components/workflow-run-view/job-card.d.ts.map +1 -1
- package/dist/components/workflow-run-view/job-card.js +51 -32
- package/dist/components/workflow-run-view/job-card.js.map +1 -1
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts +1 -1
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts.map +1 -1
- package/dist/components/workflow-run-view/job-execution-switcher.js +20 -8
- package/dist/components/workflow-run-view/job-execution-switcher.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-selection.js +40 -1
- package/dist/components/workflow-run-view/workflow-run-selection.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-states.d.ts +1 -0
- package/dist/components/workflow-run-view/workflow-run-states.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-states.js +10 -1
- package/dist/components/workflow-run-view/workflow-run-states.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +10 -5
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +136 -85
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/components/workflow-source-panel/index.d.ts +1 -0
- package/dist/components/workflow-source-panel/index.d.ts.map +1 -1
- package/dist/components/workflow-source-panel/index.js +1 -0
- package/dist/components/workflow-source-panel/index.js.map +1 -1
- package/dist/components/workflow-source-panel/workflow-source-content.d.ts +12 -0
- package/dist/components/workflow-source-panel/workflow-source-content.d.ts.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-content.js +53 -0
- package/dist/components/workflow-source-panel/workflow-source-content.js.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts +1 -1
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts.map +1 -1
- package/dist/components/workflow-source-panel/workflow-source-panel.js +7 -54
- package/dist/components/workflow-source-panel/workflow-source-panel.js.map +1 -1
- package/dist/components/workflow-status/status-visuals.d.ts +4 -4
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -1
- package/dist/components/workflow-status/status-visuals.js +7 -0
- package/dist/components/workflow-status/status-visuals.js.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts +3 -4
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.js +6 -4
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +10 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js +11 -0
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts +4 -2
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/job.js +8 -1
- package/dist/core/entities/job.js.map +1 -1
- package/dist/core/entities/step.d.ts +1 -1
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js +2 -0
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +52 -4
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js +22 -3
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/workflow-run-tabs.d.ts +9 -0
- package/dist/core/workflow-run-tabs.d.ts.map +1 -0
- package/dist/core/workflow-run-tabs.js +3 -0
- package/dist/core/workflow-run-tabs.js.map +1 -0
- package/dist/core/workflow-run.d.ts +6 -6
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js +3 -3
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/feature.d.ts +7 -7
- package/dist/feature.js +5 -5
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.d.ts +4 -3
- package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.js +31 -3
- package/dist/hooks/api/workflow-run-mapper.js.map +1 -1
- package/dist/hooks/api/workflow-runs.d.ts +4 -4
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -1
- package/dist/hooks/api/workflow-runs.js +12 -4
- package/dist/hooks/api/workflow-runs.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/pages/project-workflows-page.js +46 -1
- package/dist/pages/project-workflows-page.js.map +1 -1
- package/dist/pages/workflow-run-detail-page.d.ts +11 -0
- package/dist/pages/workflow-run-detail-page.d.ts.map +1 -0
- package/dist/pages/workflow-run-detail-page.js +52 -0
- package/dist/pages/workflow-run-detail-page.js.map +1 -0
- package/dist/pages/workflow-run-list-page.d.ts +10 -0
- package/dist/pages/workflow-run-list-page.d.ts.map +1 -0
- package/dist/pages/workflow-run-list-page.js +43 -0
- package/dist/pages/workflow-run-list-page.js.map +1 -0
- package/dist/routes/inputs.d.ts +94 -5
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +199 -13
- package/dist/routes/inputs.js.map +1 -1
- package/dist/routes/project-route.d.ts +6 -0
- package/dist/routes/project-route.d.ts.map +1 -0
- package/dist/routes/project-route.js +25 -0
- package/dist/routes/project-route.js.map +1 -0
- package/dist/routes/run-detail.d.ts.map +1 -1
- package/dist/routes/run-detail.js +12 -7
- package/dist/routes/run-detail.js.map +1 -1
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/runs.js +11 -6
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/routes/workflows.js +6 -5
- package/dist/routes/workflows.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/components/job-graph/job-duration-format.ts +11 -2
- package/src/components/job-graph/job-duration-label.tsx +5 -1
- package/src/components/job-graph/job-graph-content.tsx +7 -4
- package/src/components/job-graph/job-graph-view.test.tsx +19 -8
- package/src/components/job-graph/job-graph-view.tsx +6 -3
- package/src/components/job-graph/job-graph.stories.tsx +24 -20
- package/src/components/job-graph/job-node.stories.tsx +11 -6
- package/src/components/job-graph/job-node.test.tsx +82 -12
- package/src/components/job-graph/job-node.tsx +22 -15
- package/src/components/job-graph/types.ts +5 -1
- package/src/components/step-list/step-list.stories.tsx +2 -3
- package/src/components/step-list/step-list.tsx +3 -2
- package/src/components/workflow-run-duration-label.tsx +1 -1
- package/src/components/workflow-run-list/job-status-strip.tsx +189 -0
- package/src/components/workflow-run-list/run-display.test.ts +169 -30
- package/src/components/workflow-run-list/run-display.ts +116 -9
- package/src/components/workflow-run-list/types.ts +21 -17
- package/src/components/workflow-run-list/workflow-run-filter-menu.tsx +100 -0
- package/src/components/workflow-run-list/workflow-run-filters.tsx +243 -0
- package/src/components/workflow-run-list/workflow-run-list-content.tsx +44 -16
- package/src/components/workflow-run-list/workflow-run-list-states.tsx +128 -27
- package/src/components/workflow-run-list/workflow-run-list-view.test.tsx +441 -104
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +73 -43
- package/src/components/workflow-run-list/workflow-run-list.stories.tsx +140 -20
- package/src/components/workflow-run-list/workflow-run-list.tsx +20 -10
- package/src/components/workflow-run-list/workflow-run-row.tsx +173 -106
- package/src/components/workflow-run-number-label.test.tsx +45 -0
- package/src/components/workflow-run-number-label.tsx +47 -0
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.test.tsx +7 -8
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +15 -14
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +29 -38
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +30 -24
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +102 -77
- package/src/components/workflow-run-tabs/index.ts +5 -0
- package/src/components/workflow-run-tabs/run-annotation-summary-line.test.tsx +69 -0
- package/src/components/workflow-run-tabs/run-annotation-summary-line.tsx +97 -0
- package/src/components/workflow-run-tabs/run-annotations-empty.tsx +11 -0
- package/src/components/workflow-run-tabs/run-jobs-list.tsx +151 -0
- package/src/components/workflow-run-tabs/run-tab-count.tsx +28 -0
- package/src/components/workflow-run-tabs/run-tab-strip.stories.tsx +52 -0
- package/src/components/workflow-run-tabs/run-tab-strip.test.tsx +117 -0
- package/src/components/workflow-run-tabs/run-tab-strip.tsx +97 -0
- package/src/components/workflow-run-view/agent-config-failure-callout.stories.tsx +2 -3
- package/src/components/workflow-run-view/agent-config-failure-callout.tsx +4 -4
- package/src/components/workflow-run-view/job-card.stories.tsx +11 -10
- package/src/components/workflow-run-view/job-card.test.tsx +115 -0
- package/src/components/workflow-run-view/job-card.tsx +74 -35
- package/src/components/workflow-run-view/job-execution-switcher.tsx +31 -9
- package/src/components/workflow-run-view/workflow-run-selection.test.ts +48 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +48 -1
- package/src/components/workflow-run-view/workflow-run-states.tsx +12 -1
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +152 -94
- package/src/components/workflow-run-view/workflow-run-view.tsx +219 -95
- package/src/components/workflow-source-panel/index.ts +1 -0
- package/src/components/workflow-source-panel/workflow-source-content.tsx +84 -0
- package/src/components/workflow-source-panel/workflow-source-panel.tsx +14 -81
- package/src/components/workflow-status/status-visuals.test.ts +9 -0
- package/src/components/workflow-status/status-visuals.ts +6 -4
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +10 -2
- package/src/components/workflow-status/workflow-status-icon.test.tsx +18 -0
- package/src/components/workflow-status/workflow-status-icon.tsx +17 -24
- package/src/core/entities/job-execution.ts +22 -0
- package/src/core/entities/job-status.test.ts +104 -0
- package/src/core/entities/job.ts +18 -3
- package/src/core/entities/step.ts +4 -0
- package/src/core/entities/workflow-run.ts +76 -7
- package/src/core/workflow-run-tabs.ts +8 -0
- package/src/core/workflow-run.test.ts +24 -9
- package/src/core/workflow-run.ts +17 -2
- package/src/feature.ts +5 -5
- package/src/hooks/api/workflow-run-mapper.ts +30 -3
- package/src/hooks/api/workflow-runs.test.tsx +2 -0
- package/src/hooks/api/workflow-runs.ts +12 -7
- package/src/index.ts +7 -2
- package/src/page-harness-budget.test.ts +1 -1
- package/src/pages/project-workflows-page.test.tsx +59 -5
- package/src/pages/project-workflows-page.tsx +34 -1
- package/src/pages/workflow-run-detail-page.tsx +72 -0
- package/src/pages/workflow-run-list-page.tsx +65 -0
- package/src/pages/workflow-run-pages.test.tsx +823 -0
- package/src/routes/inputs.test.ts +240 -12
- package/src/routes/inputs.ts +215 -11
- package/src/routes/project-route.tsx +25 -0
- package/src/routes/run-detail.tsx +15 -8
- package/src/routes/runs.tsx +14 -7
- package/src/routes/workflows.tsx +5 -4
- package/src/storybook-config.test.ts +27 -0
- package/test/fixtures/workflow-run.ts +76 -7
- package/test/pages.tsx +18 -8
- package/test/render.tsx +8 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.test.json +7 -1
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts +0 -10
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts.map +0 -1
- package/dist/components/workflow-run-list/workflow-run-list-header.js +0 -55
- package/dist/components/workflow-run-list/workflow-run-list-header.js.map +0 -1
- package/dist/pages/workflow-run-first-time-use.d.ts +0 -6
- package/dist/pages/workflow-run-first-time-use.d.ts.map +0 -1
- package/dist/pages/workflow-run-first-time-use.js +0 -17
- package/dist/pages/workflow-run-first-time-use.js.map +0 -1
- package/dist/pages/workflow-run-page.d.ts +0 -10
- package/dist/pages/workflow-run-page.d.ts.map +0 -1
- package/dist/pages/workflow-run-page.js +0 -90
- package/dist/pages/workflow-run-page.js.map +0 -1
- package/src/components/workflow-run-list/workflow-run-list-header.tsx +0 -53
- package/src/pages/workflow-run-first-time-use.tsx +0 -17
- package/src/pages/workflow-run-page.test.tsx +0 -519
- package/src/pages/workflow-run-page.tsx +0 -94
|
@@ -6,11 +6,13 @@ import type {
|
|
|
6
6
|
WorkflowRunDetailResponseDto,
|
|
7
7
|
WorkflowRunJobDetailDto,
|
|
8
8
|
WorkflowRunJobExecutionDetailDto,
|
|
9
|
+
WorkflowRunJobSummaryDto,
|
|
10
|
+
WorkflowRunListItemDto,
|
|
9
11
|
WorkflowRunListResponseDto,
|
|
10
|
-
WorkflowRunResponseDto,
|
|
11
12
|
WorkflowRunStatusDto,
|
|
12
13
|
WorkflowRunStepDetailDto,
|
|
13
14
|
} from '@shipfox/api-workflows-dto';
|
|
15
|
+
import {WORKFLOW_RUN_JOB_PREVIEW_LIMIT} from '@shipfox/api-workflows-dto';
|
|
14
16
|
import type {
|
|
15
17
|
Job,
|
|
16
18
|
Step,
|
|
@@ -35,9 +37,11 @@ const DEFINITION_ID = '33333333-3333-4333-8333-333333333333';
|
|
|
35
37
|
const JOB_ID = '44444444-4444-4444-8444-000000000001';
|
|
36
38
|
const JOB_EXECUTION_ID = '77777777-7777-4777-8777-000000000001';
|
|
37
39
|
const STEP_ID = '55555555-5555-4555-8555-000000000001';
|
|
40
|
+
const JOB_SUMMARY_ID_PREFIX = '44444444-4444-4444-8444-1';
|
|
38
41
|
|
|
39
42
|
let runSequence = 0;
|
|
40
43
|
let jobSequence = 0;
|
|
44
|
+
let jobSummarySequence = 0;
|
|
41
45
|
let jobExecutionSequence = 0;
|
|
42
46
|
let stepSequence = 0;
|
|
43
47
|
let attemptSequence = 0;
|
|
@@ -49,14 +53,18 @@ export type JobDtoOverrides = Partial<Omit<WorkflowRunJobDetailDto, 'job_executi
|
|
|
49
53
|
|
|
50
54
|
type JobDtoBase = Omit<WorkflowRunJobDetailDto, 'job_executions'>;
|
|
51
55
|
|
|
56
|
+
// Built as a list item, the widest run shape, so one factory serves both the list endpoint
|
|
57
|
+
// and the single-run endpoints; the narrower response schemas drop the extra key.
|
|
52
58
|
export function workflowRunDto(
|
|
53
|
-
overrides: Partial<
|
|
54
|
-
):
|
|
59
|
+
overrides: Partial<WorkflowRunListItemDto> = {},
|
|
60
|
+
): WorkflowRunListItemDto {
|
|
55
61
|
return {
|
|
56
62
|
id: RUN_ID,
|
|
57
63
|
project_id: PROJECT_ID,
|
|
58
64
|
definition_id: DEFINITION_ID,
|
|
65
|
+
number: 1,
|
|
59
66
|
name: 'deploy-web',
|
|
67
|
+
workflow_name: 'deploy-web',
|
|
60
68
|
status: 'running',
|
|
61
69
|
current_attempt: 1,
|
|
62
70
|
latest_attempt: 1,
|
|
@@ -64,18 +72,79 @@ export function workflowRunDto(
|
|
|
64
72
|
trigger_source: 'manual',
|
|
65
73
|
trigger_event: 'fire',
|
|
66
74
|
trigger_payload: {},
|
|
75
|
+
trigger_reference: null,
|
|
67
76
|
inputs: null,
|
|
68
77
|
source_snapshot: null,
|
|
69
78
|
created_at: '2026-06-21T12:00:00.000Z',
|
|
70
79
|
updated_at: '2026-06-21T12:01:00.000Z',
|
|
71
80
|
started_at: null,
|
|
72
81
|
finished_at: null,
|
|
82
|
+
jobs: [],
|
|
83
|
+
job_status_counts: [],
|
|
73
84
|
...overrides,
|
|
74
85
|
};
|
|
75
86
|
}
|
|
76
87
|
|
|
88
|
+
export function workflowRunJobSummaryDto(
|
|
89
|
+
overrides: Partial<WorkflowRunJobSummaryDto> = {},
|
|
90
|
+
): WorkflowRunJobSummaryDto {
|
|
91
|
+
jobSummarySequence += 1;
|
|
92
|
+
return {
|
|
93
|
+
id: `${JOB_SUMMARY_ID_PREFIX}${String(jobSummarySequence).padStart(11, '0')}`,
|
|
94
|
+
key: `job-${jobSummarySequence}`,
|
|
95
|
+
name: null,
|
|
96
|
+
status: 'succeeded',
|
|
97
|
+
position: jobSummarySequence - 1,
|
|
98
|
+
...overrides,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** A strip of `count` job glyphs, with `statuses` applied from the left. */
|
|
103
|
+
export function workflowRunJobSummaryDtos(
|
|
104
|
+
count: number,
|
|
105
|
+
statuses: readonly JobStatusDto[] = [],
|
|
106
|
+
): WorkflowRunJobSummaryDto[] {
|
|
107
|
+
return Array.from({length: count}, (_, index) =>
|
|
108
|
+
workflowRunJobSummaryDto({
|
|
109
|
+
key: `job-${index + 1}`,
|
|
110
|
+
position: index,
|
|
111
|
+
...(statuses[index] ? {status: statuses[index]} : {}),
|
|
112
|
+
}),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* A run's jobs as the API sends them: the preview truncated at the server's bound, and counts
|
|
118
|
+
* over every status given.
|
|
119
|
+
*
|
|
120
|
+
* Built from one list so the two can never disagree. A fixture whose counts contradicted its
|
|
121
|
+
* preview would hide exactly the bug the split exists to prevent.
|
|
122
|
+
*/
|
|
123
|
+
export function workflowRunJobsFixture(
|
|
124
|
+
statuses: readonly JobStatusDto[],
|
|
125
|
+
): Pick<WorkflowRunListItemDto, 'jobs' | 'job_status_counts'> {
|
|
126
|
+
const counts = new Map<JobStatusDto, number>();
|
|
127
|
+
for (const status of statuses) counts.set(status, (counts.get(status) ?? 0) + 1);
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
jobs: workflowRunJobSummaryDtos(
|
|
131
|
+
Math.min(statuses.length, WORKFLOW_RUN_JOB_PREVIEW_LIMIT),
|
|
132
|
+
statuses,
|
|
133
|
+
),
|
|
134
|
+
job_status_counts: [...counts.entries()].map(([status, count]) => ({status, count})),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** `count` jobs that all share one status, for density cases where the mix does not matter. */
|
|
139
|
+
export function workflowRunJobsOfStatus(
|
|
140
|
+
count: number,
|
|
141
|
+
status: JobStatusDto = 'succeeded',
|
|
142
|
+
): Pick<WorkflowRunListItemDto, 'jobs' | 'job_status_counts'> {
|
|
143
|
+
return workflowRunJobsFixture(Array.from({length: count}, () => status));
|
|
144
|
+
}
|
|
145
|
+
|
|
77
146
|
export function workflowRunListItem(
|
|
78
|
-
overrides: Partial<
|
|
147
|
+
overrides: Partial<WorkflowRunListItemDto> = {},
|
|
79
148
|
): WorkflowRunListItem {
|
|
80
149
|
return toWorkflowRunListItem(workflowRunDto(overrides));
|
|
81
150
|
}
|
|
@@ -276,8 +345,8 @@ export function sequencedWorkflowRunDto(
|
|
|
276
345
|
status: WorkflowRunStatusDto,
|
|
277
346
|
name: string,
|
|
278
347
|
minutesAgo: number,
|
|
279
|
-
overrides: Partial<
|
|
280
|
-
):
|
|
348
|
+
overrides: Partial<WorkflowRunListItemDto> = {},
|
|
349
|
+
): WorkflowRunListItemDto {
|
|
281
350
|
runSequence += 1;
|
|
282
351
|
return workflowRunDto({
|
|
283
352
|
id: `run-${String(runSequence).padStart(8, '0')}`,
|
|
@@ -298,7 +367,7 @@ export function sequencedWorkflowRunListItem(
|
|
|
298
367
|
status: WorkflowRunStatusDto,
|
|
299
368
|
name: string,
|
|
300
369
|
minutesAgo: number,
|
|
301
|
-
overrides: Partial<
|
|
370
|
+
overrides: Partial<WorkflowRunListItemDto> = {},
|
|
302
371
|
): WorkflowRunListItem {
|
|
303
372
|
return toWorkflowRunListItem(sequencedWorkflowRunDto(status, name, minutesAgo, overrides));
|
|
304
373
|
}
|
package/test/pages.tsx
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import {configureApiClient} from '@shipfox/client-api';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
type AuthState,
|
|
4
|
+
authStateAtom,
|
|
5
|
+
parseAppSearch,
|
|
6
|
+
stringifyAppSearch,
|
|
7
|
+
} from '@shipfox/client-shell/runtime';
|
|
3
8
|
import {Toaster} from '@shipfox/react-ui/toast';
|
|
4
9
|
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
|
|
5
10
|
import {
|
|
@@ -19,18 +24,19 @@ import {validateWorkflowRunsSearch} from '#routes/inputs.js';
|
|
|
19
24
|
|
|
20
25
|
// The workflow run page navigates with the router (run rows are links and the page redirects
|
|
21
26
|
// to the first run), so the harness mounts the page under a memory router whose route tree
|
|
22
|
-
// carries the `/
|
|
27
|
+
// carries the `/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId` params the components read. The
|
|
23
28
|
// page is supplied as a factory the detail route calls with the current `workflowRunId`, mirroring
|
|
24
29
|
// the real route wiring so a redirect re-renders the page with the run it landed on.
|
|
25
30
|
export const PROJECT_TEST_WID = '11111111-1111-4111-8111-111111111111';
|
|
31
|
+
export const PROJECT_TEST_WSLUG = 'acme';
|
|
26
32
|
|
|
27
33
|
// Pages that render components depending on `useActiveWorkspace()` (e.g. the project source
|
|
28
|
-
// strip) need an authenticated workspace matching `$
|
|
34
|
+
// strip) need an authenticated workspace matching `$workspaceSlug` in the atom `client-shell/runtime`
|
|
29
35
|
// reads. A fixed membership id is fine here: nothing in these tests asserts on it.
|
|
30
36
|
const authState: AuthState = {
|
|
31
37
|
status: 'authenticated',
|
|
32
38
|
token: 'token',
|
|
33
|
-
workspaces: [{id: PROJECT_TEST_WID, name: 'Acme', membershipId: 'm-1'}],
|
|
39
|
+
workspaces: [{id: PROJECT_TEST_WID, name: 'Acme', slug: PROJECT_TEST_WSLUG, membershipId: 'm-1'}],
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
export function jsonResponse(body: unknown, init: ResponseInit = {}) {
|
|
@@ -51,7 +57,7 @@ function createTestRouter(
|
|
|
51
57
|
const rootRoute = createRootRoute({component: Outlet});
|
|
52
58
|
const runsRoute = createRoute({
|
|
53
59
|
getParentRoute: () => rootRoute,
|
|
54
|
-
path: '/
|
|
60
|
+
path: '/w/$workspaceSlug/p/$projectSlug/runs',
|
|
55
61
|
component: function RunsRoute() {
|
|
56
62
|
return renderPage({
|
|
57
63
|
search: validateWorkflowRunsSearch(useSearch({strict: false}) as Record<string, unknown>),
|
|
@@ -60,7 +66,7 @@ function createTestRouter(
|
|
|
60
66
|
});
|
|
61
67
|
const runDetailRoute = createRoute({
|
|
62
68
|
getParentRoute: () => rootRoute,
|
|
63
|
-
path: '/
|
|
69
|
+
path: '/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId',
|
|
64
70
|
component: function RunDetailRoute() {
|
|
65
71
|
const {workflowRunId} = useParams({strict: false}) as {workflowRunId?: string};
|
|
66
72
|
return renderPage({
|
|
@@ -71,17 +77,21 @@ function createTestRouter(
|
|
|
71
77
|
});
|
|
72
78
|
const workflowsRoute = createRoute({
|
|
73
79
|
getParentRoute: () => rootRoute,
|
|
74
|
-
path: '/
|
|
80
|
+
path: '/w/$workspaceSlug/p/$projectSlug/workflows',
|
|
75
81
|
component: () => renderPage({search: {}}),
|
|
76
82
|
});
|
|
77
83
|
const modelProviderSettingsRoute = createRoute({
|
|
78
84
|
getParentRoute: () => rootRoute,
|
|
79
|
-
path: '/
|
|
85
|
+
path: '/w/$workspaceSlug/settings/agents',
|
|
80
86
|
component: () => <div>Agent settings placeholder</div>,
|
|
81
87
|
});
|
|
82
88
|
|
|
83
89
|
return createRouter({
|
|
84
90
|
history: createMemoryHistory({initialEntries: [path]}),
|
|
91
|
+
// Mirrors the generated app router so repeated search keys behave here as they do in
|
|
92
|
+
// production; the default encoder would JSON-encode a multi-select instead.
|
|
93
|
+
parseSearch: parseAppSearch,
|
|
94
|
+
stringifySearch: stringifyAppSearch,
|
|
85
95
|
routeTree: rootRoute.addChildren([
|
|
86
96
|
runsRoute,
|
|
87
97
|
runDetailRoute,
|
package/test/render.tsx
CHANGED
|
@@ -19,13 +19,19 @@ function createComponentRouter(element: ReactElement) {
|
|
|
19
19
|
// Workflow run rows link here; TanStack Router needs the target route to build hrefs.
|
|
20
20
|
const runDetailRoute = createRoute({
|
|
21
21
|
getParentRoute: () => rootRoute,
|
|
22
|
-
path: '/
|
|
22
|
+
path: '/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId',
|
|
23
|
+
component: () => null,
|
|
24
|
+
});
|
|
25
|
+
// The unfiltered empty state links here.
|
|
26
|
+
const workflowsRoute = createRoute({
|
|
27
|
+
getParentRoute: () => rootRoute,
|
|
28
|
+
path: '/w/$workspaceSlug/p/$projectSlug/workflows',
|
|
23
29
|
component: () => null,
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
return createRouter({
|
|
27
33
|
history: createMemoryHistory({initialEntries: ['/']}),
|
|
28
|
-
routeTree: rootRoute.addChildren([indexRoute, runDetailRoute]),
|
|
34
|
+
routeTree: rootRoute.addChildren([indexRoute, runDetailRoute, workflowsRoute]),
|
|
29
35
|
});
|
|
30
36
|
}
|
|
31
37
|
|