-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[chrome/nav] implement forcedNavigation logic in new nav #29770
Conversation
Pinging @elastic/kibana-platform |
597062f
to
a001030
Compare
This comment has been minimized.
This comment has been minimized.
💚 Build Succeeded |
Not sure if it's important to this PR, but the steps above do not quite work for me. I get the message |
Is this change necessary? Before your PR if you click on a NavLink that would trigger a hash change in Angular router, it appears to just stay on the status page. With this change, it refreshes the status page when you click on a navlink. Do we consider this current behavior broken? Is that refreshing worth the complexity of this change? |
It's necessary in that it has been a "feature" since 4.2, and I think having app links that are clickable but don't work without refreshing the page considers them broken, personally. |
💚 Build Succeeded |
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, just want a some comments to help me remember what in the world this is later 😄
This comment has been minimized.
This comment has been minimized.
💔 Build Failed |
Summary
When the Kibana server is red we render the status page in place of the current page, kind of like an error page. This prevents us from having to worry about redirects, but also means that links which normally trigger navigation with hash changes are broken because the status page app is rendered instead of the current app. To fix this we enable "forced navigation" mode on the status page so that any nav bar link that is clicked, which resolves to the same protocol+host+path will trigger a page refresh.
This used to be implemented as a click handler on each nav item, but EUI doesn't support click handlers on links in the Nav, so this uses a single event listener at the container around the nav links which handles the click events which bubble up. This means the feature now also works for the recent links and the home link.
To test this you should start Kibana in oss mode as security prevents the display of the status page, since license info can't be retrieved.
node scripts/kibana --dev --oss
without elasticsearchyarn es snapshot --license oss
Original implementation: https://github.com/spalger/kibana/blob/597062fcbd346c2e11f1266f54c041d4469f8dee/src/ui/public/chrome/directives/global_nav/app_switcher/app_switcher.js#L35-L61