@shipfox/client-workflows 12.0.1 → 13.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/preview.tsx +3 -3
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +65 -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-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 +5 -4
- package/dist/components/job-graph/job-node.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-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 +8 -7
- 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 +3 -3
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +16 -7
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- 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-view.d.ts +3 -2
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +15 -11
- package/dist/components/workflow-run-view/workflow-run-view.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/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.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 +30 -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 +61 -5
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +150 -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-graph-view.test.tsx +19 -8
- package/src/components/job-graph/job-graph.stories.tsx +23 -19
- package/src/components/job-graph/job-node.stories.tsx +10 -5
- package/src/components/job-graph/job-node.test.tsx +55 -10
- package/src/components/job-graph/job-node.tsx +16 -9
- 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-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 +13 -12
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +6 -8
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +27 -2
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +19 -9
- 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-view.test.tsx +88 -30
- package/src/components/workflow-run-view/workflow-run-view.tsx +24 -14
- 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/workflow-run.ts +76 -7
- 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 +45 -0
- package/src/pages/workflow-run-list-page.tsx +65 -0
- package/src/pages/{workflow-run-page.test.tsx → workflow-run-pages.test.tsx} +211 -47
- package/src/routes/inputs.test.ts +193 -12
- package/src/routes/inputs.ts +170 -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/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/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.tsx +0 -94
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { WorkflowRunListStatusFilter } from './types.js';
|
|
2
|
-
interface WorkflowRunListHeaderProps {
|
|
3
|
-
query: string;
|
|
4
|
-
onQueryChange: (value: string) => void;
|
|
5
|
-
statusFilter: WorkflowRunListStatusFilter;
|
|
6
|
-
onStatusFilterChange: (value: WorkflowRunListStatusFilter) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function WorkflowRunListHeader({ query, onQueryChange, statusFilter, onStatusFilterChange, }: WorkflowRunListHeaderProps): import("react").JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=workflow-run-list-header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-list-header.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-run-list/workflow-run-list-header.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,YAAY,CAAC;AAQ5D,UAAU,0BAA0B;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,EAAE,2BAA2B,CAAC;IAC1C,oBAAoB,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,CAAC;CACpE;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,aAAa,EACb,YAAY,EACZ,oBAAoB,GACrB,EAAE,0BAA0B,+BA6B5B"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from '@shipfox/react-ui/button';
|
|
3
|
-
import { Icon } from '@shipfox/react-ui/icon';
|
|
4
|
-
import { Input } from '@shipfox/react-ui/input';
|
|
5
|
-
const STATUS_FILTERS = [
|
|
6
|
-
{
|
|
7
|
-
value: 'all',
|
|
8
|
-
label: 'All'
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
value: 'failed',
|
|
12
|
-
label: 'Failed'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
value: 'running',
|
|
16
|
-
label: 'Running'
|
|
17
|
-
}
|
|
18
|
-
];
|
|
19
|
-
export function WorkflowRunListHeader({ query, onQueryChange, statusFilter, onStatusFilterChange }) {
|
|
20
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
21
|
-
className: "flex flex-col gap-8 border-b border-border-neutral-base px-12 py-12",
|
|
22
|
-
children: [
|
|
23
|
-
/*#__PURE__*/ _jsx(Input, {
|
|
24
|
-
value: query,
|
|
25
|
-
onChange: (event)=>onQueryChange(event.target.value),
|
|
26
|
-
placeholder: "Run id or trigger...",
|
|
27
|
-
"aria-label": "Search runs",
|
|
28
|
-
size: "small",
|
|
29
|
-
iconLeft: /*#__PURE__*/ _jsx(Icon, {
|
|
30
|
-
name: "searchLine",
|
|
31
|
-
className: "size-14 text-foreground-neutral-muted"
|
|
32
|
-
})
|
|
33
|
-
}),
|
|
34
|
-
/*#__PURE__*/ _jsxs("fieldset", {
|
|
35
|
-
className: "flex items-center gap-8",
|
|
36
|
-
children: [
|
|
37
|
-
/*#__PURE__*/ _jsx("legend", {
|
|
38
|
-
className: "sr-only",
|
|
39
|
-
children: "Run status filter"
|
|
40
|
-
}),
|
|
41
|
-
STATUS_FILTERS.map((filter)=>/*#__PURE__*/ _jsx(Button, {
|
|
42
|
-
type: "button",
|
|
43
|
-
size: "2xs",
|
|
44
|
-
variant: statusFilter === filter.value ? 'primary' : 'transparent',
|
|
45
|
-
"aria-pressed": statusFilter === filter.value,
|
|
46
|
-
onClick: ()=>onStatusFilterChange(filter.value),
|
|
47
|
-
children: filter.label
|
|
48
|
-
}, filter.value))
|
|
49
|
-
]
|
|
50
|
-
})
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=workflow-run-list-header.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/workflow-run-list/workflow-run-list-header.tsx"],"sourcesContent":["import {Button} from '@shipfox/react-ui/button';\nimport {Icon} from '@shipfox/react-ui/icon';\nimport {Input} from '@shipfox/react-ui/input';\nimport type {WorkflowRunListStatusFilter} from './types.js';\n\nconst STATUS_FILTERS: Array<{value: WorkflowRunListStatusFilter; label: string}> = [\n {value: 'all', label: 'All'},\n {value: 'failed', label: 'Failed'},\n {value: 'running', label: 'Running'},\n];\n\ninterface WorkflowRunListHeaderProps {\n query: string;\n onQueryChange: (value: string) => void;\n statusFilter: WorkflowRunListStatusFilter;\n onStatusFilterChange: (value: WorkflowRunListStatusFilter) => void;\n}\n\nexport function WorkflowRunListHeader({\n query,\n onQueryChange,\n statusFilter,\n onStatusFilterChange,\n}: WorkflowRunListHeaderProps) {\n return (\n <div className=\"flex flex-col gap-8 border-b border-border-neutral-base px-12 py-12\">\n <Input\n value={query}\n onChange={(event) => onQueryChange(event.target.value)}\n placeholder=\"Run id or trigger...\"\n aria-label=\"Search runs\"\n size=\"small\"\n iconLeft={<Icon name=\"searchLine\" className=\"size-14 text-foreground-neutral-muted\" />}\n />\n\n <fieldset className=\"flex items-center gap-8\">\n <legend className=\"sr-only\">Run status filter</legend>\n {STATUS_FILTERS.map((filter) => (\n <Button\n key={filter.value}\n type=\"button\"\n size=\"2xs\"\n variant={statusFilter === filter.value ? 'primary' : 'transparent'}\n aria-pressed={statusFilter === filter.value}\n onClick={() => onStatusFilterChange(filter.value)}\n >\n {filter.label}\n </Button>\n ))}\n </fieldset>\n </div>\n );\n}\n"],"names":["Button","Icon","Input","STATUS_FILTERS","value","label","WorkflowRunListHeader","query","onQueryChange","statusFilter","onStatusFilterChange","div","className","onChange","event","target","placeholder","aria-label","size","iconLeft","name","fieldset","legend","map","filter","type","variant","aria-pressed","onClick"],"mappings":";AAAA,SAAQA,MAAM,QAAO,2BAA2B;AAChD,SAAQC,IAAI,QAAO,yBAAyB;AAC5C,SAAQC,KAAK,QAAO,0BAA0B;AAG9C,MAAMC,iBAA6E;IACjF;QAACC,OAAO;QAAOC,OAAO;IAAK;IAC3B;QAACD,OAAO;QAAUC,OAAO;IAAQ;IACjC;QAACD,OAAO;QAAWC,OAAO;IAAS;CACpC;AASD,OAAO,SAASC,sBAAsB,EACpCC,KAAK,EACLC,aAAa,EACbC,YAAY,EACZC,oBAAoB,EACO;IAC3B,qBACE,MAACC;QAAIC,WAAU;;0BACb,KAACV;gBACCE,OAAOG;gBACPM,UAAU,CAACC,QAAUN,cAAcM,MAAMC,MAAM,CAACX,KAAK;gBACrDY,aAAY;gBACZC,cAAW;gBACXC,MAAK;gBACLC,wBAAU,KAAClB;oBAAKmB,MAAK;oBAAaR,WAAU;;;0BAG9C,MAACS;gBAAST,WAAU;;kCAClB,KAACU;wBAAOV,WAAU;kCAAU;;oBAC3BT,eAAeoB,GAAG,CAAC,CAACC,uBACnB,KAACxB;4BAECyB,MAAK;4BACLP,MAAK;4BACLQ,SAASjB,iBAAiBe,OAAOpB,KAAK,GAAG,YAAY;4BACrDuB,gBAAclB,iBAAiBe,OAAOpB,KAAK;4BAC3CwB,SAAS,IAAMlB,qBAAqBc,OAAOpB,KAAK;sCAE/CoB,OAAOnB,KAAK;2BAPRmB,OAAOpB,KAAK;;;;;AAa7B"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shown when a project has no workflow runs yet, in place of the empty rail and the
|
|
3
|
-
* perpetual detail skeleton the loading-driven layout would otherwise leave behind.
|
|
4
|
-
*/
|
|
5
|
-
export declare function WorkflowRunFirstTimeUse(): import("react").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=workflow-run-first-time-use.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-first-time-use.d.ts","sourceRoot":"","sources":["../../src/pages/workflow-run-first-time-use.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,uBAAuB,gCAUtC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { EmptyState } from '@shipfox/react-ui/empty-state';
|
|
3
|
-
/**
|
|
4
|
-
* Shown when a project has no workflow runs yet, in place of the empty rail and the
|
|
5
|
-
* perpetual detail skeleton the loading-driven layout would otherwise leave behind.
|
|
6
|
-
*/ export function WorkflowRunFirstTimeUse() {
|
|
7
|
-
return /*#__PURE__*/ _jsx("div", {
|
|
8
|
-
className: "flex min-h-0 flex-1 items-center justify-center p-16",
|
|
9
|
-
children: /*#__PURE__*/ _jsx(EmptyState, {
|
|
10
|
-
icon: "pulseLine",
|
|
11
|
-
title: "No workflow runs yet",
|
|
12
|
-
description: "Runs will appear here once this project's workflows start running."
|
|
13
|
-
})
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=workflow-run-first-time-use.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/workflow-run-first-time-use.tsx"],"sourcesContent":["import {EmptyState} from '@shipfox/react-ui/empty-state';\n\n/**\n * Shown when a project has no workflow runs yet, in place of the empty rail and the\n * perpetual detail skeleton the loading-driven layout would otherwise leave behind.\n */\nexport function WorkflowRunFirstTimeUse() {\n return (\n <div className=\"flex min-h-0 flex-1 items-center justify-center p-16\">\n <EmptyState\n icon=\"pulseLine\"\n title=\"No workflow runs yet\"\n description=\"Runs will appear here once this project's workflows start running.\"\n />\n </div>\n );\n}\n"],"names":["EmptyState","WorkflowRunFirstTimeUse","div","className","icon","title","description"],"mappings":";AAAA,SAAQA,UAAU,QAAO,gCAAgC;AAEzD;;;CAGC,GACD,OAAO,SAASC;IACd,qBACE,KAACC;QAAIC,WAAU;kBACb,cAAA,KAACH;YACCI,MAAK;YACLC,OAAM;YACNC,aAAY;;;AAIpB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type WorkflowRunsSearch } from '#routes/inputs.js';
|
|
2
|
-
interface WorkflowRunPageProps {
|
|
3
|
-
workspaceId: string;
|
|
4
|
-
projectId: string;
|
|
5
|
-
workflowRunId?: string | undefined;
|
|
6
|
-
search?: WorkflowRunsSearch;
|
|
7
|
-
}
|
|
8
|
-
export declare function WorkflowRunPage({ workspaceId, projectId, workflowRunId, search, }: WorkflowRunPageProps): import("react").JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=workflow-run-page.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-page.d.ts","sourceRoot":"","sources":["../../src/pages/workflow-run-page.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAC,KAAK,kBAAkB,EAA0B,MAAM,mBAAmB,CAAC;AAGnF,UAAU,oBAAoB;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAoCD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,SAAS,EACT,aAAa,EACb,MAAW,GACZ,EAAE,oBAAoB,+BAsCtB"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useNavigate } from '@tanstack/react-router';
|
|
3
|
-
import { useCallback, useEffect } from 'react';
|
|
4
|
-
import { WorkflowRunList } from '#components/workflow-run-list/workflow-run-list.js';
|
|
5
|
-
import { WorkflowRunView } from '#components/workflow-run-view/index.js';
|
|
6
|
-
import { useWorkflowRunsInfiniteQuery } from '#hooks/api/workflow-runs.js';
|
|
7
|
-
import { workflowRunSearchParams } from '#routes/inputs.js';
|
|
8
|
-
import { WorkflowRunFirstTimeUse } from './workflow-run-first-time-use.js';
|
|
9
|
-
/**
|
|
10
|
-
* Resolve which surface the runs path should show from a single read of the runs list:
|
|
11
|
-
* - when opened without a workflow run id, point the URL at the most recent run so the detail pane is
|
|
12
|
-
* never empty (navigation happens in an effect since it mutates history);
|
|
13
|
-
* - report `hasNoRuns` once the list has loaded with zero runs, so a brand-new project lands
|
|
14
|
-
* on the first-time-use surface instead of an empty rail and a perpetual detail skeleton.
|
|
15
|
-
*/ function useWorkflowRunPageTarget(workspaceId, projectId, workflowRunId, search) {
|
|
16
|
-
const navigate = useNavigate();
|
|
17
|
-
const { data, isPending } = useWorkflowRunsInfiniteQuery(projectId, {});
|
|
18
|
-
const firstWorkflowRunId = data?.pages[0]?.runs[0]?.id;
|
|
19
|
-
// Gate on data presence, not `!isError`: a transient refetch error after a prior success
|
|
20
|
-
// keeps `data`, so the redirect (and the no-runs surface) still resolve from it instead of
|
|
21
|
-
// stalling on the rail while active-run polling hits a blip.
|
|
22
|
-
const isLoaded = !isPending && data !== undefined;
|
|
23
|
-
useEffect(()=>{
|
|
24
|
-
if (workflowRunId || !isLoaded || !firstWorkflowRunId) return;
|
|
25
|
-
navigate({
|
|
26
|
-
to: '/workspaces/$wid/projects/$pid/runs/$workflowRunId',
|
|
27
|
-
params: {
|
|
28
|
-
wid: workspaceId,
|
|
29
|
-
pid: projectId,
|
|
30
|
-
workflowRunId: firstWorkflowRunId
|
|
31
|
-
},
|
|
32
|
-
search: workflowRunSearchParams(search, {}),
|
|
33
|
-
replace: true
|
|
34
|
-
});
|
|
35
|
-
}, [
|
|
36
|
-
navigate,
|
|
37
|
-
workspaceId,
|
|
38
|
-
projectId,
|
|
39
|
-
workflowRunId,
|
|
40
|
-
isLoaded,
|
|
41
|
-
firstWorkflowRunId,
|
|
42
|
-
search
|
|
43
|
-
]);
|
|
44
|
-
return {
|
|
45
|
-
hasNoRuns: isLoaded && firstWorkflowRunId === undefined
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
export function WorkflowRunPage({ workspaceId, projectId, workflowRunId, search = {} }) {
|
|
49
|
-
const { hasNoRuns } = useWorkflowRunPageTarget(workspaceId, projectId, workflowRunId, search);
|
|
50
|
-
const navigate = useNavigate();
|
|
51
|
-
const selection = search;
|
|
52
|
-
const onSelectionChange = useCallback((nextSelection)=>{
|
|
53
|
-
navigate({
|
|
54
|
-
search: workflowRunSearchParams(search, nextSelection)
|
|
55
|
-
});
|
|
56
|
-
}, [
|
|
57
|
-
navigate,
|
|
58
|
-
search
|
|
59
|
-
]);
|
|
60
|
-
if (!workflowRunId && hasNoRuns) {
|
|
61
|
-
return /*#__PURE__*/ _jsx(WorkflowRunFirstTimeUse, {});
|
|
62
|
-
}
|
|
63
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
64
|
-
className: "flex min-h-0 flex-1 overflow-hidden",
|
|
65
|
-
children: [
|
|
66
|
-
/*#__PURE__*/ _jsx(WorkflowRunList, {
|
|
67
|
-
workspaceId: workspaceId,
|
|
68
|
-
projectId: projectId,
|
|
69
|
-
selectedWorkflowRunId: workflowRunId,
|
|
70
|
-
search: search.search ?? '',
|
|
71
|
-
statusFilter: search.status ?? 'all',
|
|
72
|
-
onFiltersChange: (filters)=>navigate({
|
|
73
|
-
search: workflowRunSearchParams({
|
|
74
|
-
...search,
|
|
75
|
-
...filters
|
|
76
|
-
})
|
|
77
|
-
})
|
|
78
|
-
}),
|
|
79
|
-
/*#__PURE__*/ _jsx(WorkflowRunView, {
|
|
80
|
-
workspaceId: workspaceId,
|
|
81
|
-
projectId: projectId,
|
|
82
|
-
workflowRunId: workflowRunId,
|
|
83
|
-
selection: selection,
|
|
84
|
-
onSelectionChange: onSelectionChange
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
//# sourceMappingURL=workflow-run-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/workflow-run-page.tsx"],"sourcesContent":["import {useNavigate} from '@tanstack/react-router';\nimport {useCallback, useEffect} from 'react';\nimport {WorkflowRunList} from '#components/workflow-run-list/workflow-run-list.js';\nimport {WorkflowRunView} from '#components/workflow-run-view/index.js';\nimport type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';\nimport {useWorkflowRunsInfiniteQuery} from '#hooks/api/workflow-runs.js';\nimport {type WorkflowRunsSearch, workflowRunSearchParams} from '#routes/inputs.js';\nimport {WorkflowRunFirstTimeUse} from './workflow-run-first-time-use.js';\n\ninterface WorkflowRunPageProps {\n workspaceId: string;\n projectId: string;\n workflowRunId?: string | undefined;\n search?: WorkflowRunsSearch;\n}\n\n/**\n * Resolve which surface the runs path should show from a single read of the runs list:\n * - when opened without a workflow run id, point the URL at the most recent run so the detail pane is\n * never empty (navigation happens in an effect since it mutates history);\n * - report `hasNoRuns` once the list has loaded with zero runs, so a brand-new project lands\n * on the first-time-use surface instead of an empty rail and a perpetual detail skeleton.\n */\nfunction useWorkflowRunPageTarget(\n workspaceId: string,\n projectId: string,\n workflowRunId: string | undefined,\n search: WorkflowRunsSearch,\n) {\n const navigate = useNavigate();\n const {data, isPending} = useWorkflowRunsInfiniteQuery(projectId, {});\n const firstWorkflowRunId = data?.pages[0]?.runs[0]?.id;\n // Gate on data presence, not `!isError`: a transient refetch error after a prior success\n // keeps `data`, so the redirect (and the no-runs surface) still resolve from it instead of\n // stalling on the rail while active-run polling hits a blip.\n const isLoaded = !isPending && data !== undefined;\n\n useEffect(() => {\n if (workflowRunId || !isLoaded || !firstWorkflowRunId) return;\n navigate({\n to: '/workspaces/$wid/projects/$pid/runs/$workflowRunId',\n params: {wid: workspaceId, pid: projectId, workflowRunId: firstWorkflowRunId},\n search: workflowRunSearchParams(search, {}),\n replace: true,\n });\n }, [navigate, workspaceId, projectId, workflowRunId, isLoaded, firstWorkflowRunId, search]);\n\n return {hasNoRuns: isLoaded && firstWorkflowRunId === undefined};\n}\n\nexport function WorkflowRunPage({\n workspaceId,\n projectId,\n workflowRunId,\n search = {},\n}: WorkflowRunPageProps) {\n const {hasNoRuns} = useWorkflowRunPageTarget(workspaceId, projectId, workflowRunId, search);\n const navigate = useNavigate();\n const selection: WorkflowRunSelectionInput = search;\n const onSelectionChange = useCallback(\n (nextSelection: WorkflowRunSelectionInput) => {\n navigate({\n search: workflowRunSearchParams(search, nextSelection) as never,\n });\n },\n [navigate, search],\n );\n\n if (!workflowRunId && hasNoRuns) {\n return <WorkflowRunFirstTimeUse />;\n }\n\n return (\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <WorkflowRunList\n workspaceId={workspaceId}\n projectId={projectId}\n selectedWorkflowRunId={workflowRunId}\n search={search.search ?? ''}\n statusFilter={search.status ?? 'all'}\n onFiltersChange={(filters) =>\n navigate({search: workflowRunSearchParams({...search, ...filters}) as never})\n }\n />\n <WorkflowRunView\n workspaceId={workspaceId}\n projectId={projectId}\n workflowRunId={workflowRunId}\n selection={selection}\n onSelectionChange={onSelectionChange}\n />\n </div>\n );\n}\n"],"names":["useNavigate","useCallback","useEffect","WorkflowRunList","WorkflowRunView","useWorkflowRunsInfiniteQuery","workflowRunSearchParams","WorkflowRunFirstTimeUse","useWorkflowRunPageTarget","workspaceId","projectId","workflowRunId","search","navigate","data","isPending","firstWorkflowRunId","pages","runs","id","isLoaded","undefined","to","params","wid","pid","replace","hasNoRuns","WorkflowRunPage","selection","onSelectionChange","nextSelection","div","className","selectedWorkflowRunId","statusFilter","status","onFiltersChange","filters"],"mappings":";AAAA,SAAQA,WAAW,QAAO,yBAAyB;AACnD,SAAQC,WAAW,EAAEC,SAAS,QAAO,QAAQ;AAC7C,SAAQC,eAAe,QAAO,qDAAqD;AACnF,SAAQC,eAAe,QAAO,yCAAyC;AAEvE,SAAQC,4BAA4B,QAAO,8BAA8B;AACzE,SAAiCC,uBAAuB,QAAO,oBAAoB;AACnF,SAAQC,uBAAuB,QAAO,mCAAmC;AASzE;;;;;;CAMC,GACD,SAASC,yBACPC,WAAmB,EACnBC,SAAiB,EACjBC,aAAiC,EACjCC,MAA0B;IAE1B,MAAMC,WAAWb;IACjB,MAAM,EAACc,IAAI,EAAEC,SAAS,EAAC,GAAGV,6BAA6BK,WAAW,CAAC;IACnE,MAAMM,qBAAqBF,MAAMG,KAAK,CAAC,EAAE,EAAEC,IAAI,CAAC,EAAE,EAAEC;IACpD,yFAAyF;IACzF,2FAA2F;IAC3F,6DAA6D;IAC7D,MAAMC,WAAW,CAACL,aAAaD,SAASO;IAExCnB,UAAU;QACR,IAAIS,iBAAiB,CAACS,YAAY,CAACJ,oBAAoB;QACvDH,SAAS;YACPS,IAAI;YACJC,QAAQ;gBAACC,KAAKf;gBAAagB,KAAKf;gBAAWC,eAAeK;YAAkB;YAC5EJ,QAAQN,wBAAwBM,QAAQ,CAAC;YACzCc,SAAS;QACX;IACF,GAAG;QAACb;QAAUJ;QAAaC;QAAWC;QAAeS;QAAUJ;QAAoBJ;KAAO;IAE1F,OAAO;QAACe,WAAWP,YAAYJ,uBAAuBK;IAAS;AACjE;AAEA,OAAO,SAASO,gBAAgB,EAC9BnB,WAAW,EACXC,SAAS,EACTC,aAAa,EACbC,SAAS,CAAC,CAAC,EACU;IACrB,MAAM,EAACe,SAAS,EAAC,GAAGnB,yBAAyBC,aAAaC,WAAWC,eAAeC;IACpF,MAAMC,WAAWb;IACjB,MAAM6B,YAAuCjB;IAC7C,MAAMkB,oBAAoB7B,YACxB,CAAC8B;QACClB,SAAS;YACPD,QAAQN,wBAAwBM,QAAQmB;QAC1C;IACF,GACA;QAAClB;QAAUD;KAAO;IAGpB,IAAI,CAACD,iBAAiBgB,WAAW;QAC/B,qBAAO,KAACpB;IACV;IAEA,qBACE,MAACyB;QAAIC,WAAU;;0BACb,KAAC9B;gBACCM,aAAaA;gBACbC,WAAWA;gBACXwB,uBAAuBvB;gBACvBC,QAAQA,OAAOA,MAAM,IAAI;gBACzBuB,cAAcvB,OAAOwB,MAAM,IAAI;gBAC/BC,iBAAiB,CAACC,UAChBzB,SAAS;wBAACD,QAAQN,wBAAwB;4BAAC,GAAGM,MAAM;4BAAE,GAAG0B,OAAO;wBAAA;oBAAW;;0BAG/E,KAAClC;gBACCK,aAAaA;gBACbC,WAAWA;gBACXC,eAAeA;gBACfkB,WAAWA;gBACXC,mBAAmBA;;;;AAI3B"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import {Button} from '@shipfox/react-ui/button';
|
|
2
|
-
import {Icon} from '@shipfox/react-ui/icon';
|
|
3
|
-
import {Input} from '@shipfox/react-ui/input';
|
|
4
|
-
import type {WorkflowRunListStatusFilter} from './types.js';
|
|
5
|
-
|
|
6
|
-
const STATUS_FILTERS: Array<{value: WorkflowRunListStatusFilter; label: string}> = [
|
|
7
|
-
{value: 'all', label: 'All'},
|
|
8
|
-
{value: 'failed', label: 'Failed'},
|
|
9
|
-
{value: 'running', label: 'Running'},
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
interface WorkflowRunListHeaderProps {
|
|
13
|
-
query: string;
|
|
14
|
-
onQueryChange: (value: string) => void;
|
|
15
|
-
statusFilter: WorkflowRunListStatusFilter;
|
|
16
|
-
onStatusFilterChange: (value: WorkflowRunListStatusFilter) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function WorkflowRunListHeader({
|
|
20
|
-
query,
|
|
21
|
-
onQueryChange,
|
|
22
|
-
statusFilter,
|
|
23
|
-
onStatusFilterChange,
|
|
24
|
-
}: WorkflowRunListHeaderProps) {
|
|
25
|
-
return (
|
|
26
|
-
<div className="flex flex-col gap-8 border-b border-border-neutral-base px-12 py-12">
|
|
27
|
-
<Input
|
|
28
|
-
value={query}
|
|
29
|
-
onChange={(event) => onQueryChange(event.target.value)}
|
|
30
|
-
placeholder="Run id or trigger..."
|
|
31
|
-
aria-label="Search runs"
|
|
32
|
-
size="small"
|
|
33
|
-
iconLeft={<Icon name="searchLine" className="size-14 text-foreground-neutral-muted" />}
|
|
34
|
-
/>
|
|
35
|
-
|
|
36
|
-
<fieldset className="flex items-center gap-8">
|
|
37
|
-
<legend className="sr-only">Run status filter</legend>
|
|
38
|
-
{STATUS_FILTERS.map((filter) => (
|
|
39
|
-
<Button
|
|
40
|
-
key={filter.value}
|
|
41
|
-
type="button"
|
|
42
|
-
size="2xs"
|
|
43
|
-
variant={statusFilter === filter.value ? 'primary' : 'transparent'}
|
|
44
|
-
aria-pressed={statusFilter === filter.value}
|
|
45
|
-
onClick={() => onStatusFilterChange(filter.value)}
|
|
46
|
-
>
|
|
47
|
-
{filter.label}
|
|
48
|
-
</Button>
|
|
49
|
-
))}
|
|
50
|
-
</fieldset>
|
|
51
|
-
</div>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {EmptyState} from '@shipfox/react-ui/empty-state';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shown when a project has no workflow runs yet, in place of the empty rail and the
|
|
5
|
-
* perpetual detail skeleton the loading-driven layout would otherwise leave behind.
|
|
6
|
-
*/
|
|
7
|
-
export function WorkflowRunFirstTimeUse() {
|
|
8
|
-
return (
|
|
9
|
-
<div className="flex min-h-0 flex-1 items-center justify-center p-16">
|
|
10
|
-
<EmptyState
|
|
11
|
-
icon="pulseLine"
|
|
12
|
-
title="No workflow runs yet"
|
|
13
|
-
description="Runs will appear here once this project's workflows start running."
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import {useNavigate} from '@tanstack/react-router';
|
|
2
|
-
import {useCallback, useEffect} from 'react';
|
|
3
|
-
import {WorkflowRunList} from '#components/workflow-run-list/workflow-run-list.js';
|
|
4
|
-
import {WorkflowRunView} from '#components/workflow-run-view/index.js';
|
|
5
|
-
import type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';
|
|
6
|
-
import {useWorkflowRunsInfiniteQuery} from '#hooks/api/workflow-runs.js';
|
|
7
|
-
import {type WorkflowRunsSearch, workflowRunSearchParams} from '#routes/inputs.js';
|
|
8
|
-
import {WorkflowRunFirstTimeUse} from './workflow-run-first-time-use.js';
|
|
9
|
-
|
|
10
|
-
interface WorkflowRunPageProps {
|
|
11
|
-
workspaceId: string;
|
|
12
|
-
projectId: string;
|
|
13
|
-
workflowRunId?: string | undefined;
|
|
14
|
-
search?: WorkflowRunsSearch;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Resolve which surface the runs path should show from a single read of the runs list:
|
|
19
|
-
* - when opened without a workflow run id, point the URL at the most recent run so the detail pane is
|
|
20
|
-
* never empty (navigation happens in an effect since it mutates history);
|
|
21
|
-
* - report `hasNoRuns` once the list has loaded with zero runs, so a brand-new project lands
|
|
22
|
-
* on the first-time-use surface instead of an empty rail and a perpetual detail skeleton.
|
|
23
|
-
*/
|
|
24
|
-
function useWorkflowRunPageTarget(
|
|
25
|
-
workspaceId: string,
|
|
26
|
-
projectId: string,
|
|
27
|
-
workflowRunId: string | undefined,
|
|
28
|
-
search: WorkflowRunsSearch,
|
|
29
|
-
) {
|
|
30
|
-
const navigate = useNavigate();
|
|
31
|
-
const {data, isPending} = useWorkflowRunsInfiniteQuery(projectId, {});
|
|
32
|
-
const firstWorkflowRunId = data?.pages[0]?.runs[0]?.id;
|
|
33
|
-
// Gate on data presence, not `!isError`: a transient refetch error after a prior success
|
|
34
|
-
// keeps `data`, so the redirect (and the no-runs surface) still resolve from it instead of
|
|
35
|
-
// stalling on the rail while active-run polling hits a blip.
|
|
36
|
-
const isLoaded = !isPending && data !== undefined;
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (workflowRunId || !isLoaded || !firstWorkflowRunId) return;
|
|
40
|
-
navigate({
|
|
41
|
-
to: '/workspaces/$wid/projects/$pid/runs/$workflowRunId',
|
|
42
|
-
params: {wid: workspaceId, pid: projectId, workflowRunId: firstWorkflowRunId},
|
|
43
|
-
search: workflowRunSearchParams(search, {}),
|
|
44
|
-
replace: true,
|
|
45
|
-
});
|
|
46
|
-
}, [navigate, workspaceId, projectId, workflowRunId, isLoaded, firstWorkflowRunId, search]);
|
|
47
|
-
|
|
48
|
-
return {hasNoRuns: isLoaded && firstWorkflowRunId === undefined};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function WorkflowRunPage({
|
|
52
|
-
workspaceId,
|
|
53
|
-
projectId,
|
|
54
|
-
workflowRunId,
|
|
55
|
-
search = {},
|
|
56
|
-
}: WorkflowRunPageProps) {
|
|
57
|
-
const {hasNoRuns} = useWorkflowRunPageTarget(workspaceId, projectId, workflowRunId, search);
|
|
58
|
-
const navigate = useNavigate();
|
|
59
|
-
const selection: WorkflowRunSelectionInput = search;
|
|
60
|
-
const onSelectionChange = useCallback(
|
|
61
|
-
(nextSelection: WorkflowRunSelectionInput) => {
|
|
62
|
-
navigate({
|
|
63
|
-
search: workflowRunSearchParams(search, nextSelection) as never,
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
[navigate, search],
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
if (!workflowRunId && hasNoRuns) {
|
|
70
|
-
return <WorkflowRunFirstTimeUse />;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<div className="flex min-h-0 flex-1 overflow-hidden">
|
|
75
|
-
<WorkflowRunList
|
|
76
|
-
workspaceId={workspaceId}
|
|
77
|
-
projectId={projectId}
|
|
78
|
-
selectedWorkflowRunId={workflowRunId}
|
|
79
|
-
search={search.search ?? ''}
|
|
80
|
-
statusFilter={search.status ?? 'all'}
|
|
81
|
-
onFiltersChange={(filters) =>
|
|
82
|
-
navigate({search: workflowRunSearchParams({...search, ...filters}) as never})
|
|
83
|
-
}
|
|
84
|
-
/>
|
|
85
|
-
<WorkflowRunView
|
|
86
|
-
workspaceId={workspaceId}
|
|
87
|
-
projectId={projectId}
|
|
88
|
-
workflowRunId={workflowRunId}
|
|
89
|
-
selection={selection}
|
|
90
|
-
onSelectionChange={onSelectionChange}
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
);
|
|
94
|
-
}
|