-
Notifications
You must be signed in to change notification settings - Fork 9
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
ms2/layoutmenu: show selected item #310
Draft
FelipeTrost
wants to merge
4
commits into
main
Choose a base branch
from
ms2/selected-page-in-menu
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
75628f4
feat(ms2/layoutmenu): show selected item
FelipeTrost 2546b21
Merge branch 'main' into ms2/selected-page-in-menu
FelipeTrost cb986d0
Merge branch 'main' into ms2/selected-page-in-menu
FelipeTrost 6727611
Merge branch 'main' into ms2/selected-page-in-menu
FelipeTrost File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
This could fail if we have a menu item like
/executions
as well as/executions/monitoring
or sth. like that. If you want to do it that way, the check should be 1:1. Alternatively a context could be set through aContent
component prop that gets read here, so we aren't limited by the url and still set it through the individual pages.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.
I do think the best way is through some form of url mathing, otherwise it would become to annoying to have to set a context value every time, and also there could be some issues with intercepting routes. What do you think of checking that the url ends in a string? This could also cause conflicts, but it is far less likely.
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.
Could you explain that more, what do you mean with ends with a string? How would you make sure
/executions/list
or whatever could be at the end marks the/executions
list item in that case?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.
if the url is ".../executions/list", then
url.endsWith("/executions")
would be false, andurl.endsWith("/executions/list")
would be trueThere 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.
Okay I misunderstood then maybe. I though the intention was to always mark an item, even on sub-sites (like only executions is in the menu, so
/executions/list
would still mark executions item in menu).