Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/7.x' into backport/7.x/pr-83808
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Mar 25, 2021
2 parents d797a82 + cd5b0d6 commit 7876597
Show file tree
Hide file tree
Showing 26 changed files with 703 additions and 373 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const fields = [
type: 'date',
scripted: false,
filterable: true,
aggregatable: true,
sortable: true,
},
{
name: 'message',
Expand All @@ -34,12 +36,14 @@ const fields = [
type: 'string',
scripted: false,
filterable: true,
aggregatable: true,
},
{
name: 'bytes',
type: 'number',
scripted: false,
filterable: true,
aggregatable: true,
},
{
name: 'scripted',
Expand All @@ -55,14 +59,14 @@ fields.getByName = (name: string) => {

const indexPattern = ({
id: 'index-pattern-with-timefield-id',
title: 'index-pattern-without-timefield',
title: 'index-pattern-with-timefield',
metaFields: ['_index', '_score'],
flattenHit: undefined,
formatHit: jest.fn((hit) => hit._source),
fields,
getComputedFields: () => ({}),
getSourceFiltering: () => ({}),
getFieldByName: () => ({}),
getFieldByName: (name: string) => fields.getByName(name),
timeFieldName: 'timestamp',
} as unknown) as IndexPattern;

Expand Down
4 changes: 3 additions & 1 deletion src/plugins/discover/public/__mocks__/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
*/

import { IUiSettingsClient } from 'kibana/public';
import { SAMPLE_SIZE_SETTING } from '../../common';
import { DEFAULT_COLUMNS_SETTING, SAMPLE_SIZE_SETTING } from '../../common';

export const uiSettingsMock = ({
get: (key: string) => {
if (key === SAMPLE_SIZE_SETTING) {
return 10;
} else if (key === DEFAULT_COLUMNS_SETTING) {
return ['default_column'];
}
},
} as unknown) as IUiSettingsClient;
Loading

0 comments on commit 7876597

Please sign in to comment.