Prevent workflow right drawer flickering when selecting an action type (#8028)

In this PR:

- Use a stable id for create-step nodes; it makes it possible to
preserve their selected attribute and keep them open even after the flow
is re-generated
- Preemptively open the WorkflowStepEdit right drawer for the created
action



https://github.com/user-attachments/assets/c19e6820-e198-4d06-98ae-898bd6e53e33

Fixes https://github.com/twentyhq/private-issues/issues/123
This commit is contained in:
Baptiste Devessier
2024-10-24 17:27:56 +02:00
committed by GitHub
parent 315820ec86
commit e44d525e83
3 changed files with 16 additions and 7 deletions

View File

@ -27,7 +27,9 @@ export const WorkflowDiagramEffect = ({
workflowDiagramState,
);
const nextWorkflowDiagram = getWorkflowVersionDiagram(currentVersion);
const nextWorkflowDiagram = addCreateStepNodes(
getWorkflowVersionDiagram(currentVersion),
);
let mergedWorkflowDiagram = nextWorkflowDiagram;
if (isDefined(previousWorkflowDiagram)) {
@ -37,11 +39,7 @@ export const WorkflowDiagramEffect = ({
);
}
const workflowDiagramWithCreateStepNodes = addCreateStepNodes(
mergedWorkflowDiagram,
);
set(workflowDiagramState, workflowDiagramWithCreateStepNodes);
set(workflowDiagramState, mergedWorkflowDiagram);
};
},
[],