Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Mar 31, 2020
1 parent 174b75f commit b05bda3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -53,7 +53,7 @@ interface Props {
export const ClassificationExploration: FC<Props> = ({ jobId }) => {
const [jobConfig, setJobConfig] = useState<DataFrameAnalyticsConfig | undefined>(undefined);
const [jobStatus, setJobStatus] = useState<DATA_FRAME_TASK_STATE | undefined>(undefined);
const [indexPattern, setIndexPattern] = useState<any | undefined>(undefined);
const [indexPattern, setIndexPattern] = useState<IndexPattern | undefined>(undefined);
const [isLoadingJobConfig, setIsLoadingJobConfig] = useState<boolean>(false);
const [isInitialized, setIsInitialized] = useState<boolean>(false);
const [jobConfigErrorMessage, setJobConfigErrorMessage] = useState<undefined | string>(undefined);
Expand Down Expand Up @@ -113,7 +113,7 @@ export const ClassificationExploration: FC<Props> = ({ 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<React.SetStateAction<object>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -23,7 +25,7 @@ type TableItem = Record<string, any>;
interface ExplorationDataGridProps {
colorRange: (d: number) => string;
columns: any[];
indexPattern: any; // TODO: update type
indexPattern: IndexPattern;
pagination: Pagination;
resultsField: string;
rowCount: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<React.SetStateAction<object>>;
Expand Down

0 comments on commit b05bda3

Please sign in to comment.