Skip to content

Commit

Permalink
[Lens] Split up dimension panel code (elastic#80423)
Browse files Browse the repository at this point in the history
* [Lens] Split up dimension panel code

* Fix test failures

* Style updates

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
2 people authored and wylieconlon committed Oct 19, 2020
1 parent 2b91953 commit 06c8b42
Show file tree
Hide file tree
Showing 11 changed files with 1,821 additions and 1,632 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export const {
sortByField,
hasField,
updateLayerIndexPattern,
mergeLayer,
} = actual;
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ import {
EuiListGroupItemProps,
EuiFormLabel,
} from '@elastic/eui';
import { IndexPatternDimensionEditorProps, OperationSupportMatrix } from './dimension_panel';
import { IndexPatternDimensionEditorProps } from './dimension_panel';
import { OperationSupportMatrix } from './operation_support';
import { IndexPatternColumn, OperationType } from '../indexpattern';
import {
operationDefinitionMap,
getOperationDisplay,
buildColumn,
changeField,
} from '../operations';
import { deleteColumn, changeColumn, updateColumnParam } from '../state_helpers';
import { deleteColumn, changeColumn, updateColumnParam, mergeLayer } from '../state_helpers';
import { FieldSelect } from './field_select';
import { hasField, fieldIsInvalid } from '../utils';
import { BucketNestingEditor } from './bucket_nesting_editor';
Expand Down Expand Up @@ -394,12 +395,11 @@ export function DimensionEditor(props: DimensionEditorProps) {
<LabelInput
value={selectedColumn.label}
onChange={(value) => {
setState({
...state,
layers: {
...state.layers,
[layerId]: {
...state.layers[layerId],
setState(
mergeLayer({
state,
layerId,
newLayer: {
columns: {
...state.layers[layerId].columns,
[columnId]: {
Expand All @@ -409,8 +409,8 @@ export function DimensionEditor(props: DimensionEditorProps) {
},
},
},
},
});
})
);
}}
/>
)}
Expand Down
Loading

0 comments on commit 06c8b42

Please sign in to comment.