Set steps output schema in a recoil family state (#10688)

- Create a workflow version component family state for each workflow
version : `stepId` => `StepOutputSchema`
- Populate this state when reaching the workflow visualizer of the
workflow version
- Wrap the right drawer when in edit mode with the context. It is the
only one who needs this schema

Next step:
- read this state from the variables
This commit is contained in:
Thomas Trompette
2025-03-06 14:31:35 +01:00
committed by GitHub
parent 17b488dd3b
commit 5ddf7c6475
8 changed files with 195 additions and 81 deletions

View File

@ -1,4 +1,5 @@
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
import { WorkflowVersionComponentInstanceContext } from '@/workflow/states/context/WorkflowVersionComponentInstanceContext';
import { workflowIdState } from '@/workflow/states/workflowIdState';
import { RightDrawerWorkflowEditStepContent } from '@/workflow/workflow-steps/components/RightDrawerWorkflowEditStepContent';
import { useRecoilValue } from 'recoil';
@ -12,5 +13,11 @@ export const RightDrawerWorkflowEditStep = () => {
return null;
}
return <RightDrawerWorkflowEditStepContent workflow={workflow} />;
return (
<WorkflowVersionComponentInstanceContext.Provider
value={{ instanceId: workflow.currentVersion.id }}
>
<RightDrawerWorkflowEditStepContent workflow={workflow} />
</WorkflowVersionComponentInstanceContext.Provider>
);
};