-
Notifications
You must be signed in to change notification settings - Fork 637
OCPBUGS-53200: Fix highlighting nav items with nested routes #14735
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
base: main
Are you sure you want to change the base?
Conversation
Hi @aptmac. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
/ok-to-test
Nice! Do you mind opening an OCPBUGS, with Management Console
in the component/s field, so this can be backported?
@aptmac: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Sure! I've opened: https://issues.redhat.com/browse/OCPBUGS-53200 |
/retitle OCPBUGS-53200: Fix highlighting nav items with nested routes |
@aptmac: This pull request references Jira Issue OCPBUGS-53200, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh /cc @jhadvig |
@logonoff: This pull request references Jira Issue OCPBUGS-53200, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aptmac, logonoff The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi! I've been working on porting over an application to be a dynamic plugin, and ran into a nav highlighting issue where if a nested route existed for another nav item then both of them would be highlighted. At the moment I have some code in our plugin that corrects the highlighting, but it would be nicer if this solution was baked into the console.
For example, our application (cryostat) has a landing page which displays dashboards. In our original web app we want this to be the entry point, so it uses the route "/cryostat". In our nav we have a "Dashboard" item, that routes to "/cryostat", alongside all the other nav items that route to other pages.
When working on the console plugin we found that if we visited any other page, lets say "/cryostat/about" for example, then both nav items for "Dashboard" and "About" would be highlighted. This is because the current logic tries to match the href and location fragments, and returns true for both nav items because of our nested route.
I posted a question about this on Slack and was pointed at the code here, so here's a change that will make the highlighting logic match the scopeless href to scopeless location in order to avoid nested routes from being highlighted.
Before
After