Skip to content

Commit 07b7447

Browse files
committed
Added Run tab in workflow page
1 parent 0d46a56 commit 07b7447

File tree

3 files changed

+50
-13
lines changed

3 files changed

+50
-13
lines changed

components/src/lib/types/api.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ export type HistoryUnit = {
311311

312312
export type HistoryRunAggregated = {
313313
id: number;
314+
timestamp_started: string;
315+
version: string | null;
314316
workflowtask_dump: WorkflowTaskV2;
315317
num_submitted_units: number;
316318
num_done_units: number;

src/routes/v2/projects/[projectId]/workflows/[workflowId]/+page.svelte

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import RunStatusModal from '$lib/components/jobs/RunStatusModal.svelte';
2828
import { navigating, navigationCancelled } from '$lib/stores';
2929
import { writable } from 'svelte/store';
30+
import TimestampCell from '$lib/components/jobs/TimestampCell.svelte';
3031
3132
/** @type {number|undefined} */
3233
const defaultDatasetId = $derived(page.data.defaultDatasetId);
@@ -970,7 +971,8 @@
970971
class="nav-link {workflowTabContextId === 0 ? 'active' : ''}"
971972
onclick={() => setWorkflowTabContextId(0)}
972973
aria-current={workflowTabContextId === 0}
973-
>Arguments
974+
>
975+
Arguments
974976
</button>
975977
</li>
976978
<li class="nav-item">
@@ -982,29 +984,40 @@
982984
Meta
983985
</button>
984986
</li>
987+
{#if selectedHistoryRun}
988+
<li>
989+
<button
990+
class="nav-link {workflowTabContextId === 2 ? 'active' : ''}"
991+
onclick={() => setWorkflowTabContextId(2)}
992+
aria-current={workflowTabContextId === 2}
993+
>
994+
Run
995+
</button>
996+
</li>
997+
{/if}
985998
<li class="nav-item">
986999
<button
987-
class="nav-link {workflowTabContextId === 2 ? 'active' : ''}"
988-
onclick={() => setWorkflowTabContextId(2)}
989-
aria-current={workflowTabContextId === 2}
1000+
class="nav-link {workflowTabContextId === 3 ? 'active' : ''}"
1001+
onclick={() => setWorkflowTabContextId(3)}
1002+
aria-current={workflowTabContextId === 3}
9901003
>
9911004
Info
9921005
</button>
9931006
</li>
9941007
<li class="nav-item">
9951008
<button
996-
class="nav-link {workflowTabContextId === 3 ? 'active' : ''}"
997-
onclick={() => setWorkflowTabContextId(3)}
998-
aria-current={workflowTabContextId === 3}
1009+
class="nav-link {workflowTabContextId === 4 ? 'active' : ''}"
1010+
onclick={() => setWorkflowTabContextId(4)}
1011+
aria-current={workflowTabContextId === 4}
9991012
>
10001013
Types
10011014
</button>
10021015
</li>
10031016
<li class="nav-item">
10041017
<button
1005-
class="nav-link {workflowTabContextId === 4 ? 'active' : ''}"
1006-
onclick={() => setWorkflowTabContextId(4)}
1007-
aria-current={workflowTabContextId === 4}
1018+
class="nav-link {workflowTabContextId === 5 ? 'active' : ''}"
1019+
onclick={() => setWorkflowTabContextId(5)}
1020+
aria-current={workflowTabContextId === 5}
10081021
>
10091022
Version
10101023
{#if $newVersionsCount}
@@ -1080,14 +1093,29 @@
10801093
</div>
10811094
</div>
10821095
{:else if workflowTabContextId === 2}
1096+
<div id="run-tab" class="tab-pane show active">
1097+
<div class="card-body">
1098+
{#if selectedHistoryRun}
1099+
<ul class="list-group">
1100+
<li class="list-group-item list-group-item-light fw-bold">Started</li>
1101+
<li class="list-group-item">
1102+
<TimestampCell timestamp={selectedHistoryRun.timestamp_started} />
1103+
</li>
1104+
<li class="list-group-item list-group-item-light fw-bold">Version</li>
1105+
<li class="list-group-item">{selectedHistoryRun.version || '-'}</li>
1106+
</ul>
1107+
{/if}
1108+
</div>
1109+
</div>
1110+
{:else if workflowTabContextId === 3}
10831111
<div id="info-tab" class="tab-pane show active">
10841112
<div class="card-body">
10851113
{#if selectedWorkflowTask}
10861114
<TaskInfoTab task={selectedWorkflowTask.task} />
10871115
{/if}
10881116
</div>
10891117
</div>
1090-
{:else if workflowTabContextId === 3}
1118+
{:else if workflowTabContextId === 4}
10911119
{#if selectedWorkflowTask}
10921120
<InputFiltersTab
10931121
{workflow}
@@ -1101,8 +1129,8 @@
11011129
<div
11021130
id="version-tab"
11031131
class="tab-pane"
1104-
class:show={workflowTabContextId === 4}
1105-
class:active={workflowTabContextId === 4}
1132+
class:show={workflowTabContextId === 5}
1133+
class:active={workflowTabContextId === 5}
11061134
>
11071135
<div class="card-body">
11081136
{#if selectedWorkflowTask}

tests/v2/workflow_task_run_schema_version_changes.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ test('Workflow task runs display different versions of arguments schema', async
104104
await expect(page.getByRole('spinbutton')).toBeDisabled();
105105
});
106106

107+
await test.step('Check runs tab', async () => {
108+
await page.getByRole('button', { name: 'Run', exact: true }).click();
109+
await expect(page.locator('#run-tab').getByText('0.0.2')).toBeVisible();
110+
await page.getByRole('button', { name: 'Run 1' }).click();
111+
await expect(page.locator('#run-tab').getByText('0.0.1')).toBeVisible();
112+
});
113+
107114
await test.step('Delete older task version', async () => {
108115
await page.goto('/v2/tasks/management');
109116
const taskRow = page.getByRole('row', { name: taskName });

0 commit comments

Comments
 (0)