Skip to content
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

Navigation menu item is not highlighted if navigating to solutions from the Kibana home page #78528

Closed
hendry-lim opened this issue Sep 25, 2020 · 4 comments · Fixed by #78583
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0

Comments

@hendry-lim
Copy link

Kibana version: 7.10.0-SNAPSHOT

Elasticsearch version: 7.10.0-SNAPSHOT

Original install method (e.g. download page, yum, from source, etc.): Docker

Describe the bug:
Navigating to Enterprise Search, Observability, Security from the Kibana home page does not highlight the navigation menu item on the left.

Steps to reproduce:

  1. In Kibana home page, click either Enterprise Search, Observability, or Security
  2. Observe the menu item on the left navigation is not highlighted

Expected behavior:
Selected navigation menu item should be highlighted as if navigating via the menu item.

Screenshots (if relevant):

gif

Kibana Nav Menu Item not Highlighted

@azasypkin azasypkin added triage_needed REASSIGN from Team:Core UI Deprecated label for old Core UI team Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Sep 28, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core-ui (Team:Core UI)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

pgayvallet commented Sep 28, 2020

When navigating from the home to entrepriseSearch, I can see that application.currentAppId$ is emitting two different values: enterpriseSearch, then enterprise_search. The correct one, as registered by the plugin, is the first one: enterpriseSearch.

The second value is wrong, and causes this check

to be falsy.

When navigating using the navigation menu, It's behaving as expected by only emitting enterpriseSearch

The same thing occurs with observability and security.

Seems like a bug in the ApplicationService for app with an ID and a custom appRoute that don't match. We are probably using the route's id parameter instead of the actual app registered ID somewhere.

e.g for enterprise search: ID: 'enterpriseSearch', and URL: '/app/enterprise_search/overview',

@pgayvallet pgayvallet added bug Fixes for quality problems that affect the customer experience v7.10.0 and removed REASSIGN from Team:Core UI Deprecated label for old Core UI team triage_needed labels Sep 28, 2020
@pgayvallet
Copy link
Contributor

After further investigations, it's a mix of two things:

  1. Root cause: the way home is redirecting to the solution apps is based on url parsing and a call to navigateToApp

export const createAppNavigationHandler = (targetUrl: string) => (event: MouseEvent) => {
if (event.altKey || event.metaKey || event.ctrlKey) {
return;
}
if (targetUrl.startsWith('/app/')) {
const [, appId, path] = /\/app\/(.*?)((\/|\?|#|$).*)/.exec(targetUrl) || [];
if (!appId) {

This is wrong on two levels:

  • it uses the wrong ID, as it parses it from the url, which doesn't work with custom routes (enterprise_search instead of enterpriseSearch)
  • it doesn't work with apps with custom routes not starting with /app/
  1. application.navigateToApp does not checks if the given appId is a valid one, as we decided to still redirect to the app's route to let the AppRoute component display the 404 pages. When the appId is invalid, but /app/(appId} is the route of a valid app, it's just displaying the app, while emitting an invalid appId with currentAppId$. This is what is happening with the enterpriseSearch id vs the /app/enterprise_search route.

Changing navigateToApp behavior would require to rethink our whole routing mechanism, which seems way too impactful. I'm going to just fix home's createAppNavigationHandler instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants