diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index fa8f6872..803aa48c 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -17,7 +17,8 @@ "opensearchDashboardsReact", "savedObjects", "visAugmenter", - "opensearchDashboardsUtils" + "opensearchDashboardsUtils", + "navigation" ], "server": true, "ui": true, diff --git a/public/pages/ConfigureModel/containers/__tests__/__snapshots__/ConfigureModel.test.tsx.snap b/public/pages/ConfigureModel/containers/__tests__/__snapshots__/ConfigureModel.test.tsx.snap index a7695db8..11e1c42a 100644 --- a/public/pages/ConfigureModel/containers/__tests__/__snapshots__/ConfigureModel.test.tsx.snap +++ b/public/pages/ConfigureModel/containers/__tests__/__snapshots__/ConfigureModel.test.tsx.snap @@ -1127,426 +1127,6 @@ exports[` spec editing model configuration renders the compone class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive" style="margin: 0px;" > -
-
- -
- -
-
-
-
-
-
-
- -
-
-
-
- -
-
-
- Enter a descriptive name. The name must be unique within this detector. Feature name must contain 1-64 characters. Valid characters are a-z, A-Z, 0-9, -(hyphen) and _(underscore). -
-
-
-
-
- -
-
-
- -
- -
-
-
-
-
- -
-
-
-
- -
- - - -
-
-
-
-
-
-
- -
-
-
-
- -
- - - -
-
-
-
- The aggregation method determines what constitutes an anomaly. For example, if you choose min(), the detector focuses on finding anomalies based on the minimum values of your feature. -
-
-
-
-
- -
-
- -
-
-
-
-
spec editing model configuration renders the compone

You can add up to - 4 + 5 more features.

diff --git a/public/pages/Dashboard/Components/utils/DashboardHeader.tsx b/public/pages/Dashboard/Components/utils/DashboardHeader.tsx index f39cf74f..5db03dba 100644 --- a/public/pages/Dashboard/Components/utils/DashboardHeader.tsx +++ b/public/pages/Dashboard/Components/utils/DashboardHeader.tsx @@ -20,9 +20,12 @@ import { import { PLUGIN_NAME, APP_PATH, + USE_NEW_HOME_PAGE, } from '../../../../utils/constants'; import { useLocation } from 'react-router-dom'; import { constructHrefWithDataSourceId, getDataSourceFromURL } from '../../../../pages/utils/helpers'; +import { getApplication, getNavigationUI, getUISettings } from '../../../../services'; +import { TopNavControlButtonData } from '../../../../../../../src/plugins/navigation/public'; export interface DashboardHeaderProps { hasDetectors: boolean; } @@ -32,8 +35,27 @@ export const DashboardHeader = (props: DashboardHeaderProps) => { const MDSQueryParams = getDataSourceFromURL(location); const dataSourceId = MDSQueryParams.dataSourceId; const createDetectorUrl = `${PLUGIN_NAME}#` + constructHrefWithDataSourceId(APP_PATH.CREATE_DETECTOR, dataSourceId, false); + const useUpdatedUX = getUISettings().get(USE_NEW_HOME_PAGE); + const { HeaderControl } = getNavigationUI(); + const { setAppRightControls } = getApplication(); - return ( + return useUpdatedUX ? ( + + ) : ( + <> @@ -54,5 +76,6 @@ export const DashboardHeader = (props: DashboardHeaderProps) => { ) : null} + ); -}; +} diff --git a/public/pages/Dashboard/Container/DashboardOverview.tsx b/public/pages/Dashboard/Container/DashboardOverview.tsx index a4feb1a2..66790547 100644 --- a/public/pages/Dashboard/Container/DashboardOverview.tsx +++ b/public/pages/Dashboard/Container/DashboardOverview.tsx @@ -45,7 +45,7 @@ import { getVisibleOptions, isDataSourceCompatible, } from '../../utils/helpers'; -import { BREADCRUMBS, MDS_BREADCRUMBS } from '../../../utils/constants'; +import { BREADCRUMBS, MDS_BREADCRUMBS, USE_NEW_HOME_PAGE } from '../../../utils/constants'; import { DETECTOR_STATE } from '../../../../server/utils/constants'; import { getDetectorStateOptions, @@ -64,6 +64,7 @@ import { getDataSourceEnabled, getNotifications, getSavedObjectsClient, + getUISettings, } from '../../../services'; import { RouteComponentProps } from 'react-router-dom'; @@ -163,6 +164,8 @@ export function DashboardOverview(props: OverviewProps) { const visibleIndices = get(opensearchState, 'indices', []) as CatIndex[]; const visibleAliases = get(opensearchState, 'aliases', []) as IndexAlias[]; + const useUpdatedUX = getUISettings().get(USE_NEW_HOME_PAGE); + const handleIndicesFilterChange = ( options: EuiComboBoxOptionProps[] ): void => { @@ -242,16 +245,32 @@ export function DashboardOverview(props: OverviewProps) { }, [errorGettingDetectors]); useEffect(() => { - if (dataSourceEnabled) { - core.chrome.setBreadcrumbs([ - MDS_BREADCRUMBS.ANOMALY_DETECTOR(MDSOverviewState.selectedDataSourceId), - MDS_BREADCRUMBS.DASHBOARD(MDSOverviewState.selectedDataSourceId), - ]); + if (useUpdatedUX) { + if (dataSourceEnabled) { + core.chrome.setBreadcrumbs([ + MDS_BREADCRUMBS.ANOMALY_DETECTOR(MDSOverviewState.selectedDataSourceId), + MDS_BREADCRUMBS.DASHBOARD(MDSOverviewState.selectedDataSourceId), + BREADCRUMBS.TITLE_REAL_TIME_DASHBOARD, + ]); + } else { + core.chrome.setBreadcrumbs([ + BREADCRUMBS.ANOMALY_DETECTOR, + BREADCRUMBS.DASHBOARD, + BREADCRUMBS.TITLE_REAL_TIME_DASHBOARD, + ]); + } } else { - core.chrome.setBreadcrumbs([ - BREADCRUMBS.ANOMALY_DETECTOR, - BREADCRUMBS.DASHBOARD, - ]); + if (dataSourceEnabled) { + core.chrome.setBreadcrumbs([ + MDS_BREADCRUMBS.ANOMALY_DETECTOR(MDSOverviewState.selectedDataSourceId), + MDS_BREADCRUMBS.DASHBOARD(MDSOverviewState.selectedDataSourceId), + ]); + } else { + core.chrome.setBreadcrumbs([ + BREADCRUMBS.ANOMALY_DETECTOR, + BREADCRUMBS.DASHBOARD, + ]); + } } }); diff --git a/public/pages/DefineDetector/containers/__tests__/DefineDetector.test.tsx b/public/pages/DefineDetector/containers/__tests__/DefineDetector.test.tsx index 0ba9421f..3ee22216 100644 --- a/public/pages/DefineDetector/containers/__tests__/DefineDetector.test.tsx +++ b/public/pages/DefineDetector/containers/__tests__/DefineDetector.test.tsx @@ -27,13 +27,30 @@ import { testDetectorDefinitionValues, } from '../../utils/constants'; -jest.mock('../../../../services', () => ({ - ...jest.requireActual('../../../../services'), +jest.mock('../../../../services', () => { + const originalModule = jest.requireActual('../../../../services'); - getDataSourceEnabled: () => ({ - enabled: false - }) -})); + return { + ...originalModule, + getDataSourceEnabled: () => ({ + enabled: false + }), + getUISettings: () => ({ + get: (flag) => { + if (flag === 'home:useNewHomePage') { + return false; + } + return originalModule.getUISettings().get(flag); + } + }), + getNavigationUI: () => ({ + HeaderControl: null + }), + getApplication: () => ({ + setAppRightControls: null, + }) + }; +}); const renderWithRouterEmpty = (isEdit: boolean = false) => ({ ...render( diff --git a/public/pages/DetectorDetail/components/DetectorControls/DetectorControls.tsx b/public/pages/DetectorDetail/components/DetectorControls/DetectorControls.tsx index 8c5b8543..8cbd0e20 100644 --- a/public/pages/DetectorDetail/components/DetectorControls/DetectorControls.tsx +++ b/public/pages/DetectorDetail/components/DetectorControls/DetectorControls.tsx @@ -19,6 +19,8 @@ import { EuiPopover, } from '@elastic/eui'; import { Detector } from '../../../../models/interfaces'; +import { getApplication, getNavigationUI, getUISettings } from '../../../../services'; +import { USE_NEW_HOME_PAGE } from '../../../../utils/constants'; interface DetectorControls { onEditDetector(): void; @@ -30,7 +32,11 @@ interface DetectorControls { } export const DetectorControls = (props: DetectorControls) => { const [isOpen, setIsOpen] = useState(false); - return ( + const useUpdatedUX = getUISettings().get(USE_NEW_HOME_PAGE); + const { HeaderControl } = getNavigationUI(); + const { setAppRightControls } = getApplication(); + + const ActionsPopover = ( { ); + const renderActionsPopover = () => { + return useUpdatedUX ? ( + + ) : ( + ActionsPopover + ); + }; + + return ( + renderActionsPopover() + ); }; diff --git a/public/pages/DetectorDetail/components/DetectorControls/__tests__/DetectorControls.test.tsx b/public/pages/DetectorDetail/components/DetectorControls/__tests__/DetectorControls.test.tsx index 9ac1d383..560a2e89 100644 --- a/public/pages/DetectorDetail/components/DetectorControls/__tests__/DetectorControls.test.tsx +++ b/public/pages/DetectorDetail/components/DetectorControls/__tests__/DetectorControls.test.tsx @@ -14,6 +14,28 @@ import { render } from '@testing-library/react'; import { DetectorControls } from '../DetectorControls'; import { UNITS } from '../../../../../models/interfaces'; +jest.mock('../../../../../services', () => { + const originalModule = jest.requireActual('../../../../../services'); + + return { + ...originalModule, + getUISettings: () => ({ + get: (flag) => { + if (flag === 'home:useNewHomePage') { + return false; + } + return originalModule.getUISettings().get(flag); + } + }), + getNavigationUI: () => ({ + HeaderControl: null + }), + getApplication: () => ({ + setAppRightControls: null, + }) + }; +}); + describe(' spec', () => { const detector = { primaryTerm: 1, diff --git a/public/pages/DetectorDetail/containers/DetectorDetail.tsx b/public/pages/DetectorDetail/containers/DetectorDetail.tsx index 0275ca62..f3c649e2 100644 --- a/public/pages/DetectorDetail/containers/DetectorDetail.tsx +++ b/public/pages/DetectorDetail/containers/DetectorDetail.tsx @@ -48,7 +48,7 @@ import { import { getAliases, getIndices } from '../../../redux/reducers/opensearch'; import { getErrorMessage, Listener } from '../../../utils/utils'; import { darkModeEnabled } from '../../../utils/opensearchDashboardsUtils'; -import { BREADCRUMBS, MDS_BREADCRUMBS } from '../../../utils/constants'; +import { BREADCRUMBS, MDS_BREADCRUMBS, USE_NEW_HOME_PAGE } from '../../../utils/constants'; import { DetectorControls } from '../components/DetectorControls'; import { ConfirmModal } from '../components/ConfirmModal/ConfirmModal'; import { useFetchMonitorInfo } from '../hooks/useFetchMonitorInfo'; @@ -70,6 +70,7 @@ import { getDataSourceEnabled, getNotifications, getSavedObjectsClient, + getUISettings, } from '../../../services'; import { constructHrefWithDataSourceId, getDataSourceFromURL } from '../../../pages/utils/helpers'; @@ -195,6 +196,8 @@ export const DetectorDetail = (props: DetectorDetailProps) => { deleteTyped: false, }); + const useUpdatedUX = getUISettings().get(USE_NEW_HOME_PAGE); + useHideSideNavBar(true, false); // Jump to top of page on first load @@ -435,6 +438,20 @@ export const DetectorDetail = (props: DetectorDetailProps) => { ); } + const renderPageHeader = () => { + if (useUpdatedUX) { + return null; + } else { + return ( + + +

{detector && detector.name}

+
+
+ ); + } + }; + return ( {!isEmpty(detector) && !hasError ? ( @@ -451,12 +468,7 @@ export const DetectorDetail = (props: DetectorDetailProps) => { justifyContent="spaceBetween" style={{ padding: '10px' }} > - - - {

{detector && detector.name}

} -
-
- + {renderPageHeader()} ({ useFetchDetectorInfo: jest.fn(), })); -jest.mock('../../../../services', () => ({ - ...jest.requireActual('../../../../services'), - - getDataSourceEnabled: () => ({ - enabled: false, - }), -})); +jest.mock('../../../../services', () => { + const originalModule = jest.requireActual('../../../../services'); + + return { + ...originalModule, + getDataSourceEnabled: () => ({ + enabled: false, + }), + getUISettings: () => ({ + get: (flag) => { + if (flag === 'home:useNewHomePage') { + return false; + } + return originalModule.getUISettings().get(flag); + } + }), + getNavigationUI: () => ({ + HeaderControl: null + }), + getApplication: () => ({ + setAppRightControls: null, + }) + }; +}); const detectorId = '4QY4YHEB5W9C7vlb3Mou'; diff --git a/public/pages/DetectorsList/containers/List/List.tsx b/public/pages/DetectorsList/containers/List/List.tsx index fbba6d6b..4b288479 100644 --- a/public/pages/DetectorsList/containers/List/List.tsx +++ b/public/pages/DetectorsList/containers/List/List.tsx @@ -42,7 +42,7 @@ import { getIndices, getPrioritizedIndices, } from '../../../../redux/reducers/opensearch'; -import { APP_PATH, MDS_BREADCRUMBS, PLUGIN_NAME } from '../../../../utils/constants'; +import { APP_PATH, MDS_BREADCRUMBS, PLUGIN_NAME, USE_NEW_HOME_PAGE } from '../../../../utils/constants'; import { DETECTOR_STATE } from '../../../../../server/utils/constants'; import { constructHrefWithDataSourceId, @@ -91,7 +91,11 @@ import { getDataSourceEnabled, getNotifications, getSavedObjectsClient, + getUISettings, + getNavigationUI, + getApplication, } from '../../../../services'; +import { TopNavControlButtonData } from '../../../../../../../src/plugins/navigation/public'; export interface ListRouterParams { from: string; @@ -717,10 +721,36 @@ export const DetectorList = (props: ListProps) => { const createDetectorUrl =`${PLUGIN_NAME}#` + constructHrefWithDataSourceId(APP_PATH.CREATE_DETECTOR, state.selectedDataSourceId, false); + const useUpdatedUX = getUISettings().get(USE_NEW_HOME_PAGE); + const { HeaderControl } = getNavigationUI(); + const { setAppRightControls } = getApplication(); + + const renderCreateButton = () => { + return useUpdatedUX ? ( + + ) : ( + null + ) + }; + return ( {dataSourceEnabled && renderDataSourceComponent} + {renderCreateButton()} { isStartDisabled={listActionsState.isStartDisabled} isStopDisabled={listActionsState.isStopDisabled} />, - Create detector - , + ), ]} > {confirmModal} diff --git a/public/pages/DetectorsList/containers/List/__tests__/List.test.tsx b/public/pages/DetectorsList/containers/List/__tests__/List.test.tsx index 3bc8c268..fa333434 100644 --- a/public/pages/DetectorsList/containers/List/__tests__/List.test.tsx +++ b/public/pages/DetectorsList/containers/List/__tests__/List.test.tsx @@ -31,13 +31,30 @@ import { DetectorList, ListRouterParams } from '../List'; import { DETECTOR_STATE } from '../../../../../../server/utils/constants'; import { CoreServicesContext } from '../../../../../components/CoreServices/CoreServices'; -jest.mock('../../../../../services', () => ({ - ...jest.requireActual('../../../../../services'), +jest.mock('../../../../../services', () => { + const originalModule = jest.requireActual('../../../../../services'); - getDataSourceEnabled: () => ({ - enabled: false - }) -})); + return { + ...originalModule, + getDataSourceEnabled: () => ({ + enabled: false + }), + getUISettings: () => ({ + get: (flag) => { + if (flag === 'home:useNewHomePage') { + return false; + } + return originalModule.getUISettings().get(flag); + } + }), + getNavigationUI: () => ({ + HeaderControl: null + }), + getApplication: () => ({ + setAppRightControls: null, + }) + }; +}); const renderWithRouter = ( initialAdState: Detectors = initialDetectorsState diff --git a/public/pages/Overview/containers/AnomalyDetectionOverview.tsx b/public/pages/Overview/containers/AnomalyDetectionOverview.tsx index 856ee1e4..dad34cb6 100644 --- a/public/pages/Overview/containers/AnomalyDetectionOverview.tsx +++ b/public/pages/Overview/containers/AnomalyDetectionOverview.tsx @@ -29,6 +29,7 @@ import { PLUGIN_NAME, BASE_DOCS_LINK, MDS_BREADCRUMBS, + USE_NEW_HOME_PAGE, } from '../../../utils/constants'; import { SAMPLE_TYPE } from '../../../../server/utils/constants'; import { GET_SAMPLE_INDICES_QUERY } from '../../utils/constants'; @@ -62,11 +63,15 @@ import { getDataSourceEnabled, getNotifications, getSavedObjectsClient, + getNavigationUI, + getApplication, + getUISettings, } from '../../../../public/services'; import { RouteComponentProps } from 'react-router-dom'; import queryString from 'querystring'; import { getDataSourceFromURL, getSampleDetectorsQueryParamsWithDataSouceId, isDataSourceCompatible } from '../../../../public/pages/utils/helpers'; import { MDSStates } from '../../../models/interfaces'; +import { TopNavControlButtonData } from '../../../../../../src/plugins/navigation/public'; interface AnomalyDetectionOverviewProps extends RouteComponentProps { setActionMenu: (menuMount: MountPoint | undefined) => void; @@ -109,12 +114,27 @@ export function AnomalyDetectionOverview(props: AnomalyDetectionOverviewProps) { : queryParams.dataSourceId, }); + const useUpdatedUX = getUISettings().get(USE_NEW_HOME_PAGE); + const { HeaderControl } = getNavigationUI(); + const { setAppRightControls, setAppDescriptionControls } = getApplication(); + // Set breadcrumbs on page initialization useEffect(() => { - if (dataSourceEnabled) { - core.chrome.setBreadcrumbs([MDS_BREADCRUMBS.ANOMALY_DETECTOR(MDSOverviewState.selectedDataSourceId)]); + if (useUpdatedUX) { + if (dataSourceEnabled) { + core.chrome.setBreadcrumbs([ + MDS_BREADCRUMBS.ANOMALY_DETECTOR(MDSOverviewState.selectedDataSourceId), + BREADCRUMBS.TITLE_GET_STARTED + ]); + } else { + core.chrome.setBreadcrumbs([BREADCRUMBS.ANOMALY_DETECTOR, BREADCRUMBS.TITLE_GET_STARTED]); + } } else { - core.chrome.setBreadcrumbs([BREADCRUMBS.ANOMALY_DETECTOR]); + if (dataSourceEnabled) { + core.chrome.setBreadcrumbs([MDS_BREADCRUMBS.ANOMALY_DETECTOR(MDSOverviewState.selectedDataSourceId)]); + } else { + core.chrome.setBreadcrumbs([BREADCRUMBS.ANOMALY_DETECTOR]); + } } }, []); @@ -239,6 +259,12 @@ export function AnomalyDetectionOverview(props: AnomalyDetectionOverviewProps) { } }; + const createDetectorUrl = + `${PLUGIN_NAME}#` + + (dataSourceEnabled + ? `${APP_PATH.CREATE_DETECTOR}?dataSourceId=${MDSOverviewState.selectedDataSourceId}` + : `${APP_PATH.CREATE_DETECTOR}`); + let renderDataSourceComponent = null; if (dataSourceEnabled) { const DataSourceMenu = @@ -265,20 +291,44 @@ export function AnomalyDetectionOverview(props: AnomalyDetectionOverviewProps) { }, [getSavedObjectsClient, getNotifications, props.setActionMenu]); } - const createDetectorUrl = - `${PLUGIN_NAME}#` + - (dataSourceEnabled - ? `${APP_PATH.CREATE_DETECTOR}?dataSourceId=${MDSOverviewState.selectedDataSourceId}` - : `${APP_PATH.CREATE_DETECTOR}`); - - return isLoadingSampleDetectors && isLoadingSampleIndices ? ( -
- -
- ) : ( - + const descriptionData = [ + { + renderComponent: ( + + The anomaly detection plugin automatically detects anomalies in your + data in near real-time using the Random Cut Forest (RCF) algorithm.{' '} + + Learn more + + + ), + }, + ]; + let renderPageHeader = () => { + return useUpdatedUX ? ( + <> + + + + ) : ( + <> - {dataSourceEnabled && renderDataSourceComponent} @@ -303,6 +353,19 @@ export function AnomalyDetectionOverview(props: AnomalyDetectionOverviewProps) { Learn more + + ) + }; + + return isLoadingSampleDetectors && isLoadingSampleIndices ? ( +
+ +
+ ) : ( + + {dataSourceEnabled && renderDataSourceComponent} + {renderPageHeader()} + diff --git a/public/pages/Overview/containers/__tests__/AnomalyDetectionOverview.test.tsx b/public/pages/Overview/containers/__tests__/AnomalyDetectionOverview.test.tsx index 23c2626f..f3814ab3 100644 --- a/public/pages/Overview/containers/__tests__/AnomalyDetectionOverview.test.tsx +++ b/public/pages/Overview/containers/__tests__/AnomalyDetectionOverview.test.tsx @@ -25,13 +25,31 @@ import configureStore from '../../../../redux/configureStore'; import { sampleHttpResponses } from '../../../Overview/utils/constants'; import { CoreServicesContext } from '../../../../components/CoreServices/CoreServices'; -jest.mock('../../../../services', () => ({ - ...jest.requireActual('../../../../services'), +jest.mock('../../../../services', () => { + const originalModule = jest.requireActual('../../../../services'); - getDataSourceEnabled: () => ({ - enabled: false - }) -})); + return { + ...originalModule, + getDataSourceEnabled: () => ({ + enabled: false + }), + getUISettings: () => ({ + get: (flag) => { + if (flag === 'home:useNewHomePage') { + return false; + } + return originalModule.getUISettings().get(flag); + } + }), + getNavigationUI: () => ({ + HeaderControl: null + }), + getApplication: () => ({ + setAppRightControls: null, + setAppDescriptionControls: null + }) + }; +}); const renderWithRouter = () => ({ diff --git a/public/plugin.ts b/public/plugin.ts index 00c211f0..95274204 100644 --- a/public/plugin.ts +++ b/public/plugin.ts @@ -41,6 +41,8 @@ import { setSavedObjectsClient, setDataSourceManagementPlugin, setDataSourceEnabled, + setNavigationUI, + setApplication } from './services'; import { AnomalyDetectionOpenSearchDashboardsPluginStart } from 'public'; import { @@ -51,6 +53,7 @@ import { UiActionsStart } from '../../../src/plugins/ui_actions/public'; import { DataPublicPluginStart } from '../../../src/plugins/data/public'; import { DataSourceManagementPluginSetup } from '../../../src/plugins/data_source_management/public'; import { DataSourcePluginSetup } from '../../../src/plugins/data_source/public'; +import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; declare module '../../../src/plugins/ui_actions/public' { export interface ActionContextMapping { @@ -73,6 +76,7 @@ export interface AnomalyDetectionStartDeps { visAugmenter: VisAugmenterStart; uiActions: UiActionsStart; data: DataPublicPluginStart; + navigation: NavigationPublicPluginStart; } export class AnomalyDetectionOpenSearchDashboardsPlugin @@ -192,7 +196,7 @@ export class AnomalyDetectionOpenSearchDashboardsPlugin public start( core: CoreStart, - { embeddable, visAugmenter, uiActions, data }: AnomalyDetectionStartDeps + { embeddable, visAugmenter, uiActions, data, navigation }: AnomalyDetectionStartDeps ): AnomalyDetectionOpenSearchDashboardsPluginStart { setUISettings(core.uiSettings); setEmbeddable(embeddable); @@ -202,6 +206,8 @@ export class AnomalyDetectionOpenSearchDashboardsPlugin setUiActions(uiActions); setQueryService(data.query); setSavedObjectsClient(core.savedObjects.client); + setNavigationUI(navigation.ui); + setApplication(core.application); return {}; } } diff --git a/public/services.ts b/public/services.ts index dbe060e6..0c3d45dd 100644 --- a/public/services.ts +++ b/public/services.ts @@ -15,7 +15,7 @@ import { EmbeddableStart } from '../../../src/plugins/embeddable/public'; import { createGetterSetter } from '../../../src/plugins/opensearch_dashboards_utils/public'; import { UiActionsStart } from '../../../src/plugins/ui_actions/public'; import { SavedAugmentVisLoader } from '../../../src/plugins/vis_augmenter/public'; -import { DataSourcePluginSetup } from '../../../src/plugins/data_source/public'; +import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; export interface DataSourceEnabled { enabled: boolean; @@ -54,6 +54,12 @@ export const [getDataSourceManagementPlugin, setDataSourceManagementPlugin] = export const [getDataSourceEnabled, setDataSourceEnabled] = createGetterSetter('DataSourceEnabled'); +export const [getNavigationUI, setNavigationUI] = + createGetterSetter('navigation'); + +export const [getApplication, setApplication] = + createGetterSetter('application'); + // This is primarily used for mocking this module and each of its fns in tests. export default { getSavedFeatureAnywhereLoader, diff --git a/public/utils/constants.ts b/public/utils/constants.ts index 562c5520..6b7f60b4 100644 --- a/public/utils/constants.ts +++ b/public/utils/constants.ts @@ -24,6 +24,8 @@ export const BREADCRUMBS = Object.freeze({ EDIT_DETECTOR: { text: 'Edit detector' }, DASHBOARD: { text: 'Dashboard', href: '#/dashboard' }, EDIT_MODEL_CONFIGURATION: { text: 'Edit model configuration' }, + TITLE_GET_STARTED: { text: 'Get started'}, + TITLE_REAL_TIME_DASHBOARD: { text: 'Real-time dashboard'}, }); export const MDS_BREADCRUMBS = Object.freeze({ @@ -113,4 +115,6 @@ export const OVERVIEW_PAGE_NAV_ID = `anomaly_detection_dashboard-overview`; export const DASHBOARD_PAGE_NAV_ID = `anomaly_detection_dashboard-dashboard`; -export const DETECTORS_PAGE_NAV_ID = `anomaly_detection_dashboard-detectors`; \ No newline at end of file +export const DETECTORS_PAGE_NAV_ID = `anomaly_detection_dashboard-detectors`; + +export const USE_NEW_HOME_PAGE = 'home:useNewHomePage'; \ No newline at end of file