Skip to content

Store clean up

Loic Huder requested to merge store-clean-up into main

Fix #267 (closed)

Basically, we had two stores rootWorkflow (storing the root workflow id and loading the workflow) and displayedWorkflow (storing the displayed workflow info, including the id). This was a legacy of an old state of the app when it was loading subworkflow in the same canvas.

Now that the subworkflows are in the separate tab (great idea btw 😉 ), rootWorkflow and displayedWorkflow are always the same workflow.


It may be easier to review again commit by commit:

In the first commit, I remove unneeded type guards. Unrelated LOL.

In the second commit, I merge the two store slices together for easier refactoring. The two slices were in fact in the same store but not in the same file.

In the third commit, I remove the duplication:

  • rootWorkflowId is removed since it is part of displayedWorkflowInfo.id
  • I remove the outdated prefixes root and displayed
  • setRootWorkflow is renamed loadWorkflow
  • In components, I remove all the conditions checking displayedWorkflowInfo.id == rootWorkflowId since they don't have a purpose anymore. This brings some additional changes in some case (e.g. the hook useLoadGraph becomes an util)

There are still a few weird things but that should allow us to see things more clearly for future refactorings.

Edited by Loic Huder

Merge request reports

Loading