Skip to content

Commit 3b5a518

Browse files
[Navigation] Update deep link visibility settings to exclude 'classicSideNav'
This commit modifies the default visibility settings for management plugins to exclude 'classicSideNav', ensuring that management sub-apps do not appear as top-level entries in the classic hamburger navigation. The changes also update related unit tests to reflect the new expectations for deep link visibility, specifically for applications without an explicit 'visibleIn' setting. Additionally, the test cases for file upload, index data visualizer, and data drift have been adjusted to confirm their visibility in both 'globalSearch' and 'solutionSideNav', while breadcrumb-only page variants are now correctly set to be hidden everywhere.
1 parent 865006c commit 3b5a518

3 files changed

Lines changed: 27 additions & 20 deletions

File tree

src/platform/plugins/shared/management/public/plugin.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ export class ManagementPlugin
8383
title: mgmtApp.title,
8484
path: mgmtApp.basePath,
8585
keywords: mgmtApp.keywords,
86-
// Default includes both 'classicSideNav' and 'solutionSideNav' so all management sections
87-
// appear in both navigation modes. Sections that explicitly set visibleIn
88-
// (e.g. to hide from globalSearch) must also include the relevant nav flags.
89-
visibleIn: mgmtApp.visibleIn ?? ['globalSearch', 'classicSideNav', 'solutionSideNav'],
86+
// Default excludes 'classicSideNav' so management sub-apps do not surface as
87+
// top-level entries in the classic hamburger nav (the "Stack Management" app
88+
// is the entry point there). 'solutionSideNav' is included so solution
89+
// navigation trees can keep referencing them by id (e.g. 'management:dataViews').
90+
visibleIn: mgmtApp.visibleIn ?? ['globalSearch', 'solutionSideNav'],
9091
})),
9192
}));
9293

src/platform/plugins/shared/management/public/plugin_deep_links.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getDeepLinksFromUpdater(plugin: ManagementPlugin): AppDeepLink[] {
3131
}
3232

3333
describe('ManagementPlugin appUpdater deep link visibleIn', () => {
34-
it('defaults visibleIn to globalSearch and classicSideNav/solutionSideNav for apps without an explicit visibleIn', () => {
34+
it('defaults visibleIn to globalSearch + solutionSideNav for apps without an explicit visibleIn (excludes classicSideNav to avoid duplicating Stack Management entries in the classic hamburger nav)', () => {
3535
const plugin = createPlugin();
3636
const setup = plugin.setup(coreMock.createSetup(), { share: mockShare });
3737

@@ -46,7 +46,7 @@ describe('ManagementPlugin appUpdater deep link visibleIn', () => {
4646
const app = kibana?.deepLinks?.find((a) => a.id === 'test-no-visible-in');
4747

4848
expect(app).toBeDefined();
49-
expect(app?.visibleIn).toEqual(['globalSearch', 'classicSideNav', 'solutionSideNav']);
49+
expect(app?.visibleIn).toEqual(['globalSearch', 'solutionSideNav']);
5050
});
5151

5252
it('preserves explicit visibleIn when set to classicSideNav/solutionSideNav-only', () => {

x-pack/platform/plugins/shared/ml/public/register_helper/register_search_links/search_deep_links.test.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,36 @@ describe('getDeepLinks', () => {
4545
]);
4646
});
4747

48-
it('hidden nav nodes (breadcrumb-only) use solutionSideNav-only visibleIn', () => {
48+
it('file upload / index data visualizer / data drift remain in globalSearch + solutionSideNav', () => {
4949
const links = getDeepLinks(true, fullCapabilities, false);
50-
const aiOps = links.find((l) => l.id === 'aiOps');
5150

52-
expect(links.find((l) => l.id === 'fileUpload')?.visibleIn).toEqual(['solutionSideNav']);
53-
expect(links.find((l) => l.id === 'indexDataVisualizer')?.visibleIn).toEqual([
54-
'solutionSideNav',
55-
]);
56-
expect(links.find((l) => l.id === 'indexDataVisualizerPage')?.visibleIn).toEqual([
57-
'solutionSideNav',
58-
]);
59-
expect(links.find((l) => l.id === 'dataDrift')?.visibleIn).toEqual(['solutionSideNav']);
60-
expect(links.find((l) => l.id === 'dataDriftPage')?.visibleIn).toEqual(['solutionSideNav']);
61-
expect(aiOps?.deepLinks?.find((l) => l.id === 'logRateAnalysisPage')?.visibleIn).toEqual([
51+
expect(links.find((l) => l.id === 'fileUpload')?.visibleIn).toEqual([
52+
'globalSearch',
6253
'solutionSideNav',
6354
]);
64-
expect(aiOps?.deepLinks?.find((l) => l.id === 'logPatternAnalysisPage')?.visibleIn).toEqual([
55+
expect(links.find((l) => l.id === 'indexDataVisualizer')?.visibleIn).toEqual([
56+
'globalSearch',
6557
'solutionSideNav',
6658
]);
67-
expect(aiOps?.deepLinks?.find((l) => l.id === 'changePointDetectionsPage')?.visibleIn).toEqual([
59+
expect(links.find((l) => l.id === 'dataDrift')?.visibleIn).toEqual([
60+
'globalSearch',
6861
'solutionSideNav',
6962
]);
7063
});
7164

65+
it('breadcrumb-only *Page variants are hidden everywhere (visibleIn: [])', () => {
66+
const links = getDeepLinks(true, fullCapabilities, false);
67+
const aiOps = links.find((l) => l.id === 'aiOps');
68+
69+
expect(links.find((l) => l.id === 'indexDataVisualizerPage')?.visibleIn).toEqual([]);
70+
expect(links.find((l) => l.id === 'dataDriftPage')?.visibleIn).toEqual([]);
71+
expect(aiOps?.deepLinks?.find((l) => l.id === 'logRateAnalysisPage')?.visibleIn).toEqual([]);
72+
expect(aiOps?.deepLinks?.find((l) => l.id === 'logPatternAnalysisPage')?.visibleIn).toEqual([]);
73+
expect(aiOps?.deepLinks?.find((l) => l.id === 'changePointDetectionsPage')?.visibleIn).toEqual(
74+
[]
75+
);
76+
});
77+
7278
it('omits links when capabilities or license are insufficient', () => {
7379
expect(
7480
getDeepLinks(false, fullCapabilities, false).find((l) => l.id === 'overview')

0 commit comments

Comments
 (0)