add continue on failure in task block (#982)

This commit is contained in:
Shuchang Zheng
2024-10-15 12:26:25 -07:00
committed by GitHub
parent 9048cdfa73
commit 575dd356fe
3 changed files with 23 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
maxRetries: data.maxRetries,
maxStepsOverride: data.maxStepsOverride,
allowDownloads: data.allowDownloads,
continueOnFailure: data.continueOnFailure,
downloadSuffix: data.downloadSuffix,
errorCodeMapping: data.errorCodeMapping,
totpVerificationUrl: data.totpVerificationUrl,
@@ -333,6 +334,24 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
/>
</div>
</div>
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Label className="text-xs font-normal text-slate-300">
Continue on Failure
</Label>
</div>
<div className="w-52">
<Switch
checked={inputs.continueOnFailure}
onCheckedChange={(checked) => {
if (!editable) {
return;
}
handleChange("continueOnFailure", checked);
}}
/>
</div>
</div>
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Label className="text-xs font-normal text-slate-300">

View File

@@ -15,6 +15,7 @@ export type TaskNodeData = {
parameterKeys: Array<string>;
totpVerificationUrl: string | null;
totpIdentifier: string | null;
continueOnFailure: boolean;
};
export type TaskNode = Node<TaskNodeData, "task">;
@@ -36,6 +37,7 @@ export const taskNodeDefaultData: TaskNodeData = {
parameterKeys: [],
totpVerificationUrl: null,
totpIdentifier: null,
continueOnFailure: false,
} as const;
export function isTaskNode(node: Node): node is TaskNode {

View File

@@ -147,6 +147,7 @@ function convertToNode(
parameterKeys: block.parameters.map((p) => p.key),
totpIdentifier: block.totp_identifier ?? null,
totpVerificationUrl: block.totp_verification_url ?? null,
continueOnFailure: block.continue_on_failure,
},
};
}
@@ -518,6 +519,7 @@ function getWorkflowBlock(
parameter_keys: node.data.parameterKeys,
totp_identifier: node.data.totpIdentifier,
totp_verification_url: node.data.totpVerificationUrl,
continue_on_failure: node.data.continueOnFailure,
};
}
case "sendEmail": {