diff --git a/public/components/getting_started/components/getting_started_queryAndAnalyze.tsx b/public/components/getting_started/components/getting_started_queryAndAnalyze.tsx index 8baa5c6766..7bdb468771 100644 --- a/public/components/getting_started/components/getting_started_queryAndAnalyze.tsx +++ b/public/components/getting_started/components/getting_started_queryAndAnalyze.tsx @@ -17,7 +17,7 @@ import { EuiTitle, } from '@elastic/eui'; import { coreRefs } from '../../../../public/framework/core_refs'; -import { fetchDashboardIds, fetchIndexPatternIds } from './utils'; +import { fetchDashboardIds, fetchIndexPatternIds, redirectToDashboards } from './utils'; interface QueryAndAnalyzeProps { isOpen: boolean; @@ -52,12 +52,6 @@ export const QueryAndAnalyze: React.FC = ({ } }; - const redirectToDashboards = (path: string) => { - coreRefs?.application!.navigateToApp('dashboards', { - path: `#/${path}`, - }); - }; - useEffect(() => { if (selectedTechnology !== '') { fetchIndexPatternContent(); diff --git a/public/components/getting_started/components/utils.tsx b/public/components/getting_started/components/utils.tsx index dd0e741525..728548bce4 100644 --- a/public/components/getting_started/components/utils.tsx +++ b/public/components/getting_started/components/utils.tsx @@ -58,3 +58,9 @@ export const fetchIndexPatternIds = async (tutorialId: string) => { console.error(err.message); } }; + +export const redirectToDashboards = (path: string) => { + coreRefs?.application!.navigateToApp('dashboards', { + path: `#/${path}`, + }); +}; diff --git a/public/components/overview/components/dashboard_controls.tsx b/public/components/overview/components/dashboard_controls.tsx index 30c2f80fac..0def53ebb6 100644 --- a/public/components/overview/components/dashboard_controls.tsx +++ b/public/components/overview/components/dashboard_controls.tsx @@ -16,6 +16,7 @@ import React from 'react'; import { OnTimeChangeProps } from '@opensearch-project/oui/src/eui_components/date_picker/super_date_picker/super_date_picker'; import { coreRefs } from '../../../framework/core_refs'; import { HOME_CONTENT_AREAS } from '../../../plugin_helpers/plugin_overview'; +import { redirectToDashboards } from '../../getting_started/components/utils'; interface Props { dashboardTitle: string; @@ -52,7 +53,7 @@ export function DashboardControls(props: Props) { - + redirectToDashboards('/view/' + props.dashboardId)}>

{props.dashboardTitle}