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

@ -16,7 +16,9 @@ export const addCreateStepNodes = ({ nodes, edges }: WorkflowDiagram) => {
for (const node of nodesWithoutTargets) {
const newCreateStepNode: WorkflowDiagramNode = {
id: v4(),
// FIXME: We need a stable id for create step nodes to be able to preserve their selected status.
// FIXME: In the future, we'll have conditions and loops. We'll have to set an id to each branch so we can have this stable id.
id: 'branch-1__create-step',
type: 'create-step',
data: {
nodeType: 'create-step',