Skip to content

Commit

Permalink
[ML] Fixes display of nested fields in pivot preview table. (#36700)
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra authored May 21, 2019
1 parent e9411f4 commit 33e7632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import {
SimpleQuery,
} from '../../common';

import { getFlattenedFields } from '../source_index_preview/common';

import { getPivotPreviewDevConsoleStatement } from './common';
import { PIVOT_PREVIEW_STATUS, usePivotPreviewData } from './use_pivot_preview_data';

Expand Down Expand Up @@ -197,7 +199,7 @@ export const PivotPreview: SFC<PivotPreviewProps> = React.memo(({ aggs, groupBy,
);
}

const columnKeys = Object.keys(dataFramePreviewData[0]);
const columnKeys = getFlattenedFields(dataFramePreviewData[0]);
columnKeys.sort(sortColumns(groupByArr));

const columns = columnKeys.map(k => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface EsDoc extends Dictionary<any> {

export const MAX_COLUMNS = 5;

function getFlattenedFields(obj: EsDocSource): EsFieldName[] {
export function getFlattenedFields(obj: EsDocSource): EsFieldName[] {
const flatDocFields: EsFieldName[] = [];
const newDocFields = Object.keys(obj);
newDocFields.forEach(f => {
Expand Down

0 comments on commit 33e7632

Please sign in to comment.