Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DT-1654 - add scheduled by id and scheduled start time to workflow table columns #1785

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 })
Comment on lines +106 to +111
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these decoded already? I know they don't need to go to the codec server but they are payloads so need to be base64 decoded

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, they are decoded when we get them back from the server: https://github.com/temporalio/ui/blob/main/src/lib/models/workflow-execution.ts#L39

: ''}
{: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
Loading