Add download suffix to workflow editor (#817)
This commit is contained in:
@@ -41,6 +41,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
maxRetries: data.maxRetries,
|
maxRetries: data.maxRetries,
|
||||||
maxStepsOverride: data.maxStepsOverride,
|
maxStepsOverride: data.maxStepsOverride,
|
||||||
allowDownloads: data.allowDownloads,
|
allowDownloads: data.allowDownloads,
|
||||||
|
downloadSuffix: data.downloadSuffix,
|
||||||
errorCodeMapping: data.errorCodeMapping,
|
errorCodeMapping: data.errorCodeMapping,
|
||||||
totpVerificationUrl: data.totpVerificationUrl,
|
totpVerificationUrl: data.totpVerificationUrl,
|
||||||
totpIdentifier: data.totpIdentifier,
|
totpIdentifier: data.totpIdentifier,
|
||||||
@@ -224,7 +225,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<Label className="text-xs font-normal text-slate-300">
|
<Label className="text-xs font-normal text-slate-300">
|
||||||
Allow Downloads
|
Allow Downloads
|
||||||
</Label>
|
</Label>
|
||||||
@@ -240,6 +241,23 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<Label className="text-xs font-normal text-slate-300">
|
||||||
|
Download Suffix
|
||||||
|
</Label>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Suffix"
|
||||||
|
className="nopan w-44"
|
||||||
|
value={inputs.downloadSuffix ?? ""}
|
||||||
|
onChange={(event) => {
|
||||||
|
if (!editable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handleChange("downloadSuffix", event.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Label className="text-xs font-normal text-slate-300">
|
<Label className="text-xs font-normal text-slate-300">
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export type TaskNodeData = {
|
|||||||
maxRetries: number | null;
|
maxRetries: number | null;
|
||||||
maxStepsOverride: number | null;
|
maxStepsOverride: number | null;
|
||||||
allowDownloads: boolean;
|
allowDownloads: boolean;
|
||||||
|
downloadSuffix: string | null;
|
||||||
editable: boolean;
|
editable: boolean;
|
||||||
label: string;
|
label: string;
|
||||||
parameterKeys: Array<string>;
|
parameterKeys: Array<string>;
|
||||||
@@ -29,6 +30,7 @@ export const taskNodeDefaultData: TaskNodeData = {
|
|||||||
maxRetries: null,
|
maxRetries: null,
|
||||||
maxStepsOverride: null,
|
maxStepsOverride: null,
|
||||||
allowDownloads: false,
|
allowDownloads: false,
|
||||||
|
downloadSuffix: null,
|
||||||
editable: true,
|
editable: true,
|
||||||
label: "",
|
label: "",
|
||||||
parameterKeys: [],
|
parameterKeys: [],
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ function convertToNode(
|
|||||||
dataSchema: JSON.stringify(block.data_schema, null, 2),
|
dataSchema: JSON.stringify(block.data_schema, null, 2),
|
||||||
errorCodeMapping: JSON.stringify(block.error_code_mapping, null, 2),
|
errorCodeMapping: JSON.stringify(block.error_code_mapping, null, 2),
|
||||||
allowDownloads: block.complete_on_download ?? false,
|
allowDownloads: block.complete_on_download ?? false,
|
||||||
|
downloadSuffix: block.download_suffix ?? null,
|
||||||
maxRetries: block.max_retries ?? null,
|
maxRetries: block.max_retries ?? null,
|
||||||
maxStepsOverride: block.max_steps_per_run ?? null,
|
maxStepsOverride: block.max_steps_per_run ?? null,
|
||||||
parameterKeys: block.parameters.map((p) => p.key),
|
parameterKeys: block.parameters.map((p) => p.key),
|
||||||
@@ -451,6 +452,7 @@ function getWorkflowBlock(
|
|||||||
max_retries: node.data.maxRetries ?? undefined,
|
max_retries: node.data.maxRetries ?? undefined,
|
||||||
max_steps_per_run: node.data.maxStepsOverride,
|
max_steps_per_run: node.data.maxStepsOverride,
|
||||||
complete_on_download: node.data.allowDownloads,
|
complete_on_download: node.data.allowDownloads,
|
||||||
|
download_suffix: node.data.downloadSuffix,
|
||||||
parameter_keys: node.data.parameterKeys,
|
parameter_keys: node.data.parameterKeys,
|
||||||
totp_identifier: node.data.totpIdentifier,
|
totp_identifier: node.data.totpIdentifier,
|
||||||
totp_verification_url: node.data.totpVerificationUrl,
|
totp_verification_url: node.data.totpVerificationUrl,
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ export type TaskBlock = WorkflowBlockBase & {
|
|||||||
max_steps_per_run?: number | null;
|
max_steps_per_run?: number | null;
|
||||||
parameters: Array<WorkflowParameter>;
|
parameters: Array<WorkflowParameter>;
|
||||||
complete_on_download?: boolean;
|
complete_on_download?: boolean;
|
||||||
|
download_suffix?: string | null;
|
||||||
totp_verification_url?: string | null;
|
totp_verification_url?: string | null;
|
||||||
totp_identifier?: string | null;
|
totp_identifier?: string | null;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export type TaskBlockYAML = BlockYAMLBase & {
|
|||||||
max_steps_per_run?: number | null;
|
max_steps_per_run?: number | null;
|
||||||
parameter_keys?: Array<string> | null;
|
parameter_keys?: Array<string> | null;
|
||||||
complete_on_download?: boolean;
|
complete_on_download?: boolean;
|
||||||
|
download_suffix?: string | null;
|
||||||
totp_verification_url?: string | null;
|
totp_verification_url?: string | null;
|
||||||
totp_identifier?: string | null;
|
totp_identifier?: string | null;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user