= (props) => {
const isSecurityAnalyticsUseCase = currentNavGroup?.id === SECURITY_ANALYTICS_USE_CASE_ID;
useEffect(() => {
- setBreadcrumbs(isSecurityAnalyticsUseCase ? [ BREADCRUMBS.OVERVIEW] : [{...BREADCRUMBS.OVERVIEW, text: 'Security Analytics overview'}]);
+ setBreadcrumbs(
+ isSecurityAnalyticsUseCase
+ ? [BREADCRUMBS.OVERVIEW]
+ : [{ ...BREADCRUMBS.OVERVIEW, text: 'Security Analytics overview' }]
+ );
overviewViewModelActor.registerRefreshHandler(updateState, true /* allowPartialResults */);
overviewViewModelActor.registerRefreshHandler(
onLoadingComplete,
@@ -273,7 +277,13 @@ export const Overview: React.FC = (props) => {
{getOverviewsCardsProps().map((p, idx) => (
-
+
))}
diff --git a/public/utils/constants.ts b/public/utils/constants.ts
index 87e36ea2..25ab3da8 100644
--- a/public/utils/constants.ts
+++ b/public/utils/constants.ts
@@ -320,5 +320,3 @@ const LocalCluster: DataSourceOption = {
export const dataSourceObservable = new BehaviorSubject({});
export const DATA_SOURCE_NOT_SET_ERROR = 'Data source is not set';
-
-
diff --git a/public/utils/helpers.tsx b/public/utils/helpers.tsx
index 14527df3..ff3ba0b6 100644
--- a/public/utils/helpers.tsx
+++ b/public/utils/helpers.tsx
@@ -70,6 +70,7 @@ import {
getUseUpdatedUx,
setBrowserServices,
getDataSourceManagementPlugin,
+ getApplication,
} from '../services/utils/constants';
import DetectorsService from '../services/DetectorService';
import CorrelationService from '../services/CorrelationService';
@@ -84,6 +85,7 @@ import semver from 'semver';
import * as pluginManifest from '../../opensearch_dashboards.json';
import { DataSourceThreatAlertsCard } from '../components/DataSourceThreatAlertsCard/DataSourceThreatAlertsCard';
import { DataSourceAttributes } from '../../../../src/plugins/data_source/common/data_sources';
+import { RouteComponentProps } from 'react-router-dom';
export const parseStringsToOptions = (strings: string[]) => {
return strings.map((str) => ({ id: str, label: str }));
@@ -770,3 +772,12 @@ export function initializeServices(coreStart: CoreStart, indexPattern: CoreIndex
setBrowserServices(services);
DataStore.init(services, coreStart.notifications);
}
+
+export const buildRouteUrl = (appId: string, route: string) => {
+ const useUpdatedUx = getUseUpdatedUx();
+ if (useUpdatedUx) {
+ return getApplication().getUrlForApp(appId, { path: `#${route}` });
+ } else {
+ return `#${route}`;
+ }
+};