Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “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? Sign in to your account

Disable group merge for single item or non-group items #2611

Merged
merged 2 commits into from Jun 12, 2020

Conversation

HiroyasuNishiyama
Copy link
Member

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Groups > Merge selection menu do not merge group for single element or non-group items.
The operation for these items is the same as for Groups > Group selection.
Therefore, This PR try to disable the Group selection menu for these cases.

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@coveralls
Copy link

coveralls commented Jun 12, 2020

Coverage Status

Coverage decreased (-0.02%) to 77.31% when pulling a15adc4 on node-red-hitachi:fix-group-merge-activation into 81a4f42 on node-red:dev.

@knolleary
Copy link
Member

Thanks for this - a good change to make.

Can I make one suggestion - I notice this function now calls selection.nodes.filter three separate times for the different menu options.

How about changing it to call selection.nodes.forEach just once at the start of the function to check for two different conditions used later on - one for if there is a group in the selection and one if nothing in the selection is already in a group.

It's a small improvement but I'm keen to improve the efficiency of the editor code - especially on paths that could get called alot.

@HiroyasuNishiyama
Copy link
Member Author

Hi. Committed a fix to share codes.

@knolleary knolleary merged commit 9321147 into node-red:dev Jun 12, 2020
@HiroyasuNishiyama HiroyasuNishiyama deleted the fix-group-merge-activation branch December 2, 2021 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants