Skip to content

Commit

Permalink
DT-1654 - add scheduled by id and scheduled start time to workflow ta…
Browse files Browse the repository at this point in the history
…ble columns (#1785)

* add scheduled by id and scheduled start time to workflow table columns

* update tests/snaps
  • Loading branch information
rossedfort committed Jan 5, 2024
1 parent 8de6b50 commit 6aceea0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@
})}
{:else if label === 'History Length'}
{parseInt(workflow.historyEvents, 10) > 0 ? workflow.historyEvents : ''}
{:else if label === 'Scheduled By ID'}
{workflow.searchAttributes?.indexedFields?.TemporalScheduledById ?? ''}
{:else if label === 'Scheduled Start Time'}
{@const content =
workflow.searchAttributes?.indexedFields?.TemporalScheduledStartTime}
{content && typeof content === 'string'
? formatDate(content, $timeFormat, { relative: $relativeTime })
: ''}
{:else if isCustomSearchAttribute(label) && workflowIncludesSearchAttribute(workflow, label)}
{@const content = workflow.searchAttributes.indexedFields[label]}
{#if $customSearchAttributes[label] === 'Datetime' && typeof content === 'string'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ exports[`Table_body_cell$ > Parent Namespace renders 1`] = `"<td class=\\"workfl
exports[`Table_body_cell$ > Run ID renders 1`] = `"<td class=\\"workflows-summary-table-body-cell filterable svelte-qupenl\\" data-testid=\\"workflows-summary-table-body-cell\\"><a href=\\"/namespaces/default/workflows/abc-123/def-456/history\\" class=\\"link inline svelte-1f9ld6i\\"> def-456</a> </td>"`;
exports[`Table_body_cell$ > Scheduled By ID renders 1`] = `"<td class=\\"workflows-summary-table-body-cell svelte-qupenl\\" data-testid=\\"workflows-summary-table-body-cell\\">schedule_abc-123</td>"`;
exports[`Table_body_cell$ > Scheduled Start Time renders 1`] = `"<td class=\\"workflows-summary-table-body-cell svelte-qupenl\\" data-testid=\\"workflows-summary-table-body-cell\\">2024-01-05 UTC 00:00:00.00</td>"`;
exports[`Table_body_cell$ > Start renders 1`] = `"<td class=\\"workflows-summary-table-body-cell svelte-qupenl\\" data-testid=\\"workflows-summary-table-body-cell\\">2023-04-27 UTC 00:00:00.00</td>"`;
exports[`Table_body_cell$ > State Transitions renders 1`] = `"<td class=\\"workflows-summary-table-body-cell svelte-qupenl\\" data-testid=\\"workflows-summary-table-body-cell\\">12</td>"`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ exports[`Table_header_cell$ > Parent Namespace renders 1`] = `"<th class=\\"work
exports[`Table_header_cell$ > Run ID renders 1`] = `"<th class=\\"workflows-summary-table-header-cell svelte-x2wk3\\" data-testid=\\"workflows-summary-table-header-cell-Run ID\\">Run ID</th>"`;
exports[`Table_header_cell$ > Scheduled By ID renders 1`] = `"<th class=\\"workflows-summary-table-header-cell svelte-x2wk3\\" data-testid=\\"workflows-summary-table-header-cell-Scheduled By ID\\">Scheduled By ID</th>"`;
exports[`Table_header_cell$ > Scheduled Start Time renders 1`] = `"<th class=\\"workflows-summary-table-header-cell svelte-x2wk3\\" data-testid=\\"workflows-summary-table-header-cell-Scheduled Start Time\\">Scheduled Start Time</th>"`;
exports[`Table_header_cell$ > Start renders 1`] = `"<th class=\\"workflows-summary-table-header-cell svelte-x2wk3\\" data-testid=\\"workflows-summary-table-header-cell-Start\\">Start</th>"`;
exports[`Table_header_cell$ > State Transitions renders 1`] = `"<th class=\\"workflows-summary-table-header-cell svelte-x2wk3\\" data-testid=\\"workflows-summary-table-header-cell-State Transitions\\">State Transitions</th>"`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const workflow: WorkflowExecution = {
workflowId: 'parent-workflow-id',
},
parentNamespaceId: 'parent-namespace-id',
searchAttributes: {},
searchAttributes: {
indexedFields: {
TemporalScheduledById: 'schedule_abc-123',
TemporalScheduledStartTime: '2024-01-05T00:00:00.000000000Z',
},
},
pendingChildren: [],
pendingActivities: [],
stateTransitionCount: '12',
Expand Down
4 changes: 4 additions & 0 deletions src/lib/stores/workflow-table-columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export const WorkflowHeaderLabels = [
'State Transitions',
'Parent Namespace',
'Task Queue',
'Scheduled By ID',
'Scheduled Start Time',
] as const;

export type WorkflowHeaderLabel = (typeof WorkflowHeaderLabels)[number];
Expand Down Expand Up @@ -74,6 +76,8 @@ const DEFAULT_AVAILABLE_COLUMNS: WorkflowHeader[] = [
{ label: 'State Transitions', pinned: false },
{ label: 'Parent Namespace', pinned: false },
{ label: 'Task Queue', pinned: false },
{ label: 'Scheduled By ID', pinned: false },
{ label: 'Scheduled Start Time', pinned: false },
];

const isNotParentWorkflowIdColumn = (column: WorkflowHeader) =>
Expand Down

0 comments on commit 6aceea0

Please sign in to comment.