Add workflow email action (#7279)

- Add the SAVE_EMAIL action. This action requires more setting
parameters than the Serverless Function action.
- Changed the way we computed the workflow diagram. It now preserves
some properties, like the `selected` property. That's necessary to not
close the right drawer when the workflow back-end data change.
- Added the possibility to set a label to a TextArea. This uses a
`<label>` HTML element and the `useId()` hook to create an id linking
the label with the input.
This commit is contained in:
Baptiste Devessier
2024-10-01 14:22:14 +02:00
committed by GitHub
parent 0d570caff5
commit cde255a031
19 changed files with 512 additions and 106 deletions

View File

@ -1,14 +1,14 @@
import { WorkflowStep } from '@/workflow/types/Workflow';
import { findStepPositionOrThrow } from '@/workflow/utils/findStepPositionOrThrow';
export const replaceStep = ({
export const replaceStep = <T extends WorkflowStep>({
steps: stepsInitial,
stepId,
stepToReplace,
}: {
steps: Array<WorkflowStep>;
stepId: string;
stepToReplace: Partial<Omit<WorkflowStep, 'id'>>;
stepToReplace: Partial<Omit<T, 'id'>>;
}) => {
const steps = structuredClone(stepsInitial);