Skip to content

Commit

Permalink
Fix types per review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
wylieconlon committed Dec 1, 2020
1 parent 1cb8e36 commit 5b84ce1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@elastic/eui';
import { IndexPatternDimensionEditorProps } from './dimension_panel';
import { OperationSupportMatrix } from './operation_support';
import { IndexPatternColumn, OperationType } from '../indexpattern';
import { IndexPatternColumn } from '../indexpattern';
import {
operationDefinitionMap,
getOperationDisplay,
Expand Down Expand Up @@ -113,7 +113,7 @@ export function DimensionEditor(props: DimensionEditorProps) {
selectedColumn && operationDefinitionMap[selectedColumn.operationType];

const incompleteInfo = (state.layers[layerId].incompleteColumns ?? {})[columnId];
const incompleteOperation = (incompleteInfo?.operationType as OperationType) ?? null;
const incompleteOperation = incompleteInfo?.operationType;
const incompleteField = incompleteInfo?.sourceField ?? null;

const ParamEditor = selectedOperationDefinition?.paramEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export interface FieldChoice {

export interface FieldSelectProps extends EuiComboBoxProps<{}> {
currentIndexPattern: IndexPattern;
incompleteOperation: OperationType | null;
selectedOperationType?: OperationType;
selectedField?: string;
incompleteOperation?: OperationType;
operationSupportMatrix: OperationSupportMatrix;
onChoose: (choice: FieldChoice) => void;
onDeleteColumn: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,8 @@ describe('IndexPattern Data Source', () => {
columnOrder: [],
columns: {},
incompleteColumns: {
col1: { operationType: 'avg' },
col2: { operationType: 'sum' },
col1: { operationType: 'avg' as const },
col2: { operationType: 'sum' as const },
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import type { Operation } from '../../../types';
import { TimeScaleUnit } from '../../time_scale';
import type { OperationType } from '../definitions';

export interface BaseIndexPatternColumn extends Operation {
// Private
Expand Down Expand Up @@ -39,6 +40,6 @@ export interface ReferenceBasedIndexPatternColumn

// Used to store the temporary invalid state
export interface IncompleteColumn {
operationType?: string;
operationType?: OperationType;
sourceField?: string;
}

0 comments on commit 5b84ce1

Please sign in to comment.