Skip to content

Commit

Permalink
Re-enable the indexPattern:placeholder setting. Change its value to b…
Browse files Browse the repository at this point in the history
…e an empty string. (elastic#20685)
  • Loading branch information
cjcenizal committed Jul 13, 2018
1 parent 99e697d commit f73143c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const unmountComponentAtNode = jest.fn();

jest.doMock('react-dom', () => ({ render, unmountComponentAtNode }));

jest.mock('ui/chrome', () => ({
getUiSettingsClient: () => ({
get: () => '',
}),
}));

const { renderCreateIndexPatternWizard, destroyCreateIndexPatternWizard } = require('../render');

describe('CreateIndexPatternWizardRender', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ import { StepIndexPattern } from '../step_index_pattern';
jest.mock('../../../lib/ensure_minimum_time', () => ({
ensureMinimumTime: async (promises) => Array.isArray(promises) ? await Promise.all(promises) : await promises
}));

jest.mock('ui/chrome', () => ({
getUiSettingsClient: () => ({
get: () => '',
}),
}));

jest.mock('../../../lib/get_indices', () => ({
getIndices: (service, query) => {
if (query.startsWith('e')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ import {
EuiCallOut,
} from '@elastic/eui';

import chrome from 'ui/chrome';

const uiSettings = chrome.getUiSettingsClient();

export class StepIndexPattern extends Component {
static propTypes = {
allIndices: PropTypes.array.isRequired,
Expand All @@ -49,7 +53,7 @@ export class StepIndexPattern extends Component {
}

static defaultProps = {
initialQuery: '',
initialQuery: uiSettings.get('indexPattern:placeholder'),
}

constructor(props) {
Expand Down
4 changes: 2 additions & 2 deletions src/core_plugins/kibana/ui_setting_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ export function getUiSettingDefaults() {
},
'indexPattern:placeholder': {
name: 'Index pattern placeholder',
value: 'logstash-*',
description: `The placeholder for the field "Index name or pattern" in the "Settings > Indices" tab.`,
value: '',
description: `The placeholder for the "Index pattern name" field in "Management > Index Patterns > Create Index Pattern".`,
},
'context:defaultSize': {
name: 'Context size',
Expand Down

0 comments on commit f73143c

Please sign in to comment.