Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0139a50
Migrated uiSettings items to new platform
VladLasitsa May 11, 2020
96c72ab
API changes
VladLasitsa May 12, 2020
3648b8a
Merge branch 'master' into #63480
elasticmachine May 12, 2020
ef23395
Fixed translations
VladLasitsa May 12, 2020
807d1e9
Merge remote-tracking branch 'origin/#63480' into #63480
VladLasitsa May 12, 2020
bb2cef9
Fixed comment and i18n
VladLasitsa May 12, 2020
b546477
Fixed tests
VladLasitsa May 13, 2020
9e0e394
Merge remote-tracking branch 'upstream/master' into #63480
VladLasitsa May 13, 2020
d583b5a
Fixed internalization
VladLasitsa May 13, 2020
8327398
Merge branch 'master' into #63480
elasticmachine May 13, 2020
ab6aaf3
Merge remote-tracking branch 'upstream/master' into #63480
alexwizp May 14, 2020
54a961e
Fix karma tests
alexwizp May 14, 2020
9697e23
Merge branch 'master' into #63480
elasticmachine May 14, 2020
2928dd3
Merge branch 'master' into #63480
elasticmachine May 15, 2020
62a7ff1
made code more explicit
VladLasitsa May 15, 2020
bb34b7b
Merge remote-tracking branch 'upstream/master' into #63480
VladLasitsa May 18, 2020
33ddb46
Fixed plugin
VladLasitsa May 18, 2020
1ab909e
Added consts for ui settings ids.
VladLasitsa May 18, 2020
3faf356
Merge remote-tracking branch 'upstream/master' into #63480
VladLasitsa May 19, 2020
37da610
Added id for another settings
VladLasitsa May 19, 2020
0ccd5d5
Fixed tests.
VladLasitsa May 19, 2020
922cd6f
Improved imports
VladLasitsa May 20, 2020
5ea6b58
Merge branch 'master' into #63480
elasticmachine May 20, 2020
836af59
Fix imports to public which were happening from the server.
lukeelmers May 20, 2020
a34a62e
Merge branch 'master' into #63480
elasticmachine May 21, 2020
3152ed5
Fixed paths
VladLasitsa May 21, 2020
4b4d528
Merge branch 'master' into #63480
elasticmachine May 21, 2020
4c9f554
Merge remote-tracking branch 'upstream/master' into #63480
VladLasitsa May 22, 2020
114154e
Merge remote-tracking branch 'upstream/master' into #63480
VladLasitsa May 22, 2020
5359359
Merge branch 'master' into #63480
elasticmachine May 22, 2020
e3dcc46
Merge branch 'master' into #63480
elasticmachine May 22, 2020
d3136bb
Merge branch 'master' into #63480
elasticmachine May 25, 2020
634f2b3
Merge remote-tracking branch 'upstream/master' into #63480
VladLasitsa May 25, 2020
bfb0113
Moved styles to plugin.ts
VladLasitsa May 26, 2020
e28dea8
Merge branch 'master' into #63480
elasticmachine May 26, 2020
b83e536
Moved styles
VladLasitsa May 26, 2020
5871430
Merge remote-tracking branch 'upstream/master' into #63480
VladLasitsa May 27, 2020
22fdddb
Fixed docs
VladLasitsa May 27, 2020
f9a3c72
Fix ci
VladLasitsa May 27, 2020
428a4a5
Fix ci
VladLasitsa May 27, 2020
2fcc681
Merge branch 'master' into #63480
elasticmachine May 29, 2020
ab24186
Merge branch 'master' into #63480
elasticmachine Jun 1, 2020
166d00c
Merge branch 'master' into #63480
elasticmachine Jun 3, 2020
450e179
Merge remote-tracking branch 'upstream/master' into #63480
alexwizp Jun 4, 2020
434dcda
Merge remote-tracking branch 'upstream/master' into #63480
alexwizp Jun 4, 2020
1fc25c4
fix documentation
alexwizp Jun 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
601 changes: 12 additions & 589 deletions src/legacy/core_plugins/kibana/server/ui_setting_defaults.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
PaginateDirectiveProvider,
} from '../../../../../plugins/kibana_legacy/public';
import { PER_PAGE_SETTING } from '../../../../../plugins/saved_objects/common';
import { VISUALIZE_ENABLE_LABS_SETTINGS } from '../../../../../plugins/visualizations/common/constants';

const module = uiModules.get('kibana');

Expand Down Expand Up @@ -296,7 +297,7 @@ module

prevSearch = filter;

const isLabsEnabled = config.get('visualize:enableLabs');
const isLabsEnabled = config.get(VISUALIZE_ENABLE_LABS_SETTINGS);
self.service.find(filter).then(function(hits) {
hits.hits = hits.hits.filter(
hit => isLabsEnabled || _.get(hit, 'type.stage') !== 'experimental'
Expand Down
47 changes: 40 additions & 7 deletions src/legacy/ui/public/new_platform/new_platform.karma_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ import {
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../src/plugins/data/public/search/aggs';
import { ComponentRegistry } from '../../../../../src/plugins/advanced_settings/public/';
import {
QUERY_STRING_OPTIONS_SETTINGS,
QUERY_ALLOW_LEADING_WILDCARDS_SETTINGS,
SEARCH_QUERY_LANGUAGE_SETTINGS,
COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_SETTINGS,
SHORT_DOTS_ENABLE_SETTINGS,
FORMAT_DEFAULT_TYPE_MAP_SETTINGS,
FORMAT_NUMBER_DEFAULT_PATTERN_SETTINGS,
FORMAT_PERCENT_DEFAULT_PATTERN_SETTINGS,
FORMAT_CURRENCY_DEFAULT_PATTERN_SETTINGS,
FORMAT_NUMBER_DEFAULT_LOCALE_SETTINGS,
} from '../../../../../src/plugins/data/common';
import {
CSV_SEPARATOR_SETTINGS,
CSV_QUOTE_VALUES_SETTINGS,
} from '../../../../../src/plugins/share/common/constants';

const mockObservable = () => {
return {
Expand All @@ -49,18 +65,31 @@ let isTimeRangeSelectorEnabled = true;
let isAutoRefreshSelectorEnabled = true;

export const mockUiSettings = {
get: item => {
return mockUiSettings[item];
get: (item, defaultValue) => {
const defaultValues = {
dateFormat: 'MMM D, YYYY @ HH:mm:ss.SSS',
'dateFormat:tz': 'UTC',
[SHORT_DOTS_ENABLE_SETTINGS]: true,
[COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_SETTINGS]: true,
[QUERY_ALLOW_LEADING_WILDCARDS_SETTINGS]: true,
[QUERY_STRING_OPTIONS_SETTINGS]: {},
[FORMAT_CURRENCY_DEFAULT_PATTERN_SETTINGS]: '($0,0.[00])',
[FORMAT_NUMBER_DEFAULT_PATTERN_SETTINGS]: '0,0.[000]',
[FORMAT_PERCENT_DEFAULT_PATTERN_SETTINGS]: '0,0.[000]%',
[FORMAT_NUMBER_DEFAULT_LOCALE_SETTINGS]: 'en',
[FORMAT_DEFAULT_TYPE_MAP_SETTINGS]: {},
[CSV_SEPARATOR_SETTINGS]: ',',
[CSV_QUOTE_VALUES_SETTINGS]: true,
[SEARCH_QUERY_LANGUAGE_SETTINGS]: 'kuery',
'state:storeInSessionStorage': false,
};

return defaultValues[item] || defaultValue;
},
getUpdate$: () => ({
subscribe: sinon.fake(),
}),
isDefault: sinon.fake(),
'query:allowLeadingWildcards': true,
'query:queryString:options': {},
'courier:ignoreFilterIfFieldNotInIndex': true,
'dateFormat:tz': 'Browser',
'format:defaultTypeMap': {},
};

const mockCoreSetup = {
Expand Down Expand Up @@ -524,6 +553,8 @@ export function __setup__(coreSetup) {
// bootstrap an LP plugin outside of tests)
npSetup.core.application.register = () => {};

npSetup.core.uiSettings.get = mockUiSettings.get;

// Services that need to be set in the legacy platform since the legacy data
// & vis plugins which previously provided them have been removed.
setSetupServices(npSetup);
Expand All @@ -532,6 +563,8 @@ export function __setup__(coreSetup) {
export function __start__(coreStart) {
npStart.core = coreStart;

npStart.core.uiSettings.get = mockUiSettings.get;

// Services that need to be set in the legacy platform since the legacy data
// & vis plugins which previously provided them have been removed.
setStartServices(npStart);
Expand Down
3 changes: 2 additions & 1 deletion src/legacy/ui/public/timefilter/setup_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { RefreshInterval, TimeRange, TimefilterContract } from 'src/plugins/data
import { Subscription } from 'rxjs';
import { fatalError } from 'ui/notify/fatal_error';
import { subscribeWithScope } from '../../../../plugins/kibana_legacy/public';
import { TIMEPICKER_REFRESH_INTERVAL_DEFAULTS_SETTINGS } from '../../../../plugins/data/common';

// TODO
// remove everything underneath once globalState is no longer an angular service
Expand All @@ -38,7 +39,7 @@ export function getTimefilterConfig() {
const settings = chrome.getUiSettingsClient();
return {
timeDefaults: settings.get('timepicker:timeDefaults'),
refreshIntervalDefaults: settings.get('timepicker:refreshIntervalDefaults'),
refreshIntervalDefaults: settings.get(TIMEPICKER_REFRESH_INTERVAL_DEFAULTS_SETTINGS),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
SavedQuery,
syncQueryStateWithUrl,
} from '../../../data/public';
import { SEARCH_QUERY_LANGUAGE_SETTINGS } from '../../../data/common';
import { getSavedObjectFinder, SaveResult, showSaveModal } from '../../../saved_objects/public';

import {
Expand Down Expand Up @@ -430,7 +431,8 @@ export class DashboardAppController {
dashboardStateManager.getQuery() || {
query: '',
language:
localStorage.get('kibana.userQueryLanguage') || uiSettings.get('search:queryLanguage'),
localStorage.get('kibana.userQueryLanguage') ||
uiSettings.get(SEARCH_QUERY_LANGUAGE_SETTINGS),
},
queryFilter.getFilters()
);
Expand Down
26 changes: 26 additions & 0 deletions src/plugins/data/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,29 @@
export const DEFAULT_QUERY_LANGUAGE = 'kuery';
export const META_FIELDS_SETTING = 'metaFields';
export const DOC_HIGHLIGHT_SETTING = 'doc_table:highlight';
export const QUERY_STRING_OPTIONS_SETTINGS = 'query:queryString:options';
export const QUERY_ALLOW_LEADING_WILDCARDS_SETTINGS = 'query:allowLeadingWildcards';
export const SEARCH_QUERY_LANGUAGE_SETTINGS = 'search:queryLanguage';
export const SORT_OPTIONS_SETTINGS = 'sort:options';
export const COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_SETTINGS =
'courier:ignoreFilterIfFieldNotInIndex';
export const COURIER_SET_REQUEST_PREFERENCE_SETTINGS = 'courier:setRequestPreference';
export const COURIER_CUSTOM_REQUEST_PREFERENCE_SETTINGS = 'courier:customRequestPreference';
export const COURIER_MAX_CONCURRENT_SHARD_REQUESTS_SETTINGS = 'courier:maxConcurrentShardRequests';
export const COURIER_BATCH_SEARCHES_SETTINGS = 'courier:batchSearches';
export const SEARCH_INCLUDE_FROZEN_SETTINGS = 'search:includeFrozen';
export const HISTOGRAM_BAR_TARGET_SETTINGS = 'histogram:barTarget';
export const HISTOGRAM_MAX_BARS_SETTINGS = 'histogram:maxBars';
export const HISTORY_LIMIT_SETTINGS = 'history:limit';
export const SHORT_DOTS_ENABLE_SETTINGS = 'shortDots:enable';
export const FORMAT_DEFAULT_TYPE_MAP_SETTINGS = 'format:defaultTypeMap';
export const FORMAT_NUMBER_DEFAULT_PATTERN_SETTINGS = 'format:number:defaultPattern';
export const FORMAT_PERCENT_DEFAULT_PATTERN_SETTINGS = 'format:percent:defaultPattern';
export const FORMAT_BYTES_DEFAULT_PATTERN_SETTINGS = 'format:bytes:defaultPattern';
export const FORMAT_CURRENCY_DEFAULT_PATTERN_SETTINGS = 'format:currency:defaultPattern';
export const FORMAT_NUMBER_DEFAULT_LOCALE_SETTINGS = 'format:number:defaultLocale';
export const TIMEPICKER_REFRESH_INTERVAL_DEFAULTS_SETTINGS = 'timepicker:refreshIntervalDefaults';
export const TIMEPICKER_QUICK_RANGES_SETTINGS = 'timepicker:quickRanges';
export const INDEXPATTERN_PLACEHOLDER_SETTINGS = 'indexPattern:placeholder';
export const FILTERS_PINNED_BY_DEFAULT_SETTINGS = 'filters:pinnedByDefault';
export const FILTERS_EDITOR_SUGGEST_VALUES_SETTINGS = 'filterEditor:suggestValues';
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,23 @@
import { get } from 'lodash';
import { getEsQueryConfig } from './get_es_query_config';
import { IUiSettingsClient } from 'kibana/public';
import {
QUERY_STRING_OPTIONS_SETTINGS,
QUERY_ALLOW_LEADING_WILDCARDS_SETTINGS,
COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_SETTINGS,
} from '../../';

const config = ({
get(item: string) {
return get(config, item);
},
'query:allowLeadingWildcards': {
[QUERY_ALLOW_LEADING_WILDCARDS_SETTINGS]: {
allowLeadingWildcards: true,
},
'query:queryString:options': {
[QUERY_STRING_OPTIONS_SETTINGS]: {
queryStringOptions: {},
},
'courier:ignoreFilterIfFieldNotInIndex': {
[COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_SETTINGS]: {
ignoreFilterIfFieldNotInIndex: true,
},
'dateFormat:tz': {
Expand Down
13 changes: 10 additions & 3 deletions src/plugins/data/common/es_query/es_query/get_es_query_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@
*/

import { EsQueryConfig } from './build_es_query';
import {
QUERY_STRING_OPTIONS_SETTINGS,
QUERY_ALLOW_LEADING_WILDCARDS_SETTINGS,
COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_SETTINGS,
} from '../../';

interface KibanaConfig {
get<T>(key: string): T;
}

export function getEsQueryConfig(config: KibanaConfig) {
const allowLeadingWildcards = config.get('query:allowLeadingWildcards');
const queryStringOptions = config.get('query:queryString:options');
const ignoreFilterIfFieldNotInIndex = config.get('courier:ignoreFilterIfFieldNotInIndex');
const allowLeadingWildcards = config.get(QUERY_ALLOW_LEADING_WILDCARDS_SETTINGS);
const queryStringOptions = config.get(QUERY_STRING_OPTIONS_SETTINGS);
const ignoreFilterIfFieldNotInIndex = config.get(
COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX_SETTINGS
);
const dateFormatTZ = config.get('dateFormat:tz');

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
*/

import { BytesFormat } from './bytes';
import { FORMAT_BYTES_DEFAULT_PATTERN_SETTINGS } from '../../';

describe('BytesFormat', () => {
const config: Record<string, any> = {};

config['format:bytes:defaultPattern'] = '0,0.[000]b';
config[FORMAT_BYTES_DEFAULT_PATTERN_SETTINGS] = '0,0.[000]b';

const getConfig = (key: string) => config[key];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
*/

import { NumberFormat } from './number';
import { FORMAT_NUMBER_DEFAULT_PATTERN_SETTINGS } from '../../';

describe('NumberFormat', () => {
const config: Record<string, any> = {};

config['format:number:defaultPattern'] = '0,0.[000]';
config[FORMAT_NUMBER_DEFAULT_PATTERN_SETTINGS] = '0,0.[000]';

const getConfig = (key: string) => config[key];

Expand Down
4 changes: 3 additions & 1 deletion src/plugins/data/common/field_formats/converters/numeral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import numeralLanguages from '@elastic/numeral/languages';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert } from '../types';
import { FORMAT_NUMBER_DEFAULT_LOCALE_SETTINGS } from '../../';

const numeralInst = numeral();

Expand Down Expand Up @@ -51,7 +52,8 @@ export abstract class NumeralFormat extends FieldFormat {
if (isNaN(val)) return '';

const previousLocale = numeral.language();
const defaultLocale = (this.getConfig && this.getConfig('format:number:defaultLocale')) || 'en';
const defaultLocale =
(this.getConfig && this.getConfig(FORMAT_NUMBER_DEFAULT_LOCALE_SETTINGS)) || 'en';
numeral.language(defaultLocale);

const formatted = numeralInst.set(val).format(this.param('pattern'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
*/

import { PercentFormat } from './percent';
import { FORMAT_PERCENT_DEFAULT_PATTERN_SETTINGS } from '../../';

describe('PercentFormat', () => {
const config: Record<string, any> = {};

config['format:percent:defaultPattern'] = '0,0.[000]%';
config[FORMAT_PERCENT_DEFAULT_PATTERN_SETTINGS] = '0,0.[000]%';

const getConfig = (key: string) => config[key];

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/data/common/field_formats/converters/percent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import { i18n } from '@kbn/i18n';
import { NumeralFormat } from './numeral';
import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types';
import { FORMAT_PERCENT_DEFAULT_PATTERN_SETTINGS } from '../../';

export class PercentFormat extends NumeralFormat {
static id = FIELD_FORMAT_IDS.PERCENT;
Expand All @@ -32,7 +33,7 @@ export class PercentFormat extends NumeralFormat {
allowsNumericalAggregations = true;

getParamDefaults = () => ({
pattern: this.getConfig!('format:percent:defaultPattern'),
pattern: this.getConfig!(FORMAT_PERCENT_DEFAULT_PATTERN_SETTINGS),
fractional: true,
});

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/data/common/field_formats/converters/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { shortenDottedString } from '../../utils';
import { KBN_FIELD_TYPES } from '../../kbn_field_types/types';
import { FieldFormat } from '../field_format';
import { TextContextTypeConvert, HtmlContextTypeConvert, FIELD_FORMAT_IDS } from '../types';
import { SHORT_DOTS_ENABLE_SETTINGS } from '../../';

/**
* Remove all of the whitespace between html tags
Expand Down Expand Up @@ -71,7 +72,7 @@ export class SourceFormat extends FieldFormat {
const formatted = field.indexPattern.formatHit(hit);
const highlightPairs: any[] = [];
const sourcePairs: any[] = [];
const isShortDots = this.getConfig!('shortDots:enable');
const isShortDots = this.getConfig!(SHORT_DOTS_ENABLE_SETTINGS);

keys(formatted).forEach(key => {
const pairs = highlights[key] ? highlightPairs : sourcePairs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { baseFormatters } from './constants/base_formatters';
import { FieldFormat } from './field_format';
import { SerializedFieldFormat } from '../../../expressions/common/types';
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '../types';
import { FORMAT_DEFAULT_TYPE_MAP_SETTINGS } from '../';

export class FieldFormatsRegistry {
protected fieldFormats: Map<FieldFormatId, FieldFormatInstanceType> = new Map();
Expand All @@ -49,7 +50,7 @@ export class FieldFormatsRegistry {
metaParamsOptions: Record<string, any> = {},
defaultFieldConverters: FieldFormatInstanceType[] = baseFormatters
) {
const defaultTypeMap = getConfig('format:defaultTypeMap');
const defaultTypeMap = getConfig(FORMAT_DEFAULT_TYPE_MAP_SETTINGS);
this.register(defaultFieldConverters);
this.parseDefaultTypeMap(defaultTypeMap);
this.getConfig = getConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { memoize } from 'lodash';
import { CoreSetup } from 'src/core/public';
import { IIndexPattern, IFieldType } from '../../../common';
import { IIndexPattern, IFieldType, FILTERS_EDITOR_SUGGEST_VALUES_SETTINGS } from '../../../common';

function resolver(title: string, field: IFieldType, query: string, boolFilter: any) {
// Only cache results for a minute
Expand Down Expand Up @@ -56,7 +56,9 @@ export const setupValueSuggestionProvider = (core: CoreSetup): ValueSuggestionsG
boolFilter,
signal,
}: ValueSuggestionsGetFnArgs): Promise<any[]> => {
const shouldSuggestValues = core!.uiSettings.get<boolean>('filterEditor:suggestValues');
const shouldSuggestValues = core!.uiSettings.get<boolean>(
FILTERS_EDITOR_SUGGEST_VALUES_SETTINGS
);
const { title } = indexPattern;

if (field.type === 'boolean') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { CoreSetup } from 'src/core/public';
import { FieldFormatsRegistry } from '../../common';
import { FieldFormatsRegistry, FORMAT_DEFAULT_TYPE_MAP_SETTINGS } from '../../common';
import { deserializeFieldFormat } from './utils/deserialize';
import { FormatFactory } from '../../common/field_formats/utils';
import { baseFormattersPublic } from './constants';
Expand All @@ -28,7 +28,7 @@ export class FieldFormatsService {

public setup(core: CoreSetup) {
core.uiSettings.getUpdate$().subscribe(({ key, newValue }) => {
if (key === 'format:defaultTypeMap') {
if (key === FORMAT_DEFAULT_TYPE_MAP_SETTINGS) {
this.fieldFormatsRegistry.parseDefaultTypeMap(newValue);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
IIndexPattern,
IFieldType,
META_FIELDS_SETTING,
SHORT_DOTS_ENABLE_SETTINGS,
} from '../../../common';
import { findByTitle } from '../utils';
import { IndexPatternMissingIndices } from '../lib';
Expand Down Expand Up @@ -108,7 +109,7 @@ export class IndexPattern implements IIndexPattern {
// which cause problems when being consumed from angular
this.getConfig = getConfig;

this.shortDotsEnable = this.getConfig('shortDots:enable');
this.shortDotsEnable = this.getConfig(SHORT_DOTS_ENABLE_SETTINGS);
this.metaFields = this.getConfig(META_FIELDS_SETTING);

this.createFieldList = getIndexPatternFieldListCreator({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import { Subscription } from 'rxjs';
import { FilterManager } from './filter_manager';
import { getFilter } from './test_helpers/get_stub_filter';
import { getFiltersArray } from './test_helpers/get_filters_array';
import { Filter, FilterStateStore } from '../../../common';
import { Filter, FilterStateStore, FILTERS_PINNED_BY_DEFAULT_SETTINGS } from '../../../common';

import { coreMock } from '../../../../../core/public/mocks';
const setupMock = coreMock.createSetup();

const uiSettingsMock = (pinnedByDefault: boolean) => (key: string) => {
switch (key) {
case 'filters:pinnedByDefault':
case FILTERS_PINNED_BY_DEFAULT_SETTINGS:
return pinnedByDefault;
default:
throw new Error(`Unexpected uiSettings key in FilterManager mock: ${key}`);
Expand Down
Loading