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 8bb764eaa3..0ccc0ae60f 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 @@ -16,6 +16,7 @@ exports[`Log Config component renders empty log config 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -119,6 +120,7 @@ exports[`Log Config component renders empty log config 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -649,6 +651,7 @@ exports[`Log Config component renders with query 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -752,6 +755,7 @@ exports[`Log Config component renders with query 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [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 1f1a5410ae..2a759f4418 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 @@ -16,6 +16,7 @@ exports[`Service Config component renders empty service config 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -119,6 +120,7 @@ exports[`Service Config component renders empty service config 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -1219,6 +1221,7 @@ exports[`Service Config component renders with one service selected 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -1322,6 +1325,7 @@ exports[`Service Config component renders with one service selected 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [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 d18c22b8cf..9750299fa2 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 @@ -15,6 +15,7 @@ exports[`Trace Config component renders empty trace config 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -118,6 +119,7 @@ exports[`Trace Config component renders empty trace config 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -931,6 +933,7 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -1034,6 +1037,7 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [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 cfd039fcff..060e3fe8c6 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 @@ -888,6 +888,7 @@ exports[`Panels View Component renders panel view container with visualizations "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction] { "calls": Array [ @@ -1285,6 +1286,7 @@ exports[`Panels View Component renders panel view container with visualizations }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -2692,6 +2694,7 @@ exports[`Panels View Component renders panel view container with visualizations "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction] { "calls": Array [ @@ -3089,6 +3092,7 @@ exports[`Panels View Component renders panel view container with visualizations }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -3259,6 +3263,7 @@ exports[`Panels View Component renders panel view container without visualizatio "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction] { "calls": Array [ @@ -3545,6 +3550,7 @@ exports[`Panels View Component renders panel view container without visualizatio }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -4947,6 +4953,7 @@ exports[`Panels View Component renders panel view container without visualizatio "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction] { "calls": Array [ @@ -5233,6 +5240,7 @@ exports[`Panels View Component renders panel view container without visualizatio }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [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 092c81d0e8..cd8bc1e161 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 @@ -15,6 +15,7 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction] { "calls": Array [ @@ -276,6 +277,7 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], diff --git a/public/components/event_analytics/explorer/save_panel/__tests__/__snapshots__/save_panel.test.tsx.snap b/public/components/event_analytics/explorer/save_panel/__tests__/__snapshots__/save_panel.test.tsx.snap index b94a45bd65..bb9969e7c4 100644 --- a/public/components/event_analytics/explorer/save_panel/__tests__/__snapshots__/save_panel.test.tsx.snap +++ b/public/components/event_analytics/explorer/save_panel/__tests__/__snapshots__/save_panel.test.tsx.snap @@ -609,7 +609,7 @@ exports[`Saved query table component Renders saved query table 1`] = ` showLabel={true} >
- - - + + + + + +
- - + + diff --git a/public/components/metrics/top_menu/__tests__/__snapshots__/metrics_export_panel.test.tsx.snap b/public/components/metrics/top_menu/__tests__/__snapshots__/metrics_export_panel.test.tsx.snap index 9ea61d7515..3a5bc32eae 100644 --- a/public/components/metrics/top_menu/__tests__/__snapshots__/metrics_export_panel.test.tsx.snap +++ b/public/components/metrics/top_menu/__tests__/__snapshots__/metrics_export_panel.test.tsx.snap @@ -68,298 +68,26 @@ exports[`Export Metrics Panel Component renders Export Metrics Panel Component 1 } } > - -
-
- - - -
-
- -
- - -
-
-
-

- Select dashboards/applications -

- -
- -
-
- -
- -
- - - -
-
-
-
- - -
- - -
- Search existing dashboards or applications by name -
-
-
-
- + SAVE THE VIEW AS VISUALIZATION + + + +
+
- Metric Name #1 + Metric 1
@@ -481,7 +209,7 @@ exports[`Export Metrics Panel Component renders Export Metrics Panel Component 1 fullWidth={false} hasChildLabel={true} hasEmptyLabelSpace={false} - label="Metric Name #2" + label="Metric 2" labelType="label" >
- Metric Name #2 + Metric 2
@@ -554,6 +282,325 @@ exports[`Export Metrics Panel Component renders Export Metrics Panel Component 1
+ +
+ +
+ +
+

+ + Add to custom operational dashboards or applications. + +

+
+
+
+
+ +
+ +
+
+ + + +
+
+ +
+ + +
+
+
+

+ Select dashboards/applications +

+ +
+ +
+
+ +
+ +
+ + + +
+
+
+
+ + +
+ +
+
+ +
+ +
+
diff --git a/public/components/metrics/top_menu/__tests__/__snapshots__/top_menu.test.tsx.snap b/public/components/metrics/top_menu/__tests__/__snapshots__/top_menu.test.tsx.snap index fb8bd0c1b3..de619ec373 100644 --- a/public/components/metrics/top_menu/__tests__/__snapshots__/top_menu.test.tsx.snap +++ b/public/components/metrics/top_menu/__tests__/__snapshots__/top_menu.test.tsx.snap @@ -14,11 +14,12 @@ exports[`Metrics Top Menu Component renders Top Menu Component when enabled 1`] >
} + compressed={true} fullWidth={false} prepend="Span Interval" >
- +
- - -
- -
+ - - } +
- - +
+ - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="s" - > -
- + + + } - } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + isOpen={false} + ownFocus={true} + panelPaddingSize="s" + > +
+
+ + + +
+
+ + +
- +
+ + +
+
+
+
+ + +
+ + + + - - - - - + + + + + + + - - - - + + Refresh + + + + + + + + + + +
+
+
+
+
+
+
+ +
+ + + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + isOpen={false} + ownFocus={true} + panelPaddingSize="m" + > +
+
+ + + + - -
-
-
- -
- } - iconType={false} - isCustom={true} - startDateControl={
} - > -
- + + + + +
- - -
-
- -
-
- -
- - - - - - - - - - - -
-
-
-
-
-
-
- -
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="m" - > -
-
- - - - - - - -
+
+
+ +
+
- - - +
+
+
diff --git a/public/components/metrics/top_menu/__tests__/metrics_export.test.tsx b/public/components/metrics/top_menu/__tests__/metrics_export.test.tsx index d8d9d23908..ed5082dce4 100644 --- a/public/components/metrics/top_menu/__tests__/metrics_export.test.tsx +++ b/public/components/metrics/top_menu/__tests__/metrics_export.test.tsx @@ -44,6 +44,7 @@ const defaultInitialState = { refresh: 0, // set to new Date() to trigger }; +// eslint-disable-next-line jest/no-export export function renderWithMetricsProviders( ui: React.ReactElement, { @@ -56,6 +57,7 @@ export function renderWithMetricsProviders( ...renderOptions }: ExtendedRenderOptions = {} ) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars function Wrapper({ children }: PropsWithChildren<{}>): JSX.Element { return {children}; } @@ -147,7 +149,8 @@ describe('Export Metrics Panel Component', () => { expect(saveButton).toBeInTheDocument(); fireEvent.click(saveButton); - expect(await screen.findByText('Custom operational dashboards/application')); + // eslint-disable-next-line jest/valid-expect + expect(await screen.findByText('Dashboards and applications - optional')); userEvent.keyboard('{ESCAPE}'); diff --git a/public/components/metrics/top_menu/metrics_export.tsx b/public/components/metrics/top_menu/metrics_export.tsx index aa4c888ac1..dc5827806b 100644 --- a/public/components/metrics/top_menu/metrics_export.tsx +++ b/public/components/metrics/top_menu/metrics_export.tsx @@ -14,7 +14,7 @@ import { } from '@elastic/eui'; import { I18nProvider } from '@osd/i18n/react'; import max from 'lodash/max'; -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { useSelector } from 'react-redux'; import semver from 'semver'; @@ -51,6 +51,8 @@ const Savebutton = ({ }) => { return ( { setIsPanelOpen((staleState) => !staleState); @@ -58,25 +60,41 @@ const Savebutton = ({ data-test-subj="metrics__saveManagementPopover" iconType="arrowDown" > - Save + Save as visualization ); }; +const HeaderControlledPopoverWrapper = ({ children }: { children: React.ReactElement }) => { + const HeaderControl = coreRefs.navigation?.ui.HeaderControl; + const showActionsInHeader = coreRefs.chrome?.navGroup.getNavGroupEnabled(); + + if (showActionsInHeader && HeaderControl) { + return ( + + ); + } + + return <>{children}; +}; + const MetricsExportPopOver = () => { const availableObservabilityDashboards = useSelector(selectPanelList); - const [availableDashboards, setAvailableDashboards] = React.useState([]); - const [osdCoreDashboards, setOsdCoreDashboards] = React.useState([]); + const [availableDashboards, setAvailableDashboards] = useState([]); + const [osdCoreDashboards, setOsdCoreDashboards] = useState([]); - const [isPanelOpen, setIsPanelOpen] = React.useState(false); + const [isPanelOpen, setIsPanelOpen] = useState(false); const selectedMetrics = useSelector(selectedMetricsSelector); const selectedMetricsIds = useSelector(selectedMetricsIdsSelector); const dateSpanFilter = useSelector(dateSpanFilterSelector); - const [metricsToExport, setMetricsToExport] = React.useState([]); + const [metricsToExport, setMetricsToExport] = useState([]); - const [selectedPanelOptions, setSelectedPanelOptions] = React.useState([]); + const [selectedPanelOptions, setSelectedPanelOptions] = useState([]); const { toasts } = coreRefs; @@ -369,44 +387,46 @@ const MetricsExportPopOver = () => { }; return ( - } - isOpen={isPanelOpen} - closePopover={() => setIsPanelOpen(false)} - > - - - - - setIsPanelOpen(false)} - data-test-subj="metrics__SaveCancel" - > - Cancel - - - - { - handleSavingObjects().then(() => setIsPanelOpen(false)); - }} - data-test-subj="metrics__SaveConfirm" - > - Save - - - - - + + } + isOpen={isPanelOpen} + closePopover={() => setIsPanelOpen(false)} + > + + + + + setIsPanelOpen(false)} + data-test-subj="metrics__SaveCancel" + > + Cancel + + + + { + handleSavingObjects().then(() => setIsPanelOpen(false)); + }} + data-test-subj="metrics__SaveConfirm" + > + Save + + + + + + ); }; diff --git a/public/components/metrics/top_menu/metrics_export_panel.tsx b/public/components/metrics/top_menu/metrics_export_panel.tsx index 3884a55c27..40940911bb 100644 --- a/public/components/metrics/top_menu/metrics_export_panel.tsx +++ b/public/components/metrics/top_menu/metrics_export_panel.tsx @@ -3,15 +3,19 @@ * SPDX-License-Identifier: Apache-2.0 */ -import React, { useEffect } from 'react'; import { EuiComboBox, EuiFieldText, EuiFlexGroup, - EuiFormRow, EuiFlexItem, EuiForm, + EuiFormRow, + EuiHorizontalRule, + EuiSpacer, + EuiText, + EuiTitle, } from '@elastic/eui'; +import React, { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { MetricType } from '../../../../common/types/metrics'; import { fetchPanels } from '../../../../public/components/custom_panels/redux/panel_slice'; @@ -53,37 +57,27 @@ export const MetricsExportPanel = ({ return (
- - { - setSelectedPanelOptions(newOptions); - }} - selectedOptions={selectedPanelOptions} - options={ - availableDashboards?.map((option: any) => { - return { - panel: option, - label: option.title, - }; - }) ?? [] - } - isClearable={true} - data-test-subj="eventExplorer__querySaveComboBox" - /> - + +

SAVE THE VIEW AS VISUALIZATION

+
+ {metricsToExport.length > 0 && ( -
+
{metricsToExport.map((metaData: any, index: number) => { return ( - + )} + + + {!(metricsToExport.length > 0) && ( + + +

+ Save the view as visualization. You can add it to custom operational dashboards or + applications. +

+
+ +
+ )} + + {metricsToExport.length > 0 && ( + + +

+ Add to custom operational dashboards or applications. +

+
+
+ )} + + + + { + setSelectedPanelOptions(newOptions); + }} + selectedOptions={selectedPanelOptions} + options={ + availableDashboards?.map((option: any) => ({ + panel: option, + label: option.title, + })) ?? [] + } + isClearable={true} + data-test-subj="eventExplorer__querySaveComboBox" + /> + + +
); }; diff --git a/public/components/metrics/top_menu/top_menu.scss b/public/components/metrics/top_menu/top_menu.scss index ff247f31d3..0906b1136f 100644 --- a/public/components/metrics/top_menu/top_menu.scss +++ b/public/components/metrics/top_menu/top_menu.scss @@ -14,3 +14,7 @@ .metrics-search-bar-datepicker { width: 500px; } + +.resolutionSelectOption { + line-height: inherit; +} diff --git a/public/components/metrics/top_menu/top_menu.tsx b/public/components/metrics/top_menu/top_menu.tsx index 521300b5fb..8ebc5d87ab 100644 --- a/public/components/metrics/top_menu/top_menu.tsx +++ b/public/components/metrics/top_menu/top_menu.tsx @@ -26,10 +26,11 @@ export const TopMenu = () => { return ( dateSpanFilter && ( <> - +
{ />
- - dispatch(setDateSpan(dateSpan))} - recentlyUsedRanges={dateSpanFilter.recentlyUsedRanges} - /> - - + + + dispatch(setDateSpan(dateSpan))} + recentlyUsedRanges={dateSpanFilter.recentlyUsedRanges} + /> + + + + +
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 2d9986f51e..ea4b819488 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 @@ -26,6 +26,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -129,6 +130,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -198,6 +200,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -301,6 +304,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "setBreadcrumbs": [MockFunction], "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [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 5455a36e57..f416ed9600 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 @@ -29,6 +29,7 @@ exports[`Dashboard component renders dashboard 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -174,6 +175,7 @@ exports[`Dashboard component renders dashboard 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -398,6 +400,7 @@ exports[`Dashboard component renders dashboard 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -543,6 +546,7 @@ exports[`Dashboard component renders dashboard 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -1246,6 +1250,7 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -1391,6 +1396,7 @@ exports[`Dashboard component renders empty dashboard 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -1614,6 +1620,7 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -1759,6 +1766,7 @@ exports[`Dashboard component renders empty dashboard 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -2462,6 +2470,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -2607,6 +2616,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -2832,6 +2842,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -2977,6 +2988,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [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 71f193d6e1..ed324808ee 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 @@ -29,6 +29,7 @@ exports[`Services component renders empty services page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -167,6 +168,7 @@ exports[`Services component renders empty services page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -376,6 +378,7 @@ exports[`Services component renders empty services page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -514,6 +517,7 @@ exports[`Services component renders empty services page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -2239,6 +2243,7 @@ exports[`Services component renders jaeger services page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -2374,6 +2379,7 @@ exports[`Services component renders jaeger services page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -2587,6 +2593,7 @@ exports[`Services component renders jaeger services page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -2722,6 +2729,7 @@ exports[`Services component renders jaeger services page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -3883,6 +3891,7 @@ exports[`Services component renders services page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -4018,6 +4027,7 @@ exports[`Services component renders services page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -4230,6 +4240,7 @@ exports[`Services component renders services page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -4365,6 +4376,7 @@ exports[`Services component renders services page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [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 15c83154e1..1cdc7e0986 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 @@ -29,6 +29,7 @@ exports[`Traces component renders empty traces page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -177,6 +178,7 @@ exports[`Traces component renders empty traces page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -385,6 +387,7 @@ exports[`Traces component renders empty traces page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -533,6 +536,7 @@ exports[`Traces component renders empty traces page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -1710,6 +1714,7 @@ exports[`Traces component renders jaeger traces page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -1855,6 +1860,7 @@ exports[`Traces component renders jaeger traces page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -2067,6 +2073,7 @@ exports[`Traces component renders jaeger traces page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -2212,6 +2219,7 @@ exports[`Traces component renders jaeger traces page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -3397,6 +3405,7 @@ exports[`Traces component renders traces page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -3542,6 +3551,7 @@ exports[`Traces component renders traces page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], @@ -3753,6 +3763,7 @@ exports[`Traces component renders traces page 1`] = ` "getBreadcrumbsEnricher$": [MockFunction], "getCustomNavLink$": [MockFunction], "getHeaderComponent": [MockFunction], + "getHeaderVariant$": [MockFunction], "getHelpExtension$": [MockFunction], "getIsNavDrawerLocked$": [MockFunction], "getIsVisible$": [MockFunction], @@ -3898,6 +3909,7 @@ exports[`Traces component renders traces page 1`] = ` }, "setBreadcrumbsEnricher": [MockFunction], "setCustomNavLink": [MockFunction], + "setHeaderVariant": [MockFunction], "setHelpExtension": [MockFunction], "setHelpSupportUrl": [MockFunction], "setIsVisible": [MockFunction], diff --git a/public/framework/core_refs.ts b/public/framework/core_refs.ts index b78240e01b..8c5d6505b4 100644 --- a/public/framework/core_refs.ts +++ b/public/framework/core_refs.ts @@ -14,7 +14,9 @@ import { SavedObjectsClientContract, } from '../../../../src/core/public'; import { DashboardStart } from '../../../../src/plugins/dashboard/public'; +import { DataSourceStart } from '../../../../src/plugins/data/public/data_sources/datasource_services/types'; import { DataSourcePluginStart } from '../../../../src/plugins/data_source/public'; +import { NavigationPublicPluginStart } from '../../../../src/plugins/navigation/public'; import PPLService from '../services/requests/ppl'; class CoreRefs { @@ -34,6 +36,8 @@ class CoreRefs { public dashboardProviders?: unknown; public overlays?: OverlayStart; public dataSource?: DataSourcePluginStart; + public dataSources?: DataSourceStart; + public navigation?: NavigationPublicPluginStart; private constructor() { // ... } diff --git a/public/plugin.tsx b/public/plugin.tsx index 5b105e2393..8bc9b8c07d 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -438,6 +438,7 @@ export class ObservabilityPlugin coreRefs.summarizeEnabled = this.config.summarize.enabled; coreRefs.overlays = core.overlays; coreRefs.dataSource = startDeps.dataSource; + coreRefs.navigation = startDeps.navigation; const { dataSourceService, dataSourceFactory } = startDeps.data.dataSources; dataSourceFactory.registerDataSourceType(S3_DATA_SOURCE_TYPE, S3DataSource);