From 43ff505577c4f3eaafd22f912708e2fd2f4bc37e Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Thu, 27 Jun 2024 09:20:58 -0700 Subject: [PATCH 01/28] Add a function to register all plugin Nav groups and categories Signed-off-by: Adam Tackett --- public/plugin.tsx | 3 + public/plugin_nav.tsx | 127 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 public/plugin_nav.tsx diff --git a/public/plugin.tsx b/public/plugin.tsx index 92ecd7687..799fcced9 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -108,6 +108,7 @@ import { SetupDependencies, } from './types'; import { TablesFlyout } from './components/event_analytics/explorer/datasources/tables_flyout'; +import { registerAllPluginNavGroups } from './plugin_nav'; interface PublicConfig { query_assist: { @@ -346,6 +347,8 @@ export class ObservabilityPlugin mount: appMountWithStartPage('integrations'), }); + registerAllPluginNavGroups(core); + core.application.register({ id: observabilityDataConnectionsID, title: observabilityDataConnectionsTitle, diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx new file mode 100644 index 000000000..e483e28a2 --- /dev/null +++ b/public/plugin_nav.tsx @@ -0,0 +1,127 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ +import { + observabilityApplicationsID, + observabilityIntegrationsID, + observabilityLogsID, + observabilityMetricsID, + observabilityNotebookID, + observabilityPanelsID, + observabilityTracesID, +} from '../common/constants/shared'; +import { CoreSetup } from '../../../src/core/public'; +import { AppPluginStartDependencies } from './types'; +import { DEFAULT_NAV_GROUPS, DEFAULT_APP_CATEGORIES } from '../../../src/core/public'; + +export function registerAllPluginNavGroups(core: CoreSetup) { + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityApplicationsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityLogsID, + category: DEFAULT_APP_CATEGORIES.investigate, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + { + id: observabilityLogsID, + category: DEFAULT_APP_CATEGORIES.investigate, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + { + id: observabilityLogsID, + category: DEFAULT_APP_CATEGORIES.investigate, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ + { + id: observabilityLogsID, + category: DEFAULT_APP_CATEGORIES.analyzeSearch, + }, + ]); + + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityMetricsID, + category: DEFAULT_APP_CATEGORIES.investigate, + }, + ]); + + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityTracesID, + category: DEFAULT_APP_CATEGORIES.investigate, + }, + ]); + + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityNotebookID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + { + id: observabilityNotebookID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + { + id: observabilityNotebookID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityPanelsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + { + id: observabilityPanelsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + { + id: observabilityPanelsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ + { + id: observabilityPanelsID, + category: DEFAULT_APP_CATEGORIES.analyzeSearch, + }, + ]); + + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityIntegrationsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + { + id: observabilityIntegrationsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + { + id: observabilityIntegrationsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); +} From 27641b593eba6f3760ae96e84c1ca3772095ee39 Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Tue, 2 Jul 2024 16:06:04 -0700 Subject: [PATCH 02/28] Updated addNavLinkGroups path rename dashboards Signed-off-by: Adam Tackett --- common/constants/shared.ts | 2 +- public/plugin_nav.tsx | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/common/constants/shared.ts b/common/constants/shared.ts index 9126d5eae..a5cf179b4 100644 --- a/common/constants/shared.ts +++ b/common/constants/shared.ts @@ -58,7 +58,7 @@ export const observabilityNotebookTitle = 'Notebooks'; export const observabilityNotebookPluginOrder = 5094; export const observabilityPanelsID = 'observability-dashboards'; -export const observabilityPanelsTitle = 'Dashboards'; +export const observabilityPanelsTitle = 'Observability-Dashboards'; export const observabilityPanelsPluginOrder = 5095; export const observabilityIntegrationsID = 'integrations'; diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index e483e28a2..d7df3092b 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -16,109 +16,109 @@ import { AppPluginStartDependencies } from './types'; import { DEFAULT_NAV_GROUPS, DEFAULT_APP_CATEGORIES } from '../../../src/core/public'; export function registerAllPluginNavGroups(core: CoreSetup) { - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityApplicationsID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityLogsID, category: DEFAULT_APP_CATEGORIES.investigate, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ { id: observabilityLogsID, category: DEFAULT_APP_CATEGORIES.investigate, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ { id: observabilityLogsID, category: DEFAULT_APP_CATEGORIES.investigate, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ { id: observabilityLogsID, category: DEFAULT_APP_CATEGORIES.analyzeSearch, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityMetricsID, category: DEFAULT_APP_CATEGORIES.investigate, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityTracesID, category: DEFAULT_APP_CATEGORIES.investigate, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityNotebookID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ { id: observabilityNotebookID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ { id: observabilityNotebookID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityPanelsID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ { id: observabilityPanelsID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ { id: observabilityPanelsID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ { id: observabilityPanelsID, category: DEFAULT_APP_CATEGORIES.analyzeSearch, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityIntegrationsID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ { id: observabilityIntegrationsID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, }, ]); - core.chrome.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ { id: observabilityIntegrationsID, category: DEFAULT_APP_CATEGORIES.dashboardAndReport, From bfa82c8be4dbc19d5842f5a9220ba55524e39954 Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Wed, 3 Jul 2024 18:21:29 -0700 Subject: [PATCH 03/28] Fixing Naming Signed-off-by: Adam Tackett --- common/constants/shared.ts | 3 ++- public/plugin.tsx | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/common/constants/shared.ts b/common/constants/shared.ts index a5cf179b4..616175c7c 100644 --- a/common/constants/shared.ts +++ b/common/constants/shared.ts @@ -58,7 +58,8 @@ export const observabilityNotebookTitle = 'Notebooks'; export const observabilityNotebookPluginOrder = 5094; export const observabilityPanelsID = 'observability-dashboards'; -export const observabilityPanelsTitle = 'Observability-Dashboards'; +export const observabilityPanelsTitle = 'Dashboards'; +export const observabilityPanelsTitleForNav = 'Observability-Dashboards'; export const observabilityPanelsPluginOrder = 5095; export const observabilityIntegrationsID = 'integrations'; diff --git a/public/plugin.tsx b/public/plugin.tsx index 799fcced9..0db2caa21 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -50,6 +50,7 @@ import { observabilityPanelsID, observabilityPanelsPluginOrder, observabilityPanelsTitle, + observabilityPanelsTitleForNav, observabilityPluginOrder, observabilityTracesID, observabilityTracesPluginOrder, @@ -323,6 +324,18 @@ export class ObservabilityPlugin mount: appMountWithStartPage('traces'), }); + // NEEDS CORRECTION OR REFACTOR //ADAM + // The new-added applications need to be wrapped by a feature flag check. + // if (core.chrome.navGroup.getNavGroupEnabled()) { + // core.application.register({ + // id: "observability-traces-nav", + // title: observabilityTracesTitle, + // order: observabilityTracesPluginOrder, + // category: DEFAULT_APP_CATEGORIES.investigate, + // mount: appMountWithStartPage('traces'), + // }); + // } + core.application.register({ id: observabilityNotebookID, title: observabilityNotebookTitle, @@ -331,13 +344,23 @@ export class ObservabilityPlugin mount: appMountWithStartPage('notebooks'), }); - core.application.register({ - id: observabilityPanelsID, - title: observabilityPanelsTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityPanelsPluginOrder, - mount: appMountWithStartPage('dashboards'), - }); + if (core.chrome.navGroup.getNavGroupEnabled()) { + core.application.register({ + id: observabilityPanelsID, + title: observabilityPanelsTitleForNav, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityPanelsPluginOrder, + mount: appMountWithStartPage('dashboards'), + }); + } else { + core.application.register({ + id: observabilityPanelsID, + title: observabilityPanelsTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityPanelsPluginOrder, + mount: appMountWithStartPage('dashboards'), + }); + } core.application.register({ id: observabilityIntegrationsID, From 1519828b741dba2bb0481676d2723466bb282ec8 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 5 Jul 2024 18:27:15 +0800 Subject: [PATCH 04/28] feat: enable default route Signed-off-by: SuZhou-Joe --- common/constants/shared.ts | 4 +++ public/components/app.tsx | 3 ++ public/components/index.tsx | 4 ++- public/components/trace_analytics/home.tsx | 12 ++++++-- public/plugin.tsx | 33 ++++++++++++++-------- public/plugin_nav.tsx | 11 ++++++++ 6 files changed, 53 insertions(+), 14 deletions(-) diff --git a/common/constants/shared.ts b/common/constants/shared.ts index 616175c7c..bafb5bf34 100644 --- a/common/constants/shared.ts +++ b/common/constants/shared.ts @@ -53,6 +53,10 @@ export const observabilityTracesID = 'observability-traces'; export const observabilityTracesTitle = 'Traces'; export const observabilityTracesPluginOrder = 5093; +export const observabilityServicesID = 'observability-services'; +export const observabilityServicesTitle = 'Services'; +export const observabilityServicesPluginOrder = 5092; + export const observabilityNotebookID = 'observability-notebooks'; export const observabilityNotebookTitle = 'Notebooks'; export const observabilityNotebookPluginOrder = 5094; diff --git a/public/components/app.tsx b/public/components/app.tsx index 1b7150a8c..6ddaf9253 100644 --- a/public/components/app.tsx +++ b/public/components/app.tsx @@ -35,6 +35,7 @@ interface ObservabilityAppDeps { dataSourceManagement: DataSourceManagementPluginSetup; setActionMenu: (menuMount: MountPoint | undefined) => void; savedObjectsMDSClient: CoreStart['savedObjects']; + defaultRoute?: string; } // for cypress to test redux store @@ -67,6 +68,7 @@ export const App = ({ setActionMenu, dataSourceEnabled, savedObjectsMDSClient, + defaultRoute, }: ObservabilityAppDeps) => { const { chrome, http, notifications, savedObjects: coreSavedObjects } = CoreStartProp; const parentBreadcrumb = { @@ -102,6 +104,7 @@ export const App = ({ dataSourceEnabled={dataSourceEnabled} setActionMenu={setActionMenu} savedObjectsMDSClient={savedObjectsMDSClient} + defaultRoute={defaultRoute} /> diff --git a/public/components/index.tsx b/public/components/index.tsx index b1ebf1211..c6dff99e6 100644 --- a/public/components/index.tsx +++ b/public/components/index.tsx @@ -23,7 +23,8 @@ export const Observability = ( startPage: string, dataSourcePluggables, dataSourceManagement: DataSourceManagementPluginSetup, - savedObjectsMDSClient: CoreStart['savedObjects'] + savedObjectsMDSClient: CoreStart['savedObjects'], + defaultRoute?: string, ) => { const { setHeaderActionMenu } = AppMountParametersProp; const { dataSource } = DepsStart; @@ -42,6 +43,7 @@ export const Observability = ( setActionMenu={setHeaderActionMenu} dataSourceEnabled={!!dataSource} savedObjectsMDSClient={savedObjectsMDSClient} + defaultRoute={defaultRoute} />, AppMountParametersProp.element ); diff --git a/public/components/trace_analytics/home.tsx b/public/components/trace_analytics/home.tsx index 391c97f23..d7ced3a35 100644 --- a/public/components/trace_analytics/home.tsx +++ b/public/components/trace_analytics/home.tsx @@ -6,7 +6,7 @@ import { EuiGlobalToastList } from '@elastic/eui'; import { Toast } from '@elastic/eui/src/components/toast/global_toast_list'; import React, { ReactChild, useEffect, useState } from 'react'; -import { HashRouter, Route, RouteComponentProps } from 'react-router-dom'; +import { HashRouter, Route, RouteComponentProps, Redirect } from 'react-router-dom'; import { ChromeBreadcrumb, ChromeStart, @@ -44,6 +44,7 @@ export interface TraceAnalyticsCoreDeps { dataSourceManagement: DataSourceManagementPluginSetup; setActionMenu: (menuMount: MountPoint | undefined) => void; savedObjectsMDSClient: SavedObjectsStart; + defaultRoute?: string; } interface HomeProps extends RouteComponentProps, TraceAnalyticsCoreDeps {} @@ -119,6 +120,7 @@ export const Home = (props: HomeProps) => { const [dataSourceMDSId, setDataSourceMDSId] = useState([{ id: '', label: '' }]); const [currentSelectedService, setCurrentSelectedService] = useState(''); + const { defaultRoute = '/services' } = props; useEffect(() => { handleDataPrepperIndicesExistRequest( @@ -326,7 +328,7 @@ export const Home = (props: HomeProps) => { /> ( { /> )} /> + ( + + )} + /> {flyout} {spanFlyoutComponent} diff --git a/public/plugin.tsx b/public/plugin.tsx index 0db2caa21..36ce2f340 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -52,6 +52,8 @@ import { observabilityPanelsTitle, observabilityPanelsTitleForNav, observabilityPluginOrder, + observabilityServicesPluginOrder, + observabilityServicesTitle, observabilityTracesID, observabilityTracesPluginOrder, observabilityTracesTitle, @@ -269,7 +271,7 @@ export class ObservabilityPlugin // prometheus: openSearchLocalDataSourcePluggable }; - const appMountWithStartPage = (startPage: string) => async (params: AppMountParameters) => { + const appMountWithStartPage = (startPage: string, defaultRoute?: string) => async (params: AppMountParameters) => { const { Observability } = await import('./components/index'); const [coreStart, depsStart] = await core.getStartServices(); const dslService = new DSLService(coreStart.http); @@ -288,7 +290,8 @@ export class ObservabilityPlugin startPage, dataSourcePluggables, // just pass down for now due to time constraint, later may better expose this as context dataSourceManagement, - coreStart.savedObjects + coreStart.savedObjects, + defaultRoute, ); }; @@ -326,15 +329,23 @@ export class ObservabilityPlugin // NEEDS CORRECTION OR REFACTOR //ADAM // The new-added applications need to be wrapped by a feature flag check. - // if (core.chrome.navGroup.getNavGroupEnabled()) { - // core.application.register({ - // id: "observability-traces-nav", - // title: observabilityTracesTitle, - // order: observabilityTracesPluginOrder, - // category: DEFAULT_APP_CATEGORIES.investigate, - // mount: appMountWithStartPage('traces'), - // }); - // } + if (core.chrome.navGroup.getNavGroupEnabled()) { + core.application.register({ + id: "observability-traces-nav", + title: observabilityTracesTitle, + order: observabilityTracesPluginOrder, + category: DEFAULT_APP_CATEGORIES.investigate, + mount: appMountWithStartPage('traces', '/traces'), + }); + + core.application.register({ + id: "observability-services-nav", + title: observabilityServicesTitle, + order: observabilityServicesPluginOrder, + category: DEFAULT_APP_CATEGORIES.investigate, + mount: appMountWithStartPage('traces', '/services'), + }); + } core.application.register({ id: observabilityNotebookID, diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index d7df3092b..20bdd63fa 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -124,4 +124,15 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Fri, 5 Jul 2024 09:13:15 -0700 Subject: [PATCH 05/28] Update breadcrumb for Trace to default to service page Signed-off-by: Adam Tackett --- public/components/trace_analytics/home.tsx | 11 +++-------- public/plugin.tsx | 12 ++++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/public/components/trace_analytics/home.tsx b/public/components/trace_analytics/home.tsx index d7ced3a35..caedfe70b 100644 --- a/public/components/trace_analytics/home.tsx +++ b/public/components/trace_analytics/home.tsx @@ -163,7 +163,7 @@ export const Home = (props: HomeProps) => { const serviceBreadcrumbs = [ { text: 'Trace analytics', - href: '#/', + href: '#/services', }, { text: 'Services', @@ -174,7 +174,7 @@ export const Home = (props: HomeProps) => { const traceBreadcrumbs = [ { text: 'Trace analytics', - href: '#/', + href: '#/services', }, { text: 'Traces', @@ -366,12 +366,7 @@ export const Home = (props: HomeProps) => { /> )} /> - ( - - )} - /> + } /> {flyout} {spanFlyoutComponent} diff --git a/public/plugin.tsx b/public/plugin.tsx index 36ce2f340..b5064bdf2 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -271,7 +271,9 @@ export class ObservabilityPlugin // prometheus: openSearchLocalDataSourcePluggable }; - const appMountWithStartPage = (startPage: string, defaultRoute?: string) => async (params: AppMountParameters) => { + const appMountWithStartPage = (startPage: string, defaultRoute?: string) => async ( + params: AppMountParameters + ) => { const { Observability } = await import('./components/index'); const [coreStart, depsStart] = await core.getStartServices(); const dslService = new DSLService(coreStart.http); @@ -291,7 +293,7 @@ export class ObservabilityPlugin dataSourcePluggables, // just pass down for now due to time constraint, later may better expose this as context dataSourceManagement, coreStart.savedObjects, - defaultRoute, + defaultRoute ); }; @@ -327,11 +329,9 @@ export class ObservabilityPlugin mount: appMountWithStartPage('traces'), }); - // NEEDS CORRECTION OR REFACTOR //ADAM - // The new-added applications need to be wrapped by a feature flag check. if (core.chrome.navGroup.getNavGroupEnabled()) { core.application.register({ - id: "observability-traces-nav", + id: 'observability-traces-nav', title: observabilityTracesTitle, order: observabilityTracesPluginOrder, category: DEFAULT_APP_CATEGORIES.investigate, @@ -339,7 +339,7 @@ export class ObservabilityPlugin }); core.application.register({ - id: "observability-services-nav", + id: 'observability-services-nav', title: observabilityServicesTitle, order: observabilityServicesPluginOrder, category: DEFAULT_APP_CATEGORIES.investigate, From 60ebb7c5fdc7cb66c579978c6d9bc78a0d370f7d Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Wed, 10 Jul 2024 11:36:49 -0700 Subject: [PATCH 06/28] Update snapshots Signed-off-by: Adam Tackett --- .../__snapshots__/log_config.test.tsx.snap | 8 +++++++ .../service_config.test.tsx.snap | 8 +++++++ .../__snapshots__/trace_config.test.tsx.snap | 8 +++++++ .../custom_panel_view.test.tsx.snap | 16 +++++++++++++ .../__snapshots__/panel_grid.test.tsx.snap | 4 ++++ .../__snapshots__/metrics_grid.test.tsx.snap | 8 +++++++ .../__snapshots__/dashboard.test.tsx.snap | 24 +++++++++++++++++++ .../__snapshots__/services.test.tsx.snap | 24 +++++++++++++++++++ .../__snapshots__/traces.test.tsx.snap | 24 +++++++++++++++++++ 9 files changed, 124 insertions(+) diff --git a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap index 284a2e51a..07bbed198 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap @@ -89,6 +89,10 @@ exports[`Log Config component renders empty log config 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -712,6 +716,10 @@ exports[`Log Config component renders with query 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap index 73f87a2de..a6fe2db73 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap @@ -89,6 +89,10 @@ exports[`Service Config component renders empty service config 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -1282,6 +1286,10 @@ exports[`Service Config component renders with one service selected 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap index 8b70a1a6a..e826e2cab 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap @@ -88,6 +88,10 @@ exports[`Trace Config component renders empty trace config 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -994,6 +998,10 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap index f5f95e97e..f11fbdd3a 100644 --- a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap +++ b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap @@ -1230,6 +1230,10 @@ exports[`Panels View Component renders panel view container with visualizations "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -3019,6 +3023,10 @@ exports[`Panels View Component renders panel view container with visualizations "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -3465,6 +3473,10 @@ exports[`Panels View Component renders panel view container without visualizatio "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -5138,6 +5150,10 @@ exports[`Panels View Component renders panel view container without visualizatio "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap index b47c7d629..e34037c52 100644 --- a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap +++ b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap @@ -246,6 +246,10 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap index 1b862c66c..45a5578a7 100644 --- a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap +++ b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap @@ -99,6 +99,10 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -261,6 +265,10 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap index d50f36ca0..3d120357a 100644 --- a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap +++ b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap @@ -102,6 +102,10 @@ exports[`Dashboard component renders dashboard 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -441,6 +445,10 @@ exports[`Dashboard component renders dashboard 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -1259,6 +1267,10 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -1597,6 +1609,10 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -2415,6 +2431,10 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -2755,6 +2775,10 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index 265e4e057..511e3efcd 100644 --- a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -102,6 +102,10 @@ exports[`Services component renders empty services page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -429,6 +433,10 @@ exports[`Services component renders empty services page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -2268,6 +2276,10 @@ exports[`Services component renders jaeger services page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -2596,6 +2608,10 @@ exports[`Services component renders jaeger services page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -3868,6 +3884,10 @@ exports[`Services component renders services page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -4195,6 +4215,10 @@ exports[`Services component renders services page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], diff --git a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap index 3521c7e23..d437f7b90 100644 --- a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap +++ b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap @@ -102,6 +102,10 @@ exports[`Traces component renders empty traces page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -428,6 +432,10 @@ exports[`Traces component renders empty traces page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -1719,6 +1727,10 @@ exports[`Traces component renders jaeger traces page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -2046,6 +2058,10 @@ exports[`Traces component renders jaeger traces page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -3342,6 +3358,10 @@ exports[`Traces component renders traces page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], @@ -3668,6 +3688,10 @@ exports[`Traces component renders traces page 1`] = ` "registerLeft": [MockFunction], "registerRight": [MockFunction], }, + "navGroup": Object { + "getNavGroupEnabled": [MockFunction], + "getNavGroupsMap$": [MockFunction], + }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], "get": [MockFunction], From 393815aaefb20a25abfc1b4801841b0f42a45f79 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 12 Jul 2024 16:50:04 +0800 Subject: [PATCH 07/28] feat: update Signed-off-by: SuZhou-Joe --- public/plugin_nav.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 20bdd63fa..6179b2775 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -27,6 +27,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 14:48:58 +0800 Subject: [PATCH 08/28] feat: add some features to all use case Signed-off-by: SuZhou-Joe --- public/plugin_nav.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 6179b2775..ce2a864ca 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -27,7 +27,6 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 11:47:09 -0700 Subject: [PATCH 09/28] Depreciated logs, application. Dashboards/Traces adjusted Signed-off-by: Adam Tackett --- common/constants/shared.ts | 1 - public/plugin.tsx | 41 ++++++++------------- public/plugin_nav.tsx | 73 ++------------------------------------ 3 files changed, 18 insertions(+), 97 deletions(-) diff --git a/common/constants/shared.ts b/common/constants/shared.ts index bafb5bf34..b80df28ce 100644 --- a/common/constants/shared.ts +++ b/common/constants/shared.ts @@ -63,7 +63,6 @@ export const observabilityNotebookPluginOrder = 5094; export const observabilityPanelsID = 'observability-dashboards'; export const observabilityPanelsTitle = 'Dashboards'; -export const observabilityPanelsTitleForNav = 'Observability-Dashboards'; export const observabilityPanelsPluginOrder = 5095; export const observabilityIntegrationsID = 'integrations'; diff --git a/public/plugin.tsx b/public/plugin.tsx index b5064bdf2..c865d4ae7 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -50,7 +50,6 @@ import { observabilityPanelsID, observabilityPanelsPluginOrder, observabilityPanelsTitle, - observabilityPanelsTitleForNav, observabilityPluginOrder, observabilityServicesPluginOrder, observabilityServicesTitle, @@ -321,14 +320,6 @@ export class ObservabilityPlugin mount: appMountWithStartPage('metrics'), }); - core.application.register({ - id: observabilityTracesID, - title: observabilityTracesTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityTracesPluginOrder, - mount: appMountWithStartPage('traces'), - }); - if (core.chrome.navGroup.getNavGroupEnabled()) { core.application.register({ id: 'observability-traces-nav', @@ -345,6 +336,14 @@ export class ObservabilityPlugin category: DEFAULT_APP_CATEGORIES.investigate, mount: appMountWithStartPage('traces', '/services'), }); + } else { + core.application.register({ + id: observabilityTracesID, + title: observabilityTracesTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityTracesPluginOrder, + mount: appMountWithStartPage('traces'), + }); } core.application.register({ @@ -355,23 +354,13 @@ export class ObservabilityPlugin mount: appMountWithStartPage('notebooks'), }); - if (core.chrome.navGroup.getNavGroupEnabled()) { - core.application.register({ - id: observabilityPanelsID, - title: observabilityPanelsTitleForNav, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityPanelsPluginOrder, - mount: appMountWithStartPage('dashboards'), - }); - } else { - core.application.register({ - id: observabilityPanelsID, - title: observabilityPanelsTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityPanelsPluginOrder, - mount: appMountWithStartPage('dashboards'), - }); - } + core.application.register({ + id: observabilityPanelsID, + title: observabilityPanelsTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityPanelsPluginOrder, + mount: appMountWithStartPage('dashboards'), + }); core.application.register({ id: observabilityIntegrationsID, diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index ce2a864ca..a2ee552e1 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -3,51 +3,15 @@ * SPDX-License-Identifier: Apache-2.0 */ import { - observabilityApplicationsID, observabilityIntegrationsID, - observabilityLogsID, observabilityMetricsID, observabilityNotebookID, - observabilityPanelsID, - observabilityTracesID, } from '../common/constants/shared'; import { CoreSetup } from '../../../src/core/public'; import { AppPluginStartDependencies } from './types'; import { DEFAULT_NAV_GROUPS, DEFAULT_APP_CATEGORIES } from '../../../src/core/public'; export function registerAllPluginNavGroups(core: CoreSetup) { - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ - { - id: observabilityApplicationsID, - category: DEFAULT_APP_CATEGORIES.dashboardAndReport, - }, - ]); - - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ - { - id: observabilityLogsID, - category: DEFAULT_APP_CATEGORIES.investigate, - }, - ]); - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS[`security-analytics`], [ - { - id: observabilityLogsID, - category: DEFAULT_APP_CATEGORIES.investigate, - }, - ]); - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.analytics, [ - { - id: observabilityLogsID, - category: DEFAULT_APP_CATEGORIES.investigate, - }, - ]); - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.search, [ - { - id: observabilityLogsID, - category: DEFAULT_APP_CATEGORIES.analyzeSearch, - }, - ]); - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityMetricsID, @@ -56,14 +20,6 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 14:29:24 -0700 Subject: [PATCH 10/28] Not registering logs/applications/dashboards when left nav used Signed-off-by: Adam Tackett --- public/plugin.tsx | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/public/plugin.tsx b/public/plugin.tsx index c865d4ae7..3245e64e7 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -296,22 +296,6 @@ export class ObservabilityPlugin ); }; - core.application.register({ - id: observabilityApplicationsID, - title: observabilityApplicationsTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityApplicationsPluginOrder, - mount: appMountWithStartPage('applications'), - }); - - core.application.register({ - id: observabilityLogsID, - title: observabilityLogsTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityLogsPluginOrder, - mount: appMountWithStartPage('logs'), - }); - core.application.register({ id: observabilityMetricsID, title: observabilityMetricsTitle, @@ -344,6 +328,28 @@ export class ObservabilityPlugin order: observabilityTracesPluginOrder, mount: appMountWithStartPage('traces'), }); + // depreciated in new Nav Groups. + core.application.register({ + id: observabilityPanelsID, + title: observabilityPanelsTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityPanelsPluginOrder, + mount: appMountWithStartPage('dashboards'), + }); + core.application.register({ + id: observabilityLogsID, + title: observabilityLogsTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityLogsPluginOrder, + mount: appMountWithStartPage('logs'), + }); + core.application.register({ + id: observabilityApplicationsID, + title: observabilityApplicationsTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityApplicationsPluginOrder, + mount: appMountWithStartPage('applications'), + }); } core.application.register({ @@ -354,14 +360,6 @@ export class ObservabilityPlugin mount: appMountWithStartPage('notebooks'), }); - core.application.register({ - id: observabilityPanelsID, - title: observabilityPanelsTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityPanelsPluginOrder, - mount: appMountWithStartPage('dashboards'), - }); - core.application.register({ id: observabilityIntegrationsID, title: observabilityIntegrationsTitle, From 080c17ce484d4f3b886c0e65254becb99afc45ef Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Wed, 17 Jul 2024 14:33:47 -0700 Subject: [PATCH 11/28] Update snapshots Signed-off-by: Adam Tackett --- .../__snapshots__/log_config.test.tsx.snap | 8 +++++++ .../service_config.test.tsx.snap | 8 +++++++ .../__snapshots__/trace_config.test.tsx.snap | 8 +++++++ .../custom_panel_view.test.tsx.snap | 16 +++++++++++++ .../__snapshots__/panel_grid.test.tsx.snap | 4 ++++ .../__snapshots__/metrics_grid.test.tsx.snap | 8 +++++++ .../__snapshots__/dashboard.test.tsx.snap | 24 +++++++++++++++++++ .../__snapshots__/services.test.tsx.snap | 24 +++++++++++++++++++ .../__snapshots__/traces.test.tsx.snap | 24 +++++++++++++++++++ 9 files changed, 124 insertions(+) diff --git a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap index 07bbed198..b9cbf75a8 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap @@ -84,14 +84,18 @@ exports[`Log Config component renders empty log config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -711,14 +715,18 @@ exports[`Log Config component renders with query 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap index a6fe2db73..7a5c88cd1 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap @@ -84,14 +84,18 @@ exports[`Service Config component renders empty service config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -1281,14 +1285,18 @@ exports[`Service Config component renders with one service selected 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap index e826e2cab..df0635399 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap @@ -83,14 +83,18 @@ exports[`Trace Config component renders empty trace config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -993,14 +997,18 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap index f11fbdd3a..e21d4d876 100644 --- a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap +++ b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap @@ -1225,14 +1225,18 @@ exports[`Panels View Component renders panel view container with visualizations "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -3018,14 +3022,18 @@ exports[`Panels View Component renders panel view container with visualizations "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -3468,14 +3476,18 @@ exports[`Panels View Component renders panel view container without visualizatio "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -5145,14 +5157,18 @@ exports[`Panels View Component renders panel view container without visualizatio "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap index e34037c52..1de0dda0e 100644 --- a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap +++ b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap @@ -241,14 +241,18 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap index 45a5578a7..2202044f2 100644 --- a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap +++ b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap @@ -94,14 +94,18 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -260,14 +264,18 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap index 3d120357a..799edafb8 100644 --- a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap +++ b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap @@ -97,14 +97,18 @@ exports[`Dashboard component renders dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -440,14 +444,18 @@ exports[`Dashboard component renders dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -1262,14 +1270,18 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -1604,14 +1616,18 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -2426,14 +2442,18 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -2770,14 +2790,18 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index 511e3efcd..9bbb4ce1a 100644 --- a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -97,14 +97,18 @@ exports[`Services component renders empty services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -428,14 +432,18 @@ exports[`Services component renders empty services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -2271,14 +2279,18 @@ exports[`Services component renders jaeger services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -2603,14 +2615,18 @@ exports[`Services component renders jaeger services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -3879,14 +3895,18 @@ exports[`Services component renders services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -4210,14 +4230,18 @@ exports[`Services component renders services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], diff --git a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap index d437f7b90..71c8d9a73 100644 --- a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap +++ b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap @@ -97,14 +97,18 @@ exports[`Traces component renders empty traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -427,14 +431,18 @@ exports[`Traces component renders empty traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -1722,14 +1730,18 @@ exports[`Traces component renders jaeger traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -2053,14 +2065,18 @@ exports[`Traces component renders jaeger traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -3353,14 +3369,18 @@ exports[`Traces component renders traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], @@ -3683,14 +3703,18 @@ exports[`Traces component renders traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { + "getCurrentNavGroup$": [MockFunction], "getNavGroupEnabled": [MockFunction], "getNavGroupsMap$": [MockFunction], + "setCurrentNavGroup": [MockFunction], }, "navLinks": Object { "enableForcedAppSwitcherNavigation": [MockFunction], From ec684c5143fe746eebf2fd883c3dbd7ad0cc8e82 Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Wed, 17 Jul 2024 14:41:58 -0700 Subject: [PATCH 12/28] fixing lint errors Signed-off-by: Adam Tackett --- public/components/app.tsx | 2 +- public/components/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/components/app.tsx b/public/components/app.tsx index 6ddaf9253..3b3d75381 100644 --- a/public/components/app.tsx +++ b/public/components/app.tsx @@ -70,7 +70,7 @@ export const App = ({ savedObjectsMDSClient, defaultRoute, }: ObservabilityAppDeps) => { - const { chrome, http, notifications, savedObjects: coreSavedObjects } = CoreStartProp; + const { chrome, http, notifications, savedObjects: _coreSavedObjects } = CoreStartProp; const parentBreadcrumb = { text: observabilityTitle, href: `${observabilityID}#/`, diff --git a/public/components/index.tsx b/public/components/index.tsx index c6dff99e6..853d463b3 100644 --- a/public/components/index.tsx +++ b/public/components/index.tsx @@ -21,10 +21,10 @@ export const Observability = ( timestampUtils: any, queryManager: QueryManager, startPage: string, - dataSourcePluggables, + dataSourcePluggables: any, dataSourceManagement: DataSourceManagementPluginSetup, savedObjectsMDSClient: CoreStart['savedObjects'], - defaultRoute?: string, + defaultRoute?: string ) => { const { setHeaderActionMenu } = AppMountParametersProp; const { dataSource } = DepsStart; From 493c16ce7a2c133e5f14e3ca7b1d00a0eba7e44b Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Wed, 17 Jul 2024 15:06:13 -0700 Subject: [PATCH 13/28] Put applications back Signed-off-by: Adam Tackett --- public/plugin.tsx | 15 ++++++++------- public/plugin_nav.tsx | 8 ++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/public/plugin.tsx b/public/plugin.tsx index 3245e64e7..ae4a5be9f 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -313,6 +313,14 @@ export class ObservabilityPlugin mount: appMountWithStartPage('traces', '/traces'), }); + core.application.register({ + id: observabilityApplicationsID, + title: observabilityApplicationsTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityApplicationsPluginOrder, + mount: appMountWithStartPage('applications'), + }); + core.application.register({ id: 'observability-services-nav', title: observabilityServicesTitle, @@ -343,13 +351,6 @@ export class ObservabilityPlugin order: observabilityLogsPluginOrder, mount: appMountWithStartPage('logs'), }); - core.application.register({ - id: observabilityApplicationsID, - title: observabilityApplicationsTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityApplicationsPluginOrder, - mount: appMountWithStartPage('applications'), - }); } core.application.register({ diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index a2ee552e1..cb338ff65 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ import { + observabilityApplicationsID, observabilityIntegrationsID, observabilityMetricsID, observabilityNotebookID, @@ -12,6 +13,13 @@ import { AppPluginStartDependencies } from './types'; import { DEFAULT_NAV_GROUPS, DEFAULT_APP_CATEGORIES } from '../../../src/core/public'; export function registerAllPluginNavGroups(core: CoreSetup) { + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityApplicationsID, + category: DEFAULT_APP_CATEGORIES.dashboardAndReport, + }, + ]); + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityMetricsID, From 782574707b60c73e1acd50aaee50a456264e5e33 Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Wed, 17 Jul 2024 16:38:50 -0700 Subject: [PATCH 14/28] update snapshots Signed-off-by: Adam Tackett --- .../__tests__/__snapshots__/log_config.test.tsx.snap | 4 ---- .../__snapshots__/service_config.test.tsx.snap | 4 ---- .../__snapshots__/trace_config.test.tsx.snap | 4 ---- .../__snapshots__/custom_panel_view.test.tsx.snap | 8 -------- .../__tests__/__snapshots__/panel_grid.test.tsx.snap | 2 -- .../__snapshots__/metrics_grid.test.tsx.snap | 4 ---- .../__tests__/__snapshots__/dashboard.test.tsx.snap | 12 ------------ .../__tests__/__snapshots__/services.test.tsx.snap | 12 ------------ .../__tests__/__snapshots__/traces.test.tsx.snap | 12 ------------ 9 files changed, 62 deletions(-) diff --git a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap index b9cbf75a8..7f1fe91c9 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap @@ -84,11 +84,9 @@ exports[`Log Config component renders empty log config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -715,11 +713,9 @@ exports[`Log Config component renders with query 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap index 7a5c88cd1..22f894095 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap @@ -84,11 +84,9 @@ exports[`Service Config component renders empty service config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1285,11 +1283,9 @@ exports[`Service Config component renders with one service selected 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap index df0635399..e1ef99b5b 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap @@ -83,11 +83,9 @@ exports[`Trace Config component renders empty trace config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -997,11 +995,9 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap index e21d4d876..976136576 100644 --- a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap +++ b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap @@ -1225,11 +1225,9 @@ exports[`Panels View Component renders panel view container with visualizations "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3022,11 +3020,9 @@ exports[`Panels View Component renders panel view container with visualizations "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3476,11 +3472,9 @@ exports[`Panels View Component renders panel view container without visualizatio "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5157,11 +5151,9 @@ exports[`Panels View Component renders panel view container without visualizatio "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap index 1de0dda0e..d61df46a5 100644 --- a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap +++ b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap @@ -241,11 +241,9 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap index 2202044f2..2cfb21425 100644 --- a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap +++ b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap @@ -94,11 +94,9 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -264,11 +262,9 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap index 799edafb8..e85278a15 100644 --- a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap +++ b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap @@ -97,11 +97,9 @@ exports[`Dashboard component renders dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -444,11 +442,9 @@ exports[`Dashboard component renders dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1270,11 +1266,9 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1616,11 +1610,9 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2442,11 +2434,9 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2790,11 +2780,9 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index 9bbb4ce1a..4964f087c 100644 --- a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -97,11 +97,9 @@ exports[`Services component renders empty services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -432,11 +430,9 @@ exports[`Services component renders empty services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2279,11 +2275,9 @@ exports[`Services component renders jaeger services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2615,11 +2609,9 @@ exports[`Services component renders jaeger services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3895,11 +3887,9 @@ exports[`Services component renders services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -4230,11 +4220,9 @@ exports[`Services component renders services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap index 71c8d9a73..d8c9e2d64 100644 --- a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap +++ b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap @@ -97,11 +97,9 @@ exports[`Traces component renders empty traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -431,11 +429,9 @@ exports[`Traces component renders empty traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1730,11 +1726,9 @@ exports[`Traces component renders jaeger traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2065,11 +2059,9 @@ exports[`Traces component renders jaeger traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3369,11 +3361,9 @@ exports[`Traces component renders traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3703,11 +3693,9 @@ exports[`Traces component renders traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], - "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], - "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { From f7a416d197511bbcb6bdb8e7abcc7b69458fbb15 Mon Sep 17 00:00:00 2001 From: Adam Tackett <105462877+TackAdam@users.noreply.github.com> Date: Wed, 17 Jul 2024 22:28:05 -0700 Subject: [PATCH 15/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index cb338ff65..48892342f 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -32,6 +32,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:28:17 -0700 Subject: [PATCH 16/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 48892342f..41299a921 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -39,6 +39,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:28:31 -0700 Subject: [PATCH 17/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 41299a921..07cc50ece 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -25,6 +25,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:28:39 -0700 Subject: [PATCH 18/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 07cc50ece..f19533022 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -47,6 +47,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:28:48 -0700 Subject: [PATCH 19/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index f19533022..ff5a25c3b 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -55,6 +55,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:28:56 -0700 Subject: [PATCH 20/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index ff5a25c3b..156ce8aa3 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -62,6 +62,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:29:19 -0700 Subject: [PATCH 21/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 156ce8aa3..ac170838a 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -69,6 +69,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:29:46 -0700 Subject: [PATCH 22/28] Update public/plugin_nav.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin_nav.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index ac170838a..5f4439ecc 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -78,11 +78,13 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Wed, 17 Jul 2024 22:30:39 -0700 Subject: [PATCH 23/28] Update public/plugin.tsx Co-authored-by: SuZhou-Joe Signed-off-by: Adam Tackett <105462877+TackAdam@users.noreply.github.com> --- public/plugin.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/plugin.tsx b/public/plugin.tsx index ae4a5be9f..26b998171 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -336,7 +336,7 @@ export class ObservabilityPlugin order: observabilityTracesPluginOrder, mount: appMountWithStartPage('traces'), }); - // depreciated in new Nav Groups. + // deprecated in new Nav Groups. core.application.register({ id: observabilityPanelsID, title: observabilityPanelsTitle, From 19177332c8539f17a2cb4c5cf3961381b95d91bb Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Wed, 17 Jul 2024 22:42:08 -0700 Subject: [PATCH 24/28] Removed applications from new nav Signed-off-by: Adam Tackett --- public/plugin.tsx | 15 +++++++-------- public/plugin_nav.tsx | 8 -------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/public/plugin.tsx b/public/plugin.tsx index 26b998171..791d79e8f 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -313,14 +313,6 @@ export class ObservabilityPlugin mount: appMountWithStartPage('traces', '/traces'), }); - core.application.register({ - id: observabilityApplicationsID, - title: observabilityApplicationsTitle, - category: OBSERVABILITY_APP_CATEGORIES.observability, - order: observabilityApplicationsPluginOrder, - mount: appMountWithStartPage('applications'), - }); - core.application.register({ id: 'observability-services-nav', title: observabilityServicesTitle, @@ -351,6 +343,13 @@ export class ObservabilityPlugin order: observabilityLogsPluginOrder, mount: appMountWithStartPage('logs'), }); + core.application.register({ + id: observabilityApplicationsID, + title: observabilityApplicationsTitle, + category: OBSERVABILITY_APP_CATEGORIES.observability, + order: observabilityApplicationsPluginOrder, + mount: appMountWithStartPage('applications'), + }); } core.application.register({ diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 5f4439ecc..dae6243df 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { - observabilityApplicationsID, observabilityIntegrationsID, observabilityMetricsID, observabilityNotebookID, @@ -13,13 +12,6 @@ import { AppPluginStartDependencies } from './types'; import { DEFAULT_NAV_GROUPS, DEFAULT_APP_CATEGORIES } from '../../../src/core/public'; export function registerAllPluginNavGroups(core: CoreSetup) { - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ - { - id: observabilityApplicationsID, - category: DEFAULT_APP_CATEGORIES.dashboardAndReport, - }, - ]); - core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityMetricsID, From 739620388411c5bdc12cdca702cf801163fddbe3 Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Thu, 18 Jul 2024 16:05:14 -0700 Subject: [PATCH 25/28] Add applications back, remove in app nav for trace, remove breadcrumbs while new navigation is active Signed-off-by: Adam Tackett --- .../components/app_table.tsx | 32 +++-- .../components/application.tsx | 42 ++++-- .../components/create.tsx | 44 +++--- public/components/metrics/index.tsx | 25 +++- .../notebooks/components/note_table.tsx | 25 +++- .../notebooks/components/notebook.tsx | 38 +++-- .../__snapshots__/services.test.tsx.snap | 72 +++++++++- .../components/services/service_view.tsx | 48 +++++-- .../components/services/services_content.tsx | 4 +- .../__snapshots__/traces.test.tsx.snap | 132 +++++++++++++++++- .../components/traces/trace_view.tsx | 50 +++++-- .../components/traces/traces_content.tsx | 10 +- public/components/trace_analytics/home.tsx | 41 ++++-- public/plugin.tsx | 15 +- public/plugin_nav.tsx | 9 ++ 15 files changed, 457 insertions(+), 130 deletions(-) diff --git a/public/components/application_analytics/components/app_table.tsx b/public/components/application_analytics/components/app_table.tsx index 616ee8c89..f64631031 100644 --- a/public/components/application_analytics/components/app_table.tsx +++ b/public/components/application_analytics/components/app_table.tsx @@ -37,13 +37,9 @@ import moment from 'moment'; import { DeleteModal } from '../../common/helpers/delete_modal'; import { AppAnalyticsComponentDeps } from '../home'; import { getCustomModal } from '../../custom_panels/helpers/modal_containers'; -import { - observabilityID, - observabilityTitle, - pageStyles, - UI_DATE_FORMAT, -} from '../../../../common/constants/shared'; +import { pageStyles, UI_DATE_FORMAT } from '../../../../common/constants/shared'; import { ApplicationType, AvailabilityType } from '../../../../common/types/application_analytics'; +import { coreRefs } from '../../../framework/core_refs'; interface AppTableProps extends AppAnalyticsComponentDeps { loading: boolean; @@ -74,13 +70,23 @@ export function AppTable(props: AppTableProps) { const createButtonText = 'Create application'; useEffect(() => { - chrome.setBreadcrumbs([ - ...parentBreadcrumbs, - { - text: 'Applications', - href: '#/', - }, - ]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + if (isNavGroupEnabled) { + chrome.setBreadcrumbs([ + { + text: 'Applications', + href: '#/', + }, + ]); + } else { + chrome.setBreadcrumbs([ + ...parentBreadcrumbs, + { + text: 'Applications', + href: '#/', + }, + ]); + } clear(); fetchApplications(); }, []); diff --git a/public/components/application_analytics/components/application.tsx b/public/components/application_analytics/components/application.tsx index 07301bed4..98b7de0f9 100644 --- a/public/components/application_analytics/components/application.tsx +++ b/public/components/application_analytics/components/application.tsx @@ -27,7 +27,6 @@ import { useHistory } from 'react-router-dom'; import { useDispatch } from 'react-redux'; import { VisualizationType } from 'common/types/custom_panels'; import { TracesContent } from '../../../components/trace_analytics/components/traces/traces_content'; -import { DashboardContent } from '../../../components/trace_analytics/components/dashboard/dashboard_content'; import { ServicesContent } from '../../trace_analytics/components/services/services_content'; import { filtersToDsl, @@ -42,7 +41,6 @@ import { TAB_LOG_ID, TAB_LOG_TITLE, TAB_OVERVIEW_ID, - TAB_OVERVIEW_TITLE, TAB_PANEL_ID, TAB_PANEL_TITLE, TAB_SERVICE_ID, @@ -65,7 +63,7 @@ import { SpanDetailFlyout } from '../../../../public/components/trace_analytics/ import { TraceDetailFlyout } from './flyout_components/trace_detail_flyout'; import { fetchAppById, initializeTabData } from '../helpers/utils'; import { QueryManager } from '../../../../common/query_manager/ppl_query_manager'; -import { observabilityApplicationsID } from '../../../../common/constants/shared'; +import { coreRefs } from '../../../framework/core_refs'; const searchBarConfigs = { [TAB_EVENT_ID]: { @@ -110,7 +108,6 @@ export function Application(props: AppDetailProps) { updateApp, setAppConfigs, setToasts, - toasts, setFilters, callback, queryManager, @@ -217,17 +214,32 @@ export function Application(props: AppDetailProps) { }, [appId]); useEffect(() => { - chrome.setBreadcrumbs([ - ...parentBreadcrumbs, - { - text: 'Applications', - href: '#/', - }, - { - text: application.name, - href: `#/${appId}`, - }, - ]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + if (isNavGroupEnabled) { + chrome.setBreadcrumbs([ + { + text: 'Applications', + href: '#/', + }, + { + text: application.name, + href: `#/${appId}`, + }, + ]); + } else { + chrome.setBreadcrumbs([ + ...parentBreadcrumbs, + { + text: 'Applications', + href: '#/', + }, + { + text: application.name, + href: `#/${appId}`, + }, + ]); + } + setStartTimeForApp(sessionStorage.getItem(`${application.name}StartTime`) || 'now-24h'); setEndTimeForApp(sessionStorage.getItem(`${application.name}EndTime`) || 'now'); }, [appId, application.name]); diff --git a/public/components/application_analytics/components/create.tsx b/public/components/application_analytics/components/create.tsx index cb5f1e9c2..23dc718d2 100644 --- a/public/components/application_analytics/components/create.tsx +++ b/public/components/application_analytics/components/create.tsx @@ -37,11 +37,8 @@ import { OptionType, } from '../../../../common/types/application_analytics'; import { fetchAppById } from '../helpers/utils'; -import { - observabilityApplicationsID, - observabilityID, - observabilityTitle, -} from '../../../../common/constants/shared'; +import { observabilityApplicationsID } from '../../../../common/constants/shared'; +import { coreRefs } from '../../../framework/core_refs'; interface CreateAppProps extends AppAnalyticsComponentDeps { dslService: DSLService; @@ -91,17 +88,32 @@ export const CreateApp = (props: CreateAppProps) => { }); useEffect(() => { - chrome.setBreadcrumbs([ - ...parentBreadcrumbs, - { - text: 'Applications', - href: '#/', - }, - { - text: editMode ? 'Edit' : 'Create', - href: `#/${editMode ? 'edit' : 'create'}`, - }, - ]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + if (isNavGroupEnabled) { + chrome.setBreadcrumbs([ + ...parentBreadcrumbs, + { + text: 'Applications', + href: '#/', + }, + { + text: editMode ? 'Edit' : 'Create', + href: `#/${editMode ? 'edit' : 'create'}`, + }, + ]); + } else { + chrome.setBreadcrumbs([ + ...parentBreadcrumbs, + { + text: 'Applications', + href: '#/', + }, + { + text: editMode ? 'Edit' : 'Create', + href: `#/${editMode ? 'edit' : 'create'}`, + }, + ]); + } }, []); useEffect(() => { diff --git a/public/components/metrics/index.tsx b/public/components/metrics/index.tsx index 9677d1e15..158f7b78d 100644 --- a/public/components/metrics/index.tsx +++ b/public/components/metrics/index.tsx @@ -27,6 +27,7 @@ import { setSelectedDataSourceMDSId } from './redux/slices/metrics_slice'; import { Sidebar } from './sidebar/sidebar'; import { TopMenu } from './top_menu/top_menu'; import { MetricsGrid } from './view/metrics_grid'; +import { coreRefs } from '../../framework/core_refs'; interface MetricsProps { parentBreadcrumb: ChromeBreadcrumb; @@ -57,13 +58,23 @@ export const Home = ({ const [reloadSidebar, setReloadSidebar] = useState(false); useEffect(() => { - chrome.setBreadcrumbs([ - parentBreadcrumb, - { - text: 'Metrics', - href: `#/`, - }, - ]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + if (isNavGroupEnabled) { + chrome.setBreadcrumbs([ + { + text: 'Metrics', + href: `#/`, + }, + ]); + } else { + chrome.setBreadcrumbs([ + parentBreadcrumb, + { + text: 'Metrics', + href: `#/`, + }, + ]); + } }, [chrome, parentBreadcrumb, dataSourceMDSId]); useEffect(() => { diff --git a/public/components/notebooks/components/note_table.tsx b/public/components/notebooks/components/note_table.tsx index d018ae7eb..04e467c31 100644 --- a/public/components/notebooks/components/note_table.tsx +++ b/public/components/notebooks/components/note_table.tsx @@ -43,6 +43,7 @@ import { getSampleNotebooksModal, } from './helpers/modal_containers'; import { NotebookType } from './main'; +import { coreRefs } from '../../../framework/core_refs'; interface NoteTableProps { loading: boolean; @@ -79,13 +80,23 @@ export function NoteTable({ const history = useHistory(); useEffect(() => { - setBreadcrumbs([ - parentBreadcrumb, - { - text: 'Notebooks', - href: '#/', - }, - ]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + if (isNavGroupEnabled) { + setBreadcrumbs([ + { + text: 'Notebooks', + href: '#/', + }, + ]); + } else { + setBreadcrumbs([ + parentBreadcrumb, + { + text: 'Notebooks', + href: '#/', + }, + ]); + } fetchNotebooks(); }, [setBreadcrumbs, parentBreadcrumb, fetchNotebooks]); diff --git a/public/components/notebooks/components/notebook.tsx b/public/components/notebooks/components/notebook.tsx index e79933342..59b8491ac 100644 --- a/public/components/notebooks/components/notebook.tsx +++ b/public/components/notebooks/components/notebook.tsx @@ -42,6 +42,7 @@ import { generateInContextReport, } from './helpers/reporting_context_menu_helper'; import { Paragraphs } from './paragraph_components/paragraphs'; +import { coreRefs } from '../../../framework/core_refs'; const panelStyles: CSS.Properties = { float: 'left', width: '100%', @@ -617,17 +618,32 @@ export class Notebook extends Component { }; setBreadcrumbs(path: string) { - this.props.setBreadcrumbs([ - this.props.parentBreadcrumb, - { - text: 'Notebooks', - href: '#/', - }, - { - text: path, - href: `#/${this.props.openedNoteId}`, - }, - ]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + + if (isNavGroupEnabled) { + this.props.setBreadcrumbs([ + { + text: 'Notebooks', + href: '#/', + }, + { + text: path, + href: `#/${this.props.openedNoteId}`, + }, + ]); + } else { + this.props.setBreadcrumbs([ + this.props.parentBreadcrumb, + { + text: 'Notebooks', + href: '#/', + }, + { + text: path, + href: `#/${this.props.openedNoteId}`, + }, + ]); + } } checkIfReportingPluginIsInstalled() { diff --git a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index 4964f087c..9087b8e60 100644 --- a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -104,7 +104,17 @@ exports[`Services component renders empty services page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -437,7 +447,17 @@ exports[`Services component renders empty services page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -2282,7 +2302,17 @@ exports[`Services component renders jaeger services page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -2616,7 +2646,17 @@ exports[`Services component renders jaeger services page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -3894,7 +3934,17 @@ exports[`Services component renders services page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -4227,7 +4277,17 @@ exports[`Services component renders services page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, diff --git a/public/components/trace_analytics/components/services/service_view.tsx b/public/components/trace_analytics/components/services/service_view.tsx index 7ca47e6fb..d7ad3bf04 100644 --- a/public/components/trace_analytics/components/services/service_view.tsx +++ b/public/components/trace_analytics/components/services/service_view.tsx @@ -100,22 +100,40 @@ export function ServiceView(props: ServiceViewProps) { }; useEffect(() => { + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); if (page !== 'serviceFlyout') - props.chrome.setBreadcrumbs([ - props.parentBreadcrumb, - { - text: 'Trace analytics', - href: '#/', - }, - { - text: 'Services', - href: '#/services', - }, - { - text: props.serviceName, - href: `#/services/${encodeURIComponent(props.serviceName)}`, - }, - ]); + if (isNavGroupEnabled) { + props.chrome.setBreadcrumbs([ + { + text: 'Trace analytics', + href: '#/', + }, + { + text: 'Services', + href: '#/services', + }, + { + text: props.serviceName, + href: `#/services/${encodeURIComponent(props.serviceName)}`, + }, + ]); + } else { + props.chrome.setBreadcrumbs([ + props.parentBreadcrumb, + { + text: 'Trace analytics', + href: '#/', + }, + { + text: 'Services', + href: '#/services', + }, + { + text: props.serviceName, + href: `#/services/${encodeURIComponent(props.serviceName)}`, + }, + ]); + } }, [props.serviceName]); const DataSourceMenu = props.dataSourceManagement?.ui?.getDataSourceMenu(); diff --git a/public/components/trace_analytics/components/services/services_content.tsx b/public/components/trace_analytics/components/services/services_content.tsx index e348237b4..c46d73ade 100644 --- a/public/components/trace_analytics/components/services/services_content.tsx +++ b/public/components/trace_analytics/components/services/services_content.tsx @@ -20,6 +20,7 @@ import { ServiceMap, ServiceObject } from '../common/plots/service_map'; import { SearchBar } from '../common/search_bar'; import { ServicesProps } from './services'; import { ServicesTable } from './services_table'; +import { coreRefs } from '../../../../framework/core_refs'; export function ServicesContent(props: ServicesProps) { const { @@ -60,7 +61,8 @@ export function ServicesContent(props: ServicesProps) { const searchBarRef = useRef<{ updateQuery: (newQuery: string) => void }>(null); useEffect(() => { - chrome.setBreadcrumbs([parentBreadcrumb, ...childBreadcrumbs]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + chrome.setBreadcrumbs([...(isNavGroupEnabled ? [] : [parentBreadcrumb]), ...childBreadcrumbs]); const validFilters = getValidFilterFields(mode, 'services', attributesFilterFields); setFilters([ diff --git a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap index d8c9e2d64..b65656a3d 100644 --- a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap +++ b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap @@ -104,7 +104,27 @@ exports[`Traces component renders empty traces page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -436,7 +456,27 @@ exports[`Traces component renders empty traces page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -1733,7 +1773,27 @@ exports[`Traces component renders jaeger traces page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -2066,7 +2126,27 @@ exports[`Traces component renders jaeger traces page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -3368,7 +3448,27 @@ exports[`Traces component renders traces page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, @@ -3700,7 +3800,27 @@ exports[`Traces component renders traces page 1`] = ` }, "navGroup": Object { "getCurrentNavGroup$": [MockFunction], - "getNavGroupEnabled": [MockFunction], + "getNavGroupEnabled": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + Object { + "type": "return", + "value": undefined, + }, + ], + }, "getNavGroupsMap$": [MockFunction], "setCurrentNavGroup": [MockFunction], }, diff --git a/public/components/trace_analytics/components/traces/trace_view.tsx b/public/components/trace_analytics/components/traces/trace_view.tsx index 38fed824c..81ae8c2a4 100644 --- a/public/components/trace_analytics/components/traces/trace_view.tsx +++ b/public/components/trace_analytics/components/traces/trace_view.tsx @@ -37,6 +37,7 @@ import { PanelTitle, filtersToDsl, processTimeStamp } from '../common/helper_fun import { ServiceMap, ServiceObject } from '../common/plots/service_map'; import { ServiceBreakdownPanel } from './service_breakdown_panel'; import { SpanDetailPanel } from './span_detail_panel'; +import { coreRefs } from '../../../../framework/core_refs'; interface TraceViewProps extends TraceAnalyticsCoreDeps { traceId: string; @@ -230,21 +231,40 @@ export function TraceView(props: TraceViewProps) { }, [serviceMap, ganttData]); useEffect(() => { - props.chrome.setBreadcrumbs([ - props.parentBreadcrumb, - { - text: 'Trace analytics', - href: '#/', - }, - { - text: 'Traces', - href: '#/traces', - }, - { - text: props.traceId, - href: `#/traces/${encodeURIComponent(props.traceId)}`, - }, - ]); + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + if (isNavGroupEnabled) { + props.chrome.setBreadcrumbs([ + props.parentBreadcrumb, + { + text: 'Trace analytics', + href: '#/', + }, + { + text: 'Traces', + href: '#/traces', + }, + { + text: props.traceId, + href: `#/traces/${encodeURIComponent(props.traceId)}`, + }, + ]); + } else { + props.chrome.setBreadcrumbs([ + props.parentBreadcrumb, + { + text: 'Trace analytics', + href: '#/', + }, + { + text: 'Traces', + href: '#/traces', + }, + { + text: props.traceId, + href: `#/traces/${encodeURIComponent(props.traceId)}`, + }, + ]); + } refresh(); }, [props.mode]); return ( diff --git a/public/components/trace_analytics/components/traces/traces_content.tsx b/public/components/trace_analytics/components/traces/traces_content.tsx index d70eb7f19..351f04e09 100644 --- a/public/components/trace_analytics/components/traces/traces_content.tsx +++ b/public/components/trace_analytics/components/traces/traces_content.tsx @@ -14,6 +14,7 @@ import { SearchBar } from '../common/search_bar'; import { DashboardContent } from '../dashboard/dashboard_content'; import { TracesProps } from './traces'; import { TracesTable } from './traces_table'; +import { coreRefs } from '../../../../framework/core_refs'; export function TracesContent(props: TracesProps) { const { @@ -25,7 +26,6 @@ export function TracesContent(props: TracesProps) { appConfigs, startTime, endTime, - parentBreadcrumb, childBreadcrumbs, traceIdColumnAction, setQuery, @@ -43,10 +43,14 @@ export function TracesContent(props: TracesProps) { const [redirect, setRedirect] = useState(true); const [loading, setLoading] = useState(false); const [trigger, setTrigger] = useState<'open' | 'closed'>('closed'); - + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); const DataSourceMenu = dataSourceManagement?.ui?.getDataSourceMenu(); + useEffect(() => { - chrome.setBreadcrumbs([parentBreadcrumb, ...childBreadcrumbs]); + chrome.setBreadcrumbs([ + ...(isNavGroupEnabled ? [] : [props.parentBreadcrumb]), + ...childBreadcrumbs, + ]); const validFilters = getValidFilterFields(mode, 'traces', attributesFilterFields); setFilters([ ...filters.map((filter) => ({ diff --git a/public/components/trace_analytics/home.tsx b/public/components/trace_analytics/home.tsx index caedfe70b..fa64df8f5 100644 --- a/public/components/trace_analytics/home.tsx +++ b/public/components/trace_analytics/home.tsx @@ -121,6 +121,8 @@ export const Home = (props: HomeProps) => { const [dataSourceMDSId, setDataSourceMDSId] = useState([{ id: '', label: '' }]); const [currentSelectedService, setCurrentSelectedService] = useState(''); const { defaultRoute = '/services' } = props; + const { chrome } = props; + const isNavGroupEnabled = chrome.navGroup.getNavGroupEnabled(); useEffect(() => { handleDataPrepperIndicesExistRequest( @@ -295,8 +297,19 @@ export const Home = (props: HomeProps) => { ( - + render={(_routerProps) => + !isNavGroupEnabled ? ( + + + + ) : ( { dataSourceMDSId={dataSourceMDSId} {...commonProps} /> - - )} + ) + } /> { ( - + render={(_routerProps) => + !isNavGroupEnabled ? ( + + + + ) : ( { dataSourceMDSId={dataSourceMDSId} {...commonProps} /> - - )} + ) + } /> ) { + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ + { + id: observabilityApplicationsID, + category: DEFAULT_APP_CATEGORIES.investigate, + order: 100, + }, + ]); + core.chrome.navGroup.addNavLinksToGroup(DEFAULT_NAV_GROUPS.observability, [ { id: observabilityMetricsID, From 0bbc6d49ce46350426b200f3c6f59068ac09b7b9 Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Thu, 18 Jul 2024 16:15:03 -0700 Subject: [PATCH 26/28] update snapshots Signed-off-by: Adam Tackett --- .../__tests__/__snapshots__/log_config.test.tsx.snap | 4 ++++ .../__snapshots__/service_config.test.tsx.snap | 4 ++++ .../__snapshots__/trace_config.test.tsx.snap | 4 ++++ .../__snapshots__/custom_panel_view.test.tsx.snap | 8 ++++++++ .../__tests__/__snapshots__/panel_grid.test.tsx.snap | 2 ++ .../__snapshots__/metrics_grid.test.tsx.snap | 4 ++++ .../__tests__/__snapshots__/dashboard.test.tsx.snap | 12 ++++++++++++ .../__tests__/__snapshots__/services.test.tsx.snap | 12 ++++++++++++ .../__tests__/__snapshots__/traces.test.tsx.snap | 12 ++++++++++++ 9 files changed, 62 insertions(+) diff --git a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap index 7f1fe91c9..b9cbf75a8 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap @@ -84,9 +84,11 @@ exports[`Log Config component renders empty log config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -713,9 +715,11 @@ exports[`Log Config component renders with query 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap index 22f894095..7a5c88cd1 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap @@ -84,9 +84,11 @@ exports[`Service Config component renders empty service config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1283,9 +1285,11 @@ exports[`Service Config component renders with one service selected 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap index e1ef99b5b..df0635399 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap @@ -83,9 +83,11 @@ exports[`Trace Config component renders empty trace config 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -995,9 +997,11 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap index 976136576..e21d4d876 100644 --- a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap +++ b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap @@ -1225,9 +1225,11 @@ exports[`Panels View Component renders panel view container with visualizations "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3020,9 +3022,11 @@ exports[`Panels View Component renders panel view container with visualizations "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3472,9 +3476,11 @@ exports[`Panels View Component renders panel view container without visualizatio "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5151,9 +5157,11 @@ exports[`Panels View Component renders panel view container without visualizatio "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap index d61df46a5..1de0dda0e 100644 --- a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap +++ b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap @@ -241,9 +241,11 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap index 2cfb21425..2202044f2 100644 --- a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap +++ b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap @@ -94,9 +94,11 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -262,9 +264,11 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap index e85278a15..799edafb8 100644 --- a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap +++ b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap @@ -97,9 +97,11 @@ exports[`Dashboard component renders dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -442,9 +444,11 @@ exports[`Dashboard component renders dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1266,9 +1270,11 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1610,9 +1616,11 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2434,9 +2442,11 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2780,9 +2790,11 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index 9087b8e60..4daf5081c 100644 --- a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -97,9 +97,11 @@ exports[`Services component renders empty services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -440,9 +442,11 @@ exports[`Services component renders empty services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2295,9 +2299,11 @@ exports[`Services component renders jaeger services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2639,9 +2645,11 @@ exports[`Services component renders jaeger services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3927,9 +3935,11 @@ exports[`Services component renders services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -4270,9 +4280,11 @@ exports[`Services component renders services page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap index b65656a3d..f9d320a81 100644 --- a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap +++ b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap @@ -97,9 +97,11 @@ exports[`Traces component renders empty traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -449,9 +451,11 @@ exports[`Traces component renders empty traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1766,9 +1770,11 @@ exports[`Traces component renders jaeger traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2119,9 +2125,11 @@ exports[`Traces component renders jaeger traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3441,9 +3449,11 @@ exports[`Traces component renders traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3793,9 +3803,11 @@ exports[`Traces component renders traces page 1`] = ` "navControls": Object { "getCenter$": [MockFunction], "getLeft$": [MockFunction], + "getLeftBottom$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], + "registerLeftBottom": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { From 453f17174040634609c861026215628275bc806f Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Thu, 18 Jul 2024 16:58:45 -0700 Subject: [PATCH 27/28] Adjust order of metrics/traces/services/applications as per guidance from kevin Signed-off-by: Adam Tackett --- public/plugin_nav.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/plugin_nav.tsx b/public/plugin_nav.tsx index 9432c5274..ac60a0ab9 100644 --- a/public/plugin_nav.tsx +++ b/public/plugin_nav.tsx @@ -17,7 +17,7 @@ export function registerAllPluginNavGroups(core: CoreSetup Date: Fri, 19 Jul 2024 10:21:03 -0700 Subject: [PATCH 28/28] function for nav breadcrumbs added Signed-off-by: Adam Tackett --- common/utils/set_nav_bread_crumbs.ts | 19 ++++++++++++ .../components/app_table.tsx | 21 ++++---------- .../components/application.tsx | 24 ++++----------- .../components/create.tsx | 25 ++++------------ public/components/metrics/index.tsx | 20 ++++--------- .../notebooks/components/note_table.tsx | 20 ++++--------- .../notebooks/components/notebook.tsx | 25 ++++------------ .../components/services/service_view.tsx | 27 ++++------------- .../components/traces/trace_view.tsx | 29 ++++--------------- 9 files changed, 67 insertions(+), 143 deletions(-) create mode 100644 common/utils/set_nav_bread_crumbs.ts diff --git a/common/utils/set_nav_bread_crumbs.ts b/common/utils/set_nav_bread_crumbs.ts new file mode 100644 index 000000000..908e0af30 --- /dev/null +++ b/common/utils/set_nav_bread_crumbs.ts @@ -0,0 +1,19 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { EuiBreadcrumb } from '@elastic/eui'; +import { coreRefs } from '../../public/framework/core_refs'; + +export const setNavBreadCrumbs = ( + parentBreadCrumb: EuiBreadcrumb[], + pageBreadCrumb: EuiBreadcrumb[] +) => { + const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); + if (isNavGroupEnabled) { + coreRefs?.chrome?.setBreadcrumbs([...pageBreadCrumb]); + } else { + coreRefs?.chrome?.setBreadcrumbs([...parentBreadCrumb, ...pageBreadCrumb]); + } +}; diff --git a/public/components/application_analytics/components/app_table.tsx b/public/components/application_analytics/components/app_table.tsx index f64631031..f9fd102b6 100644 --- a/public/components/application_analytics/components/app_table.tsx +++ b/public/components/application_analytics/components/app_table.tsx @@ -39,7 +39,7 @@ import { AppAnalyticsComponentDeps } from '../home'; import { getCustomModal } from '../../custom_panels/helpers/modal_containers'; import { pageStyles, UI_DATE_FORMAT } from '../../../../common/constants/shared'; import { ApplicationType, AvailabilityType } from '../../../../common/types/application_analytics'; -import { coreRefs } from '../../../framework/core_refs'; +import { setNavBreadCrumbs } from '../../../../common/utils/set_nav_bread_crumbs'; interface AppTableProps extends AppAnalyticsComponentDeps { loading: boolean; @@ -53,7 +53,6 @@ interface AppTableProps extends AppAnalyticsComponentDeps { export function AppTable(props: AppTableProps) { const { - chrome, applications, parentBreadcrumbs, fetchApplications, @@ -70,23 +69,15 @@ export function AppTable(props: AppTableProps) { const createButtonText = 'Create application'; useEffect(() => { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); - if (isNavGroupEnabled) { - chrome.setBreadcrumbs([ + setNavBreadCrumbs( + [...parentBreadcrumbs], + [ { text: 'Applications', href: '#/', }, - ]); - } else { - chrome.setBreadcrumbs([ - ...parentBreadcrumbs, - { - text: 'Applications', - href: '#/', - }, - ]); - } + ] + ); clear(); fetchApplications(); }, []); diff --git a/public/components/application_analytics/components/application.tsx b/public/components/application_analytics/components/application.tsx index 98b7de0f9..bb6fa8e1f 100644 --- a/public/components/application_analytics/components/application.tsx +++ b/public/components/application_analytics/components/application.tsx @@ -63,7 +63,7 @@ import { SpanDetailFlyout } from '../../../../public/components/trace_analytics/ import { TraceDetailFlyout } from './flyout_components/trace_detail_flyout'; import { fetchAppById, initializeTabData } from '../helpers/utils'; import { QueryManager } from '../../../../common/query_manager/ppl_query_manager'; -import { coreRefs } from '../../../framework/core_refs'; +import { setNavBreadCrumbs } from '../../../../common/utils/set_nav_bread_crumbs'; const searchBarConfigs = { [TAB_EVENT_ID]: { @@ -214,9 +214,9 @@ export function Application(props: AppDetailProps) { }, [appId]); useEffect(() => { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); - if (isNavGroupEnabled) { - chrome.setBreadcrumbs([ + setNavBreadCrumbs( + [...parentBreadcrumbs], + [ { text: 'Applications', href: '#/', @@ -225,20 +225,8 @@ export function Application(props: AppDetailProps) { text: application.name, href: `#/${appId}`, }, - ]); - } else { - chrome.setBreadcrumbs([ - ...parentBreadcrumbs, - { - text: 'Applications', - href: '#/', - }, - { - text: application.name, - href: `#/${appId}`, - }, - ]); - } + ] + ); setStartTimeForApp(sessionStorage.getItem(`${application.name}StartTime`) || 'now-24h'); setEndTimeForApp(sessionStorage.getItem(`${application.name}EndTime`) || 'now'); diff --git a/public/components/application_analytics/components/create.tsx b/public/components/application_analytics/components/create.tsx index 23dc718d2..0cce14a28 100644 --- a/public/components/application_analytics/components/create.tsx +++ b/public/components/application_analytics/components/create.tsx @@ -38,7 +38,7 @@ import { } from '../../../../common/types/application_analytics'; import { fetchAppById } from '../helpers/utils'; import { observabilityApplicationsID } from '../../../../common/constants/shared'; -import { coreRefs } from '../../../framework/core_refs'; +import { setNavBreadCrumbs } from '../../../../common/utils/set_nav_bread_crumbs'; interface CreateAppProps extends AppAnalyticsComponentDeps { dslService: DSLService; @@ -53,7 +53,6 @@ interface CreateAppProps extends AppAnalyticsComponentDeps { export const CreateApp = (props: CreateAppProps) => { const { parentBreadcrumbs, - chrome, http, query, name, @@ -88,9 +87,9 @@ export const CreateApp = (props: CreateAppProps) => { }); useEffect(() => { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); - if (isNavGroupEnabled) { - chrome.setBreadcrumbs([ + setNavBreadCrumbs( + [...parentBreadcrumbs], + [ ...parentBreadcrumbs, { text: 'Applications', @@ -100,20 +99,8 @@ export const CreateApp = (props: CreateAppProps) => { text: editMode ? 'Edit' : 'Create', href: `#/${editMode ? 'edit' : 'create'}`, }, - ]); - } else { - chrome.setBreadcrumbs([ - ...parentBreadcrumbs, - { - text: 'Applications', - href: '#/', - }, - { - text: editMode ? 'Edit' : 'Create', - href: `#/${editMode ? 'edit' : 'create'}`, - }, - ]); - } + ] + ); }, []); useEffect(() => { diff --git a/public/components/metrics/index.tsx b/public/components/metrics/index.tsx index 158f7b78d..14d830d3a 100644 --- a/public/components/metrics/index.tsx +++ b/public/components/metrics/index.tsx @@ -27,7 +27,7 @@ import { setSelectedDataSourceMDSId } from './redux/slices/metrics_slice'; import { Sidebar } from './sidebar/sidebar'; import { TopMenu } from './top_menu/top_menu'; import { MetricsGrid } from './view/metrics_grid'; -import { coreRefs } from '../../framework/core_refs'; +import { setNavBreadCrumbs } from '../../../common/utils/set_nav_bread_crumbs'; interface MetricsProps { parentBreadcrumb: ChromeBreadcrumb; @@ -58,23 +58,15 @@ export const Home = ({ const [reloadSidebar, setReloadSidebar] = useState(false); useEffect(() => { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); - if (isNavGroupEnabled) { - chrome.setBreadcrumbs([ + setNavBreadCrumbs( + [parentBreadcrumb], + [ { text: 'Metrics', href: `#/`, }, - ]); - } else { - chrome.setBreadcrumbs([ - parentBreadcrumb, - { - text: 'Metrics', - href: `#/`, - }, - ]); - } + ] + ); }, [chrome, parentBreadcrumb, dataSourceMDSId]); useEffect(() => { diff --git a/public/components/notebooks/components/note_table.tsx b/public/components/notebooks/components/note_table.tsx index 04e467c31..7462ff615 100644 --- a/public/components/notebooks/components/note_table.tsx +++ b/public/components/notebooks/components/note_table.tsx @@ -43,7 +43,7 @@ import { getSampleNotebooksModal, } from './helpers/modal_containers'; import { NotebookType } from './main'; -import { coreRefs } from '../../../framework/core_refs'; +import { setNavBreadCrumbs } from '../../../../common/utils/set_nav_bread_crumbs'; interface NoteTableProps { loading: boolean; @@ -80,23 +80,15 @@ export function NoteTable({ const history = useHistory(); useEffect(() => { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); - if (isNavGroupEnabled) { - setBreadcrumbs([ + setNavBreadCrumbs( + [parentBreadcrumb], + [ { text: 'Notebooks', href: '#/', }, - ]); - } else { - setBreadcrumbs([ - parentBreadcrumb, - { - text: 'Notebooks', - href: '#/', - }, - ]); - } + ] + ); fetchNotebooks(); }, [setBreadcrumbs, parentBreadcrumb, fetchNotebooks]); diff --git a/public/components/notebooks/components/notebook.tsx b/public/components/notebooks/components/notebook.tsx index 59b8491ac..38e0b7c49 100644 --- a/public/components/notebooks/components/notebook.tsx +++ b/public/components/notebooks/components/notebook.tsx @@ -42,7 +42,7 @@ import { generateInContextReport, } from './helpers/reporting_context_menu_helper'; import { Paragraphs } from './paragraph_components/paragraphs'; -import { coreRefs } from '../../../framework/core_refs'; +import { setNavBreadCrumbs } from '../../../../common/utils/set_nav_bread_crumbs'; const panelStyles: CSS.Properties = { float: 'left', width: '100%', @@ -618,10 +618,9 @@ export class Notebook extends Component { }; setBreadcrumbs(path: string) { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); - - if (isNavGroupEnabled) { - this.props.setBreadcrumbs([ + setNavBreadCrumbs( + [this.props.parentBreadcrumb], + [ { text: 'Notebooks', href: '#/', @@ -630,20 +629,8 @@ export class Notebook extends Component { text: path, href: `#/${this.props.openedNoteId}`, }, - ]); - } else { - this.props.setBreadcrumbs([ - this.props.parentBreadcrumb, - { - text: 'Notebooks', - href: '#/', - }, - { - text: path, - href: `#/${this.props.openedNoteId}`, - }, - ]); - } + ] + ); } checkIfReportingPluginIsInstalled() { diff --git a/public/components/trace_analytics/components/services/service_view.tsx b/public/components/trace_analytics/components/services/service_view.tsx index d7ad3bf04..dfb1461ac 100644 --- a/public/components/trace_analytics/components/services/service_view.tsx +++ b/public/components/trace_analytics/components/services/service_view.tsx @@ -50,6 +50,7 @@ import { SearchBarProps, renderDatePicker } from '../common/search_bar'; import { SpanDetailFlyout } from '../traces/span_detail_flyout'; import { SpanDetailTable } from '../traces/span_detail_table'; import { ServiceMetrics } from './service_metrics'; +import { setNavBreadCrumbs } from '../../../../../common/utils/set_nav_bread_crumbs'; interface ServiceViewProps extends TraceAnalyticsComponentDeps { serviceName: string; @@ -100,10 +101,10 @@ export function ServiceView(props: ServiceViewProps) { }; useEffect(() => { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); if (page !== 'serviceFlyout') - if (isNavGroupEnabled) { - props.chrome.setBreadcrumbs([ + setNavBreadCrumbs( + [props.parentBreadcrumb], + [ { text: 'Trace analytics', href: '#/', @@ -116,24 +117,8 @@ export function ServiceView(props: ServiceViewProps) { text: props.serviceName, href: `#/services/${encodeURIComponent(props.serviceName)}`, }, - ]); - } else { - props.chrome.setBreadcrumbs([ - props.parentBreadcrumb, - { - text: 'Trace analytics', - href: '#/', - }, - { - text: 'Services', - href: '#/services', - }, - { - text: props.serviceName, - href: `#/services/${encodeURIComponent(props.serviceName)}`, - }, - ]); - } + ] + ); }, [props.serviceName]); const DataSourceMenu = props.dataSourceManagement?.ui?.getDataSourceMenu(); diff --git a/public/components/trace_analytics/components/traces/trace_view.tsx b/public/components/trace_analytics/components/traces/trace_view.tsx index 81ae8c2a4..b95959967 100644 --- a/public/components/trace_analytics/components/traces/trace_view.tsx +++ b/public/components/trace_analytics/components/traces/trace_view.tsx @@ -37,7 +37,7 @@ import { PanelTitle, filtersToDsl, processTimeStamp } from '../common/helper_fun import { ServiceMap, ServiceObject } from '../common/plots/service_map'; import { ServiceBreakdownPanel } from './service_breakdown_panel'; import { SpanDetailPanel } from './span_detail_panel'; -import { coreRefs } from '../../../../framework/core_refs'; +import { setNavBreadCrumbs } from '../../../../../common/utils/set_nav_bread_crumbs'; interface TraceViewProps extends TraceAnalyticsCoreDeps { traceId: string; @@ -231,10 +231,9 @@ export function TraceView(props: TraceViewProps) { }, [serviceMap, ganttData]); useEffect(() => { - const isNavGroupEnabled = coreRefs?.chrome?.navGroup.getNavGroupEnabled(); - if (isNavGroupEnabled) { - props.chrome.setBreadcrumbs([ - props.parentBreadcrumb, + setNavBreadCrumbs( + [props.parentBreadcrumb], + [ { text: 'Trace analytics', href: '#/', @@ -247,24 +246,8 @@ export function TraceView(props: TraceViewProps) { text: props.traceId, href: `#/traces/${encodeURIComponent(props.traceId)}`, }, - ]); - } else { - props.chrome.setBreadcrumbs([ - props.parentBreadcrumb, - { - text: 'Trace analytics', - href: '#/', - }, - { - text: 'Traces', - href: '#/traces', - }, - { - text: props.traceId, - href: `#/traces/${encodeURIComponent(props.traceId)}`, - }, - ]); - } + ] + ); refresh(); }, [props.mode]); return (