Display tag for workflow version status (#6972)

- Move where we fetch workflow data. We now fetch them in the `Workflow`
component directly. That's useful to access it in the
`WorkflowShowPageEffect` and `WorkflowDiagramCanvas` components.

![CleanShot 2024-09-10 at 16 27
53@2x](https://github.com/user-attachments/assets/7d30f407-31ab-472c-a096-c525042c0f35)
This commit is contained in:
Baptiste Devessier
2024-09-13 11:25:07 +02:00
committed by GitHub
parent 31c02202bd
commit e9f8e6e718
6 changed files with 121 additions and 24 deletions
@@ -1,6 +1,6 @@
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
import { workflowDiagramState } from '@/workflow/states/workflowDiagramState';
import { workflowIdState } from '@/workflow/states/workflowIdState';
import { WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';
import { addCreateStepNodes } from '@/workflow/utils/addCreateStepNodes';
import { getWorkflowVersionDiagram } from '@/workflow/utils/getWorkflowVersionDiagram';
import { useEffect } from 'react';
@@ -9,11 +9,13 @@ import { isDefined } from 'twenty-ui';
type WorkflowEffectProps = {
workflowId: string;
workflowWithCurrentVersion: WorkflowWithCurrentVersion | undefined;
};
export const WorkflowEffect = ({ workflowId }: WorkflowEffectProps) => {
const workflowWithCurrentVersion = useWorkflowWithCurrentVersion(workflowId);
export const WorkflowEffect = ({
workflowId,
workflowWithCurrentVersion,
}: WorkflowEffectProps) => {
const setWorkflowId = useSetRecoilState(workflowIdState);
const setWorkflowDiagram = useSetRecoilState(workflowDiagramState);