Skip to content

Fix routes reset namespace display#863

Merged
RobbieTheWagner merged 3 commits intoemberjs:masterfrom
pbishop16:fix-routes-reset-namespace-display
Aug 30, 2018
Merged

Fix routes reset namespace display#863
RobbieTheWagner merged 3 commits intoemberjs:masterfrom
pbishop16:fix-routes-reset-namespace-display

Conversation

@pbishop16
Copy link
Copy Markdown
Contributor

Resolves: #832
reset-namespace-demo-2

Copy link
Copy Markdown
Member

@RobbieTheWagner RobbieTheWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me. Just had one comment.

Other than that, my only question is does this handle edge cases? For example if you had a root route of comment and a nested route of foo/bar/comments, both would be named just comments, so if you select the nested one, does it not select the root one as well?

"PostRoute",
"application",
"application",
"comments",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need "comments" twice here?

Copy link
Copy Markdown
Contributor Author

@pbishop16 pbishop16 Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwwagner90 I double checked and the test seems to want "comments" listed twice similar to "application" and "post". In order to keep from compromising the existing test case, I didn't want to modify it too much. However, I can reassess it if you recommend doing so.

name: 'comments',
},
message: 'resource match fails when current route does not match the root route',
},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwwagner90 You are very right. I did run into this edge case. The above test two cases roughly model this scenario.

Edge case Failure
example-fail

Adding the following URL check const hasMatchingURL = routeURL === currentRouteURL; resolved this edge case.

Edge Case Success
example-success

Please let me know if I failed to address your concern.

@pbishop16 pbishop16 closed this Aug 29, 2018
@pbishop16 pbishop16 reopened this Aug 29, 2018
Copy link
Copy Markdown
Member

@RobbieTheWagner RobbieTheWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks so much!

@RobbieTheWagner RobbieTheWagner merged commit 0adc9ba into emberjs:master Aug 30, 2018
@pbishop16 pbishop16 deleted the fix-routes-reset-namespace-display branch September 1, 2018 21:10
cyril-sf pushed a commit to cyril-sf/ember-inspector that referenced this pull request Mar 30, 2022
* Implement bug fix

* Post rebase refinements

* Test case refinement
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.

2 participants