-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
fix: ability to fetch separators by id #15290
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is pretty obscure, but should work for simple cases.
Thank you!
Failed on unrelated
|
Release Notes Persisted
|
We have automatically backported this PR to "4-0-x", please check out #15294 |
We have automatically backported this PR to "3-0-x", please check out #15295 |
@@ -156,14 +161,15 @@ function sortGroups (groups) { | |||
|
|||
function sortMenuItems (menuItems) { | |||
const isSeparator = (item) => item.type === 'separator' | |||
const separators = menuItems.filter(i => i.type === 'separator') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const separators = menuItems.filter(isSeparator)
joined.push(joiner) | ||
if (joinIDs.length > 0) { | ||
joined.push(joinIDs[0]) | ||
joinIDs.splice(0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joined.push(joinIDs.shift())
Instead of those two lines.
Description of Change
Resolves #15119.
Changes menu-utils to take into account
separator
s withid
s such that they are not removed during the sorting process. Also adds a test to prevent future regression./cc @alexeykuzmin
Checklist
npm test
passesRelease Notes
Notes: fixes ability to fetch separators menu items by id