import { i18n } from '@kbn/i18n' ; import type { AppDeepLink } from 'src/core/public' ; import { ML_PAGES } from '../../../common/constants/locator' ; const OVERVIEW_LINK_DEEP_LINK = { id : 'mlOverviewDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.overview' , { defaultMessage : 'Overview' , } ) , path : `/${ ML_PAGES . OVERVIEW }` , } ; const ANOMALY_DETECTION_DEEP_LINK = { id : 'mlAnomalyDetectionDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.anomalyDetection' , { defaultMessage : 'Anomaly Detection' , } ) , path : `/${ ML_PAGES . ANOMALY_DETECTION_JOBS_MANAGE }` , } ; const DATA_FRAME_ANALYTICS_DEEP_LINK = { id : 'mlDataFrameAnalyticsDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.dataFrameAnalytics' , { defaultMessage : 'Data Frame Analytics' , } ) , path : `/${ ML_PAGES . DATA_FRAME_ANALYTICS_JOBS_MANAGE }` , } ; const MODEL_MANAGEMENT_DEEP_LINK = { id : 'mlModelManagementDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.trainedModels' , { defaultMessage : 'Trained Models' , } ) , path : `/${ ML_PAGES . TRAINED_MODELS_MANAGE }` , deepLinks : [ { id : 'mlNodesOverviewDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.modelManagement' , { defaultMessage : 'Model Management' , } ) , path : `/${ ML_PAGES . TRAINED_MODELS_MANAGE }` , } , { id : 'mlNodesOverviewDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.nodesOverview' , { defaultMessage : 'Nodes Overview' , } ) , path : `/${ ML_PAGES . TRAINED_MODELS_NODES }` , } , ] , } ; const DATA_VISUALIZER_DEEP_LINK = { id : 'dataVisualizerDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.dataVisualizer' , { defaultMessage : 'Data Visualizer' , } ) , path : `/${ ML_PAGES . DATA_VISUALIZER }` , } ; const FILE_UPLOAD_DEEP_LINK = { id : 'mlFileUploadDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.fileUpload' , { defaultMessage : 'File Upload' , } ) , keywords : [ 'CSV' , 'JSON' ] , path : `/${ ML_PAGES . DATA_VISUALIZER_FILE }` , } ; const INDEX_DATA_VISUALIZER_DEEP_LINK = { id : 'mlIndexDataVisualizerDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.indexDataVisualizer' , { defaultMessage : 'Index Data Visualizer' , } ) , path : `/${ ML_PAGES . DATA_VISUALIZER_INDEX_SELECT }` , } ; const SETTINGS_DEEP_LINK = { id : 'mlSettingsDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.settings' , { defaultMessage : 'Settings' , } ) , path : `/${ ML_PAGES . SETTINGS }` , deepLinks : [ { id : 'mlCalendarSettingsDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.calendarSettings' , { defaultMessage : 'Calendars' , } ) , path : `/${ ML_PAGES . CALENDARS_MANAGE }` , } , { id : 'mlFilterListsSettingsDeepLink' , title : i18n . translate ( 'xpack.ml.deepLink.filterListsSettings' , { defaultMessage : 'Filter Lists' , } ) , path : `/${ ML_PAGES . SETTINGS }` , } , ] , } ; export function getDeepLinks ( isFullLicense ) { const deepLinks = [ DATA_VISUALIZER_DEEP_LINK , FILE_UPLOAD_DEEP_LINK , INDEX_DATA_VISUALIZER_DEEP_LINK , ] ; if ( isFullLicense === true ) { deepLinks . push ( OVERVIEW_LINK_DEEP_LINK , ANOMALY_DETECTION_DEEP_LINK , DATA_FRAME_ANALYTICS_DEEP_LINK , MODEL_MANAGEMENT_DEEP_LINK , SETTINGS_DEEP_LINK ) ; } return deepLinks ; }