@shipfox/client-workflows 14.0.0 → 15.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 +7 -2
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +35 -0
- package/dist/components/job-detail/agent-config-failure-callout.d.ts.map +1 -0
- package/dist/components/{workflow-run-view → job-detail}/agent-config-failure-callout.js +2 -2
- package/dist/components/job-detail/agent-config-failure-callout.js.map +1 -0
- package/dist/components/job-detail/job-detail-header.d.ts +8 -0
- package/dist/components/job-detail/job-detail-header.d.ts.map +1 -0
- package/dist/components/job-detail/job-detail-header.js +111 -0
- package/dist/components/job-detail/job-detail-header.js.map +1 -0
- package/dist/components/job-detail/job-detail-view.d.ts +16 -0
- package/dist/components/job-detail/job-detail-view.d.ts.map +1 -0
- package/dist/components/job-detail/job-detail-view.js +405 -0
- package/dist/components/job-detail/job-detail-view.js.map +1 -0
- package/dist/components/job-detail/job-empty-states.d.ts +10 -0
- package/dist/components/job-detail/job-empty-states.d.ts.map +1 -0
- package/dist/components/job-detail/job-empty-states.js +195 -0
- package/dist/components/job-detail/job-empty-states.js.map +1 -0
- package/dist/components/job-detail/job-execution-switcher.d.ts.map +1 -0
- package/dist/components/job-detail/job-execution-switcher.js.map +1 -0
- package/dist/components/job-detail/job-execution-time-text.d.ts.map +1 -0
- package/dist/components/job-detail/job-execution-time-text.js.map +1 -0
- package/dist/components/job-detail/job-selection.d.ts +24 -0
- package/dist/components/job-detail/job-selection.d.ts.map +1 -0
- package/dist/components/job-detail/job-selection.js +66 -0
- package/dist/components/job-detail/job-selection.js.map +1 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts +15 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts.map +1 -0
- package/dist/components/{workflow-run-view → job-detail}/step-attempt-log-panel.js +61 -16
- package/dist/components/job-detail/step-attempt-log-panel.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.js +1 -1
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/step-list/step-list-model.js +2 -2
- package/dist/components/step-list/step-list-model.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +1 -0
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js +29 -4
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.d.ts +9 -4
- package/dist/components/workflow-run-duration-label.d.ts.map +1 -1
- package/dist/components/workflow-run-duration-label.js +27 -7
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +6 -5
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +68 -64
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +0 -3
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/index.js +0 -3
- package/dist/components/workflow-run-tabs/index.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts +3 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.js +2 -2
- package/dist/components/workflow-run-tabs/run-annotations-empty.js.map +1 -1
- package/dist/components/workflow-run-view/index.d.ts +0 -1
- package/dist/components/workflow-run-view/index.d.ts.map +1 -1
- package/dist/components/workflow-run-view/index.js +0 -1
- package/dist/components/workflow-run-view/index.js.map +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts +20 -0
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts.map +1 -0
- package/dist/components/workflow-run-view/run-workspace-nav.js +271 -0
- package/dist/components/workflow-run-view/run-workspace-nav.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-selection.js +1 -14
- package/dist/components/workflow-run-view/workflow-run-selection.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +10 -8
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +250 -236
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -1
- package/dist/components/workflow-status/status-visuals.js +10 -2
- package/dist/components/workflow-status/status-visuals.js.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts +3 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.js +13 -2
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +9 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js +13 -3
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/step-attempt.d.ts.map +1 -1
- package/dist/core/entities/step.d.ts +2 -0
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js +13 -0
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +56 -1
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js +98 -0
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/workflow-run.d.ts +4 -4
- 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 +20 -16
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +5 -0
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/workflow-runs.d.ts +5 -3
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -1
- package/dist/hooks/api/workflow-runs.js +5 -4
- package/dist/hooks/api/workflow-runs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/workflow-job-detail-page.d.ts +11 -0
- package/dist/pages/workflow-job-detail-page.d.ts.map +1 -0
- package/dist/pages/workflow-job-detail-page.js +66 -0
- package/dist/pages/workflow-job-detail-page.js.map +1 -0
- package/dist/pages/workflow-run-detail-page.d.ts.map +1 -1
- package/dist/pages/workflow-run-detail-page.js +4 -37
- package/dist/pages/workflow-run-detail-page.js.map +1 -1
- package/dist/routes/inputs.d.ts +47 -34
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +69 -37
- package/dist/routes/inputs.js.map +1 -1
- package/dist/routes/job-detail.d.ts +10 -0
- package/dist/routes/job-detail.d.ts.map +1 -0
- package/dist/routes/job-detail.js +27 -0
- package/dist/routes/job-detail.js.map +1 -0
- package/dist/routes/project-route.d.ts +1 -1
- package/dist/routes/run-detail.d.ts.map +1 -1
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/components/{workflow-run-view → job-detail}/agent-config-failure-callout.stories.tsx +1 -1
- package/src/components/{workflow-run-view → job-detail}/agent-config-failure-callout.tsx +2 -2
- package/src/components/job-detail/job-detail-header.test.tsx +31 -0
- package/src/components/job-detail/job-detail-header.tsx +111 -0
- package/src/components/job-detail/job-detail-view.stories.tsx +526 -0
- package/src/components/job-detail/job-detail-view.tsx +450 -0
- package/src/components/job-detail/job-empty-states.test.ts +27 -0
- package/src/components/job-detail/job-empty-states.tsx +248 -0
- package/src/components/job-detail/job-selection.test.ts +188 -0
- package/src/components/job-detail/job-selection.ts +96 -0
- package/src/components/{workflow-run-view → job-detail}/step-attempt-log-panel.test.tsx +32 -9
- package/src/components/{workflow-run-view → job-detail}/step-attempt-log-panel.tsx +52 -18
- package/src/components/job-graph/job-graph-content.tsx +1 -1
- package/src/components/step-list/step-list-model.test.ts +1 -1
- package/src/components/step-list/step-list-model.ts +2 -2
- package/src/components/step-list/step-list.stories.tsx +1 -1
- package/src/components/step-list/step-list.test.tsx +33 -0
- package/src/components/step-list/step-list.tsx +40 -9
- package/src/components/workflow-run-duration-label.tsx +50 -12
- package/src/components/workflow-run-list/workflow-run-row.tsx +6 -4
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +38 -0
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +79 -5
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +56 -60
- package/src/components/workflow-run-tabs/index.ts +0 -3
- package/src/components/workflow-run-tabs/run-annotations-empty.tsx +6 -2
- package/src/components/workflow-run-view/index.ts +0 -1
- package/src/components/workflow-run-view/run-workspace-nav.test.tsx +242 -0
- package/src/components/workflow-run-view/run-workspace-nav.tsx +301 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +1 -23
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +62 -1136
- package/src/components/workflow-run-view/workflow-run-view.tsx +330 -321
- package/src/components/workflow-status/status-visuals.ts +5 -2
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +1 -0
- package/src/components/workflow-status/workflow-status-icon.tsx +26 -1
- package/src/core/entities/job-execution.ts +17 -2
- package/src/core/entities/step.ts +26 -0
- package/src/core/entities/workflow-run-display.test.ts +159 -0
- package/src/core/entities/workflow-run.ts +139 -1
- package/src/core/workflow-run.ts +16 -1
- package/src/feature.ts +5 -0
- package/src/hooks/api/workflow-runs.ts +6 -2
- package/src/index.ts +1 -0
- package/src/page-harness-budget.test.ts +1 -0
- package/src/pages/workflow-job-detail-page.test.tsx +539 -0
- package/src/pages/workflow-job-detail-page.tsx +84 -0
- package/src/pages/workflow-run-detail-page.tsx +3 -43
- package/src/pages/workflow-run-pages.test.tsx +77 -332
- package/src/routes/inputs.test.ts +56 -6
- package/src/routes/inputs.ts +64 -17
- package/src/routes/job-detail.tsx +29 -0
- package/test/pages.tsx +25 -3
- package/test/render.tsx +6 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts +0 -18
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-jobs-list.js +0 -107
- package/dist/components/workflow-run-tabs/run-jobs-list.js.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts +0 -6
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-count.js +0 -27
- package/dist/components/workflow-run-tabs/run-tab-count.js.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts +0 -8
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-strip.js +0 -82
- package/dist/components/workflow-run-tabs/run-tab-strip.js.map +0 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts.map +0 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.js.map +0 -1
- package/dist/components/workflow-run-view/job-card.d.ts +0 -17
- package/dist/components/workflow-run-view/job-card.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-card.js +0 -496
- package/dist/components/workflow-run-view/job-card.js.map +0 -1
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-execution-switcher.js.map +0 -1
- package/dist/components/workflow-run-view/job-execution-time-text.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-execution-time-text.js.map +0 -1
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts +0 -9
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts.map +0 -1
- package/dist/components/workflow-run-view/step-attempt-log-panel.js.map +0 -1
- package/src/components/workflow-run-tabs/run-jobs-list.tsx +0 -151
- package/src/components/workflow-run-tabs/run-tab-count.tsx +0 -28
- package/src/components/workflow-run-tabs/run-tab-strip.stories.tsx +0 -52
- package/src/components/workflow-run-tabs/run-tab-strip.test.tsx +0 -117
- package/src/components/workflow-run-tabs/run-tab-strip.tsx +0 -97
- package/src/components/workflow-run-view/job-card.stories.tsx +0 -789
- package/src/components/workflow-run-view/job-card.test.tsx +0 -115
- package/src/components/workflow-run-view/job-card.tsx +0 -614
- /package/dist/components/{workflow-run-view → job-detail}/agent-config-failure-callout.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-switcher.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-switcher.js +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-time-text.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-time-text.js +0 -0
- /package/src/components/{workflow-run-view → job-detail}/job-execution-switcher.tsx +0 -0
- /package/src/components/{workflow-run-view → job-detail}/job-execution-time-text.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/client-workflows",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "15.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"date-fns": "^4.1.0",
|
|
30
30
|
"@shipfox/api-definitions-dto": "12.0.0",
|
|
31
31
|
"@shipfox/api-workflows-dto": "12.1.0",
|
|
32
|
-
"@shipfox/client-logs": "14.0.0",
|
|
33
32
|
"@shipfox/client-api": "6.0.1",
|
|
34
|
-
"@shipfox/client-
|
|
35
|
-
"@shipfox/client-
|
|
36
|
-
"@shipfox/client-
|
|
37
|
-
"@shipfox/client-
|
|
38
|
-
"@shipfox/
|
|
33
|
+
"@shipfox/client-logs": "14.0.1",
|
|
34
|
+
"@shipfox/client-projects": "15.0.0",
|
|
35
|
+
"@shipfox/client-shell": "14.0.1",
|
|
36
|
+
"@shipfox/client-triggers": "15.0.0",
|
|
37
|
+
"@shipfox/client-ui": "14.0.1",
|
|
38
|
+
"@shipfox/react-ui": "1.0.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@tanstack/react-query": "^5.101.0",
|
|
@@ -61,13 +61,13 @@ function agentConfigFailureCopy(
|
|
|
61
61
|
};
|
|
62
62
|
case 'provider_unsupported':
|
|
63
63
|
return {
|
|
64
|
-
title:
|
|
64
|
+
title: 'Choose a supported model provider',
|
|
65
65
|
description: `This step references ${provider}, which is not available to the agent runner. Update the workflow to use a supported provider, then re-run it.`,
|
|
66
66
|
showProviderCta: false,
|
|
67
67
|
};
|
|
68
68
|
case 'model_unavailable':
|
|
69
69
|
return {
|
|
70
|
-
title:
|
|
70
|
+
title: 'Choose an available model',
|
|
71
71
|
description: `This step uses ${model} with ${provider}, but that model is not available for the provider. Update the model or provider in the workflow, then re-run it.`,
|
|
72
72
|
showProviderCta: false,
|
|
73
73
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {render, screen} from '@testing-library/react';
|
|
2
|
+
import {workflowJob, workflowJobExecutionDto} from '#test/fixtures/workflow-run.js';
|
|
3
|
+
import {JobDetailHeader} from './job-detail-header.js';
|
|
4
|
+
|
|
5
|
+
describe('JobDetailHeader', () => {
|
|
6
|
+
test('labels a live run duration as running', () => {
|
|
7
|
+
vi.spyOn(Date, 'now').mockReturnValue(Date.parse('2026-06-26T12:00:00.000Z'));
|
|
8
|
+
const job = workflowJob({
|
|
9
|
+
status: 'running',
|
|
10
|
+
job_executions: [
|
|
11
|
+
workflowJobExecutionDto({
|
|
12
|
+
status: 'running',
|
|
13
|
+
queued_at: '2026-06-26T11:54:00.000Z',
|
|
14
|
+
started_at: '2026-06-26T11:57:46.000Z',
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
});
|
|
18
|
+
const execution = job.jobExecutions[0];
|
|
19
|
+
if (!execution) throw new Error('Expected a job execution');
|
|
20
|
+
|
|
21
|
+
render(
|
|
22
|
+
<JobDetailHeader
|
|
23
|
+
job={job}
|
|
24
|
+
selectedJobExecution={execution}
|
|
25
|
+
onSelectedJobExecutionChange={vi.fn()}
|
|
26
|
+
/>,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
expect(screen.getByText('running', {exact: true})).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {Icon} from '@shipfox/react-ui/icon';
|
|
2
|
+
import {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';
|
|
3
|
+
import {Code, Text} from '@shipfox/react-ui/typography';
|
|
4
|
+
import {formatTimestamp} from '@shipfox/react-ui/utils';
|
|
5
|
+
import {getWorkflowStatusVisual} from '#components/workflow-status/status-visuals.js';
|
|
6
|
+
import {WorkflowStatusIcon} from '#components/workflow-status/workflow-status-icon.js';
|
|
7
|
+
import {
|
|
8
|
+
defaultJobExecution,
|
|
9
|
+
deriveJobDisplayStatus,
|
|
10
|
+
deriveJobExecutionDisplayStatus,
|
|
11
|
+
type Job,
|
|
12
|
+
type JobExecution,
|
|
13
|
+
} from '#core/workflow-run.js';
|
|
14
|
+
import {JobExecutionSwitcher} from './job-execution-switcher.js';
|
|
15
|
+
import {JobExecutionTimeText} from './job-execution-time-text.js';
|
|
16
|
+
|
|
17
|
+
export interface JobDetailHeaderProps {
|
|
18
|
+
job: Job;
|
|
19
|
+
selectedJobExecution: JobExecution | undefined;
|
|
20
|
+
onSelectedJobExecutionChange: (jobExecutionId: string) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function JobDetailHeader({
|
|
24
|
+
job,
|
|
25
|
+
selectedJobExecution,
|
|
26
|
+
onSelectedJobExecutionChange,
|
|
27
|
+
}: JobDetailHeaderProps) {
|
|
28
|
+
const selectedStatus = selectedExecutionStatus(job, selectedJobExecution);
|
|
29
|
+
const jobStatus = getWorkflowStatusVisual(selectedStatus);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<header className="border-b border-border-neutral-base px-16 py-12">
|
|
33
|
+
<div className="flex min-w-0 flex-col gap-8">
|
|
34
|
+
<div className="flex min-w-0 items-center gap-8">
|
|
35
|
+
<WorkflowStatusIcon
|
|
36
|
+
status={selectedStatus}
|
|
37
|
+
size={14}
|
|
38
|
+
tooltip
|
|
39
|
+
ariaLabel={`Job status: ${jobStatus.label}`}
|
|
40
|
+
/>
|
|
41
|
+
<Code
|
|
42
|
+
as="h1"
|
|
43
|
+
variant="paragraph"
|
|
44
|
+
bold
|
|
45
|
+
tabIndex={-1}
|
|
46
|
+
className="min-w-0 truncate text-lg leading-24 text-foreground-neutral-base outline-none"
|
|
47
|
+
data-job-heading
|
|
48
|
+
>
|
|
49
|
+
{job.displayName}
|
|
50
|
+
</Code>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
{selectedJobExecution ? (
|
|
54
|
+
<div className="flex min-w-0 flex-wrap items-center gap-10 text-foreground-neutral-muted">
|
|
55
|
+
{job.executionCountVisible ? (
|
|
56
|
+
<JobExecutionSwitcher
|
|
57
|
+
job={job}
|
|
58
|
+
selectedJobExecution={selectedJobExecution.id}
|
|
59
|
+
onSelectedJobExecutionChange={onSelectedJobExecutionChange}
|
|
60
|
+
variant="title"
|
|
61
|
+
/>
|
|
62
|
+
) : null}
|
|
63
|
+
<JobDurationMeta execution={selectedJobExecution} kind="queue" />
|
|
64
|
+
<JobDurationMeta execution={selectedJobExecution} kind="run" />
|
|
65
|
+
</div>
|
|
66
|
+
) : null}
|
|
67
|
+
</div>
|
|
68
|
+
</header>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function selectedExecutionStatus(job: Job, execution: JobExecution | undefined) {
|
|
73
|
+
if (!execution) return deriveJobDisplayStatus(job);
|
|
74
|
+
const defaultExecution = defaultJobExecution(job);
|
|
75
|
+
return execution.id === defaultExecution?.id
|
|
76
|
+
? deriveJobDisplayStatus(job)
|
|
77
|
+
: deriveJobExecutionDisplayStatus(execution);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function JobDurationMeta({execution, kind}: {execution: JobExecution; kind: 'queue' | 'run'}) {
|
|
81
|
+
const time = kind === 'queue' ? execution.queueTime : execution.runTime;
|
|
82
|
+
const from = kind === 'queue' ? execution.queuedAt : execution.startedAt;
|
|
83
|
+
if (!time || !from) return null;
|
|
84
|
+
|
|
85
|
+
const to = kind === 'queue' ? execution.startedAt : execution.finishedAt;
|
|
86
|
+
const live = time.state === 'live';
|
|
87
|
+
const label = kind === 'queue' ? 'queued' : live ? 'running' : 'ran';
|
|
88
|
+
const tooltipLabel = kind === 'queue' ? 'Queued' : live ? 'Running' : 'Ran';
|
|
89
|
+
const tooltip = `${tooltipLabel} ${formatTimestamp(from)}${to ? ` – ${formatTimestamp(to)}` : ' – now'}`;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Tooltip>
|
|
93
|
+
<TooltipTrigger asChild>
|
|
94
|
+
<span className="inline-flex items-center gap-4 whitespace-nowrap font-code text-xs leading-20 tabular-nums">
|
|
95
|
+
<Icon
|
|
96
|
+
name={kind === 'queue' ? 'hourglassLine' : 'timerLine'}
|
|
97
|
+
size={12}
|
|
98
|
+
aria-hidden="true"
|
|
99
|
+
/>
|
|
100
|
+
<span>{label} </span>
|
|
101
|
+
<JobExecutionTimeText time={time} />
|
|
102
|
+
</span>
|
|
103
|
+
</TooltipTrigger>
|
|
104
|
+
<TooltipContent>
|
|
105
|
+
<Text as="span" size="xs">
|
|
106
|
+
{tooltip}
|
|
107
|
+
</Text>
|
|
108
|
+
</TooltipContent>
|
|
109
|
+
</Tooltip>
|
|
110
|
+
);
|
|
111
|
+
}
|