Re-enable the indexPattern:placeholder setting. Change its value to be an empty string. (#20685)

This commit is contained in:
CJ Cenizal 2018-07-13 06:39:29 -07:00 committed by GitHub
parent 34a44289aa
commit aab75aea10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 3 deletions

View file

@ -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', () => {

View file

@ -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')) {

View file

@ -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,
@ -49,7 +53,7 @@ export class StepIndexPattern extends Component {
}
static defaultProps = {
initialQuery: '',
initialQuery: uiSettings.get('indexPattern:placeholder'),
}
constructor(props) {

View file

@ -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',