55 */
66
77import { RefreshInterval , TimeRange } from '../../../../../src/plugins/data/common/query' ;
8- import { JobId } from '../../../reporting/common/types ' ;
8+ import { JobId } from './anomaly_detection_jobs/job ' ;
99import { ML_PAGES } from '../constants/ml_url_generator' ;
10+ import { DataFrameAnalysisConfigType } from './data_frame_analytics' ;
1011
1112type OptionalPageState = object | undefined ;
1213
1314export type MLPageState < PageType , PageState > = PageState extends OptionalPageState
14- ? { page : PageType ; pageState ?: PageState }
15+ ? { page : PageType ; pageState ?: PageState ; excludeBasePath ?: boolean }
1516 : PageState extends object
16- ? { page : PageType ; pageState : PageState }
17- : { page : PageType } ;
18-
19- export const ANALYSIS_CONFIG_TYPE = {
20- OUTLIER_DETECTION : 'outlier_detection' ,
21- REGRESSION : 'regression' ,
22- CLASSIFICATION : 'classification' ,
23- } as const ;
24-
25- type DataFrameAnalyticsType = typeof ANALYSIS_CONFIG_TYPE [ keyof typeof ANALYSIS_CONFIG_TYPE ] ;
17+ ? { page : PageType ; pageState : PageState ; excludeBasePath ?: boolean }
18+ : { page : PageType ; excludeBasePath ?: boolean } ;
2619
2720export interface MlCommonGlobalState {
2821 time ?: TimeRange ;
22+ refreshInterval ?: RefreshInterval ;
2923}
3024export interface MlCommonAppState {
3125 [ key : string ] : any ;
@@ -42,16 +36,28 @@ export interface MlGenericUrlPageState extends MlIndexBasedSearchState {
4236 [ key : string ] : any ;
4337}
4438
45- export interface MlGenericUrlState {
46- page :
47- | typeof ML_PAGES . DATA_VISUALIZER_INDEX_VIEWER
48- | typeof ML_PAGES . ANOMALY_DETECTION_CREATE_JOB_SELECT_TYPE ;
49- pageState : MlGenericUrlPageState ;
50- }
39+ export type MlGenericUrlState = MLPageState <
40+ | typeof ML_PAGES . DATA_VISUALIZER_INDEX_VIEWER
41+ | typeof ML_PAGES . ANOMALY_DETECTION_CREATE_JOB
42+ | typeof ML_PAGES . ANOMALY_DETECTION_CREATE_JOB_SELECT_TYPE
43+ | typeof ML_PAGES . ANOMALY_DETECTION_CREATE_JOB_SELECT_INDEX
44+ | typeof ML_PAGES . OVERVIEW
45+ | typeof ML_PAGES . CALENDARS_MANAGE
46+ | typeof ML_PAGES . CALENDARS_NEW
47+ | typeof ML_PAGES . FILTER_LISTS_MANAGE
48+ | typeof ML_PAGES . FILTER_LISTS_NEW
49+ | typeof ML_PAGES . SETTINGS
50+ | typeof ML_PAGES . ACCESS_DENIED
51+ | typeof ML_PAGES . DATA_VISUALIZER
52+ | typeof ML_PAGES . DATA_VISUALIZER_FILE
53+ | typeof ML_PAGES . DATA_VISUALIZER_INDEX_SELECT ,
54+ MlGenericUrlPageState | undefined
55+ > ;
5156
5257export interface AnomalyDetectionQueryState {
5358 jobId ?: JobId ;
5459 groupIds ?: string [ ] ;
60+ globalState ?: MlCommonGlobalState ;
5561}
5662
5763export type AnomalyDetectionUrlState = MLPageState <
@@ -86,7 +92,7 @@ export interface ExplorerUrlPageState {
8692 /**
8793 * Job IDs
8894 */
89- jobIds : JobId [ ] ;
95+ jobIds ? : JobId [ ] ;
9096 /**
9197 * Optionally set the time range in the time picker.
9298 */
@@ -104,6 +110,7 @@ export interface ExplorerUrlPageState {
104110 */
105111 mlExplorerSwimlane ?: ExplorerAppState [ 'mlExplorerSwimlane' ] ;
106112 mlExplorerFilter ?: ExplorerAppState [ 'mlExplorerFilter' ] ;
113+ globalState ?: MlCommonGlobalState ;
107114}
108115
109116export type ExplorerUrlState = MLPageState < typeof ML_PAGES . ANOMALY_EXPLORER , ExplorerUrlPageState > ;
@@ -122,6 +129,7 @@ export interface TimeSeriesExplorerAppState {
122129 to ?: string ;
123130 } ;
124131 mlTimeSeriesExplorer ?: {
132+ forecastId ?: string ;
125133 detectorIndex ?: number ;
126134 entities ?: Record < string , string > ;
127135 } ;
@@ -131,10 +139,12 @@ export interface TimeSeriesExplorerAppState {
131139export interface TimeSeriesExplorerPageState
132140 extends Pick < TimeSeriesExplorerAppState , 'zoom' | 'query' > ,
133141 Pick < TimeSeriesExplorerGlobalState , 'refreshInterval' > {
134- jobIds : JobId [ ] ;
142+ jobIds ? : JobId [ ] ;
135143 timeRange ?: TimeRange ;
136144 detectorIndex ?: number ;
137145 entities ?: Record < string , string > ;
146+ forecastId ?: string ;
147+ globalState ?: MlCommonGlobalState ;
138148}
139149
140150export type TimeSeriesExplorerUrlState = MLPageState <
@@ -145,32 +155,43 @@ export type TimeSeriesExplorerUrlState = MLPageState<
145155export interface DataFrameAnalyticsQueryState {
146156 jobId ?: JobId | JobId [ ] ;
147157 groupIds ?: string [ ] ;
158+ globalState ?: MlCommonGlobalState ;
148159}
149160
150161export type DataFrameAnalyticsUrlState = MLPageState <
151162 typeof ML_PAGES . DATA_FRAME_ANALYTICS_JOBS_MANAGE ,
152163 DataFrameAnalyticsQueryState | undefined
153164> ;
154165
155- export interface DataVisualizerUrlState {
156- page :
157- | typeof ML_PAGES . DATA_VISUALIZER
158- | typeof ML_PAGES . DATA_VISUALIZER_FILE
159- | typeof ML_PAGES . DATA_VISUALIZER_INDEX_SELECT ;
160- }
161-
162166export interface DataFrameAnalyticsExplorationQueryState {
163167 ml : {
164168 jobId : JobId ;
165- analysisType : DataFrameAnalyticsType ;
169+ analysisType : DataFrameAnalysisConfigType ;
166170 } ;
167171}
168172
169173export type DataFrameAnalyticsExplorationUrlState = MLPageState <
170174 typeof ML_PAGES . DATA_FRAME_ANALYTICS_EXPLORATION ,
171175 {
172176 jobId : JobId ;
173- analysisType : DataFrameAnalyticsType ;
177+ analysisType : DataFrameAnalysisConfigType ;
178+ globalState ?: MlCommonGlobalState ;
179+ }
180+ > ;
181+
182+ export type CalendarEditUrlState = MLPageState <
183+ typeof ML_PAGES . CALENDARS_EDIT ,
184+ {
185+ calendarId : string ;
186+ globalState ?: MlCommonGlobalState ;
187+ }
188+ > ;
189+
190+ export type FilterEditUrlState = MLPageState <
191+ typeof ML_PAGES . FILTER_LISTS_EDIT ,
192+ {
193+ filterId : string ;
194+ globalState ?: MlCommonGlobalState ;
174195 }
175196> ;
176197
@@ -183,5 +204,6 @@ export type MlUrlGeneratorState =
183204 | TimeSeriesExplorerUrlState
184205 | DataFrameAnalyticsUrlState
185206 | DataFrameAnalyticsExplorationUrlState
186- | DataVisualizerUrlState
207+ | CalendarEditUrlState
208+ | FilterEditUrlState
187209 | MlGenericUrlState ;
0 commit comments