Skip to content

Commit

Permalink
[ML] Fix side bar navigation not highlighted for Data Visualizer and …
Browse files Browse the repository at this point in the history
…Data Drift (elastic#205170)

## Summary

This PR fixes elastic#204392 side bar
navigation not highlighted for Data Visualizer and Data Drift

<img width="1134" alt="Screenshot 2024-12-26 at 12 32 00"
src="https://github.com/user-attachments/assets/ff721a06-74b8-4103-9a3d-64a60b0284c8"
/>
<img width="1134" alt="Screenshot 2024-12-26 at 12 31 48"
src="https://github.com/user-attachments/assets/e4250d70-d1a2-4a5b-b891-a935fa554e79"
/>
<img width="1134" alt="Screenshot 2024-12-26 at 12 31 42"
src="https://github.com/user-attachments/assets/4c599233-4dfc-48b1-9612-5798c51f60ea"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
2 people authored and cqliu1 committed Jan 2, 2025
1 parent 2361e4e commit bd51ea0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export function useSideNavItems(activeRoute: MlRoute | undefined) {
}),
disabled: false,
testSubj: 'mlMainTab indexDataVisualizer',
relatedRouteIds: ['data_view_datavisualizer'],
},
{
id: 'esql_datavisualizer',
Expand All @@ -255,6 +256,7 @@ export function useSideNavItems(activeRoute: MlRoute | undefined) {
}),
disabled: false,
testSubj: 'mlMainTab esqlDataVisualizer',
relatedRouteIds: ['data_view_datavisualizer_esql'],
},

{
Expand All @@ -265,6 +267,7 @@ export function useSideNavItems(activeRoute: MlRoute | undefined) {
}),
disabled: disableLinks,
testSubj: 'mlMainTab dataDrift',
relatedRouteIds: ['data_drift'],
},
],
},
Expand Down Expand Up @@ -337,7 +340,6 @@ export function useSideNavItems(activeRoute: MlRoute | undefined) {
`/${pathId}` === activeRoute?.path ||
(!!highlightNestedRoutes && activeRoute?.path.includes(`${pathId}/`)) ||
(Array.isArray(relatedRouteIds) && relatedRouteIds.includes(activeRoute?.id!));

return {
id,
name,
Expand Down

0 comments on commit bd51ea0

Please sign in to comment.