-
Notifications
You must be signed in to change notification settings - Fork 9
Unstable Sorting in EditorProvider#getToolboxGroups() Function #46
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? No Sign in to your account
Comments
Hello @mythsman, I'm not sure if I understand correctly. The public getToolboxGroups(): ToolboxGroup[] {
const stepModels = Object.values(this.definitionModel.steps);
...
categories.forEach((category: string | undefined) => {
...
groupSteps.sort((a, b) => a.name.localeCompare(b.name));
groups.push({
name,
steps: groupSteps
});
});
groups.sort((a, b) => a.name.localeCompare(b.name));
return groups;
} Do you want to keep the order from the model builder? |
@b4rtaz Oh, you know exactly what I want. I have confused 'the order from the model builder' with 'alphabetical order using localCompare' . There's an issue when using So, I think maintaining the order as provided by the model builder might be a better choice. |
And , i am currently facing a scenario related to node definition upgrade. I have designed a node that works perfectly fine. However, as the business grows, the definition of this node needs to be changed. Directly modifying the node definition is not an option since the old workflow definition wouldn't render correctly in the new workflow. My current solution is to define a new node based on the original one and hide the old one in the getToolboxGroups. This would allow the new workflows to only use the new node while the old workflows can still read from the old node as usual. Therefore, I believe adding a hidden property or similar in the Step or DefinitionModel, and then filtering it in the getToolboxGroups could be a better choice. Of course, a custom getToolboxGroups could resolve all these issues as well. |
Thanks for your great work! |
Although the sorting of
EditorProvider#getToolboxGroups
itself is stable, when adding steps usingDefinitionModelBuilder#steps
, the originally ordered steps get regrouped based onmodel.type
. After that, usingObject.values(this.definitionModel.steps)
does not guarantee the order.The text was updated successfully, but these errors were encountered: