From b05bda3ceb49454ffcb03fd895a29335f5f27950 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Fri, 27 Mar 2020 18:31:07 -0400 Subject: [PATCH] update types --- .../classification_exploration.tsx | 6 +++--- .../components/classification_exploration/results_table.tsx | 3 ++- .../exploration_data_grid/exploration_data_grid.tsx | 4 +++- .../components/regression_exploration/results_table.tsx | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx index ba9d182b6671e..5c151166829ab 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx @@ -15,7 +15,7 @@ import { DATA_FRAME_TASK_STATE } from '../../../analytics_management/components/ import { ResultsSearchQuery, defaultSearchQuery } from '../../../../common/analytics'; import { LoadingPanel } from '../loading_panel'; import { getIndexPatternIdFromName } from '../../../../../util/index_utils'; -import { IIndexPattern } from '../../../../../../../../../../src/plugins/data/common/index_patterns'; +import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public'; import { newJobCapsService } from '../../../../../services/new_job_capabilities_service'; import { useMlContext } from '../../../../../contexts/ml'; import { isGetDataFrameAnalyticsStatsResponseOk } from '../../../analytics_management/services/analytics_service/get_analytics'; @@ -53,7 +53,7 @@ interface Props { export const ClassificationExploration: FC = ({ jobId }) => { const [jobConfig, setJobConfig] = useState(undefined); const [jobStatus, setJobStatus] = useState(undefined); - const [indexPattern, setIndexPattern] = useState(undefined); + const [indexPattern, setIndexPattern] = useState(undefined); const [isLoadingJobConfig, setIsLoadingJobConfig] = useState(false); const [isInitialized, setIsInitialized] = useState(false); const [jobConfigErrorMessage, setJobConfigErrorMessage] = useState(undefined); @@ -113,7 +113,7 @@ export const ClassificationExploration: FC = ({ jobId }) => { ? jobConfig.dest.index[0] : jobConfig.dest.index; const destIndexPatternId = getIndexPatternIdFromName(destIndex) || destIndex; - let indexP: IIndexPattern | undefined; + let indexP: IndexPattern | undefined; try { indexP = await mlContext.indexPatterns.get(destIndexPatternId); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx index c197bbf5a64d0..a7f58de1f0c8b 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx @@ -29,6 +29,7 @@ import { import { Query as QueryType } from '../../../analytics_management/components/analytics_list/common'; import { ES_FIELD_TYPES } from '../../../../../../../../../../src/plugins/data/public'; import { mlFieldFormatService } from '../../../../../services/field_format_service'; +import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public'; import { ColumnType, @@ -85,7 +86,7 @@ const showingFirstDocs = i18n.translate( ); interface Props { - indexPattern: any; // TODO: update + indexPattern: IndexPattern; jobConfig: DataFrameAnalyticsConfig; jobStatus?: DATA_FRAME_TASK_STATE; setEvaluateSearchQuery: React.Dispatch>; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx index 867c349841ea6..e88bc1cd06f95 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx @@ -14,6 +14,8 @@ import { euiDataGridStyle, euiDataGridToolbarSettings } from '../../../../common import { mlFieldFormatService } from '../../../../../services/field_format_service'; +import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public'; + const FEATURE_INFLUENCE = 'feature_influence'; const PAGE_SIZE_OPTIONS = [5, 10, 25, 50]; @@ -23,7 +25,7 @@ type TableItem = Record; interface ExplorationDataGridProps { colorRange: (d: number) => string; columns: any[]; - indexPattern: any; // TODO: update type + indexPattern: IndexPattern; pagination: Pagination; resultsField: string; rowCount: number; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx index fc7a4055fb2c5..f66b9f2126330 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx @@ -62,6 +62,7 @@ import { } from '../../../../common'; import { getTaskStateBadge } from '../../../analytics_management/components/analytics_list/columns'; import { DATA_FRAME_TASK_STATE } from '../../../analytics_management/components/analytics_list/common'; +import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public'; import { useExploreData, TableItem } from './use_explore_data'; import { ExplorationTitle } from './regression_exploration'; @@ -86,7 +87,7 @@ const showingFirstDocs = i18n.translate( ); interface Props { - indexPattern: any; // TODO: update type + indexPattern: IndexPattern; jobConfig: DataFrameAnalyticsConfig; jobStatus?: DATA_FRAME_TASK_STATE; setEvaluateSearchQuery: React.Dispatch>;