Add TOTP stuff to task node (#793)
This commit is contained in:
@@ -71,7 +71,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
<>
|
<>
|
||||||
<Accordion
|
<Accordion
|
||||||
type="multiple"
|
type="multiple"
|
||||||
defaultValue={["content", "extraction", "limits"]}
|
defaultValue={["content", "extraction", "limits", "totp"]}
|
||||||
>
|
>
|
||||||
<AccordionItem value="content">
|
<AccordionItem value="content">
|
||||||
<AccordionTrigger>Content</AccordionTrigger>
|
<AccordionTrigger>Content</AccordionTrigger>
|
||||||
@@ -261,6 +261,47 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
<AccordionItem value="totp">
|
||||||
|
<AccordionTrigger>TOTP</AccordionTrigger>
|
||||||
|
<AccordionContent className="pl-[1.5rem] pr-1">
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="space-y-1">
|
||||||
|
<Label className="text-xs text-slate-300">
|
||||||
|
TOTP Verification URL
|
||||||
|
</Label>
|
||||||
|
<AutoResizingTextarea
|
||||||
|
onChange={(event) => {
|
||||||
|
if (!editable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateNodeData(id, {
|
||||||
|
totpVerificationUrl: event.target.value,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
value={data.totpVerificationUrl ?? ""}
|
||||||
|
placeholder="https://"
|
||||||
|
className="nopan"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-1">
|
||||||
|
<Label className="text-xs text-slate-300">
|
||||||
|
TOTP Identifier
|
||||||
|
</Label>
|
||||||
|
<AutoResizingTextarea
|
||||||
|
onChange={(event) => {
|
||||||
|
if (!editable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateNodeData(id, { totpIdentifier: event.target.value });
|
||||||
|
}}
|
||||||
|
value={data.totpIdentifier ?? ""}
|
||||||
|
placeholder="Identifier"
|
||||||
|
className="nopan"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</AccordionContent>
|
||||||
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ export type TaskNodeData = {
|
|||||||
editable: boolean;
|
editable: boolean;
|
||||||
label: string;
|
label: string;
|
||||||
parameterKeys: Array<string>;
|
parameterKeys: Array<string>;
|
||||||
|
totpVerificationUrl: string | null;
|
||||||
|
totpIdentifier: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TaskNode = Node<TaskNodeData, "task">;
|
export type TaskNode = Node<TaskNodeData, "task">;
|
||||||
@@ -30,4 +32,6 @@ export const taskNodeDefaultData: TaskNodeData = {
|
|||||||
editable: true,
|
editable: true,
|
||||||
label: "",
|
label: "",
|
||||||
parameterKeys: [],
|
parameterKeys: [],
|
||||||
|
totpVerificationUrl: null,
|
||||||
|
totpIdentifier: null,
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ function convertToNode(
|
|||||||
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),
|
||||||
|
totpIdentifier: block.totp_identifier ?? null,
|
||||||
|
totpVerificationUrl: block.totp_verification_url ?? null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -402,6 +404,8 @@ function getWorkflowBlock(
|
|||||||
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,
|
||||||
parameter_keys: node.data.parameterKeys,
|
parameter_keys: node.data.parameterKeys,
|
||||||
|
totp_identifier: node.data.totpIdentifier,
|
||||||
|
totp_verification_url: node.data.totpVerificationUrl,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case "sendEmail": {
|
case "sendEmail": {
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ 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;
|
||||||
|
totp_verification_url?: string | null;
|
||||||
|
totp_identifier?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ForLoopBlock = WorkflowBlockBase & {
|
export type ForLoopBlock = WorkflowBlockBase & {
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ 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;
|
||||||
|
totp_verification_url?: string | null;
|
||||||
|
totp_identifier?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CodeBlockYAML = BlockYAMLBase & {
|
export type CodeBlockYAML = BlockYAMLBase & {
|
||||||
|
|||||||
Reference in New Issue
Block a user