-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 namespace picker so that it always expands into an object when co… #7333
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meirish
force-pushed
the
ui-namespace-nested-numbers
branch
from
August 20, 2019 19:05
b54c6a1
to
6a45c4b
Compare
madalynrose
previously approved these changes
Aug 22, 2019
// after the reduction we're left with an array that contains | ||
// strings that represent the longest branches | ||
// we'll replace the dots in the paths, then expand the path | ||
// to a nested object that we can then query with Ember.get | ||
return deepmerge.all( | ||
tree.map(p => { | ||
p = p.replace(/\.+/g, DOT_REPLACEMENT); | ||
return unflatten({ [p]: null }, { delimiter: '/' }); | ||
return unflatten({ [p]: null }, { delimiter: '/', object: true }); |
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.
wow this is a really simple fix! nice!
meirish
force-pushed
the
ui-namespace-nested-numbers
branch
from
August 22, 2019 18:47
6a45c4b
to
b0eb147
Compare
Thanks for the review! Going to merge, the last commit was just fixing linting and rebasing (so it dismissed the review). |
meirish
added a commit
that referenced
this pull request
Aug 22, 2019
#7333) * fix namespace picker so that it always expands into an object when constructing a tree * sort namespaces lexicographically * fix linting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…nstructing a tree
Previously, if you had a nested namespace that was a number, it would get expanded by the
unflatten
method fromflat
as an array, so if you had a namespace namedfoo/999999
, foo would be an array with 999999 members. This caused a pretty rough lag in the ui, but also resulted in incorrect links.The fix was to use
unflatten
with theobject:true
option. I also added a test for this particular case that failed without the code change:While I was in the area, I also sorted the namespaces which closes #7339