Skip to content

Commit 9da6513

Browse files
authored
Added cancel/terminate cli commands (#1008)
* Added cancel/terminate cli commands. * Also made sure the modal stays within screen boundaries and commands are scrollable.
1 parent 77c76d8 commit 9da6513

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

src/views/workflow-page/config/workflow-page-cli-commands.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@ const workflowPageCliCommandsConfig: CliCommandConfig[] = [
8686
'cadence workflow {list|listall} --query \'(CustomKeywordField = "keyword1" and CustomIntField >= 5) or CustomKeywordField = "keyword2" and CloseTime = missing\'',
8787
group: 'workflow',
8888
},
89+
{
90+
label: 'Cancel a workflow',
91+
command:
92+
'cadence --domain {domain-name} workflow cancel -w {workflow-id} -r {run-id} --reason {reason details}',
93+
description:
94+
'Cancel a workflow, recording WorkflowExecutionCancelRequested event and allowing for clean up work after cancellation',
95+
group: 'workflow',
96+
},
97+
{
98+
label: 'Terminate a workflow',
99+
command:
100+
'cadence --domain {domain-name} workflow terminate -w {workflow-id} -r {run-id} --reason {reason details}',
101+
description:
102+
'Terminate a workflow immediately, recording WorkflowExecutionTerminated event as the closing event in the history',
103+
group: 'workflow',
104+
},
89105
];
90106

91107
export default workflowPageCliCommandsConfig;

src/views/workflow-page/workflow-page-cli-commands-modal/workflow-page-cli-commands-modal.styles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ const cssStylesObj = {
5454
marginTop: theme.sizing.scale300,
5555
...theme.typography.ParagraphXSmall,
5656
}),
57+
commandsScrollContainer: (theme) => ({
58+
maxHeight: '60vh',
59+
overflowY: 'auto',
60+
paddingRight: theme.sizing.scale300,
61+
}),
5762
} satisfies StyletronCSSObject;
5863

5964
export const cssStyles: StyletronCSSObjectOf<typeof cssStylesObj> =

src/views/workflow-page/workflow-page-cli-commands-modal/workflow-page-cli-commands-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function WorkflowPageCliCommandsModal({
5858
<Tab key={name} title={title} />
5959
))}
6060
</Tabs>
61-
<div>
61+
<div className={cls.commandsScrollContainer}>
6262
{currentTabCommands.map(({ label, command, description }) => (
6363
<div key={label} className={cls.rowContainer}>
6464
<div className={cls.rowLabel}>{label}</div>

0 commit comments

Comments
 (0)