Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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