From 0153bdbcbdc8c834eaf1d00d451aa548d813c099 Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Mon, 16 Aug 2021 18:09:58 -0500 Subject: [PATCH] Index pattern creation - text improvements (#107860) * text improvements --- .../empty_index_pattern_prompt.test.tsx.snap | 2 +- .../empty_index_pattern_prompt.tsx | 2 +- .../form_fields/timestamp_field.tsx | 2 +- .../components/form_fields/title_field.tsx | 2 +- .../public/components/form_schema.ts | 2 +- .../public/components/i18n_texts.ts | 26 ------------------- .../public/components/index.ts | 1 - .../status_message.test.tsx.snap | 10 +++---- .../status_message/status_message.tsx | 18 ++++++------- .../_index_pattern_create_delete.js | 2 +- 10 files changed, 20 insertions(+), 47 deletions(-) delete mode 100644 src/plugins/index_pattern_editor/public/components/i18n_texts.ts diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap index 6216f04c0a1a..48f0e507ce4a 100644 --- a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap +++ b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap @@ -51,7 +51,7 @@ exports[`EmptyIndexPatternPrompt should render normally 1`] = `

diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx index 054ff9d13b04..57e131e8693c 100644 --- a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx +++ b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx @@ -59,7 +59,7 @@ export const EmptyIndexPatternPrompt = ({

diff --git a/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx b/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx index 93cb39ea1ba3..e034ccd13134 100644 --- a/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx +++ b/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx @@ -63,7 +63,7 @@ const getTimestampConfig = ( }; const noTimestampOptionText = i18n.translate('indexPatternEditor.editor.form.noTimeFieldsLabel', { - defaultMessage: 'No matching data stream, index, or alias has a timestamp field.', + defaultMessage: 'No matching data stream, index, or index alias has a timestamp field.', }); const timestampFieldHelp = i18n.translate('indexPatternEditor.editor.form.timeFieldHelp', { diff --git a/src/plugins/index_pattern_editor/public/components/form_fields/title_field.tsx b/src/plugins/index_pattern_editor/public/components/form_fields/title_field.tsx index aa16351e0922..b03f3aa75cc2 100644 --- a/src/plugins/index_pattern_editor/public/components/form_fields/title_field.tsx +++ b/src/plugins/index_pattern_editor/public/components/form_fields/title_field.tsx @@ -51,7 +51,7 @@ const rollupIndexPatternTooManyMatchesError = { const mustMatchError = { message: i18n.translate('indexPatternEditor.createIndex.noMatch', { - defaultMessage: 'Name must match one or more data streams, indices, or aliases.', + defaultMessage: 'Name must match one or more data streams, indices, or index aliases.', }), }; diff --git a/src/plugins/index_pattern_editor/public/components/form_schema.ts b/src/plugins/index_pattern_editor/public/components/form_schema.ts index 4e852285031c..f6a3b23d9fbc 100644 --- a/src/plugins/index_pattern_editor/public/components/form_schema.ts +++ b/src/plugins/index_pattern_editor/public/components/form_schema.ts @@ -18,7 +18,7 @@ export const schema = { defaultValue: '', helpText: i18n.translate('indexPatternEditor.validations.titleHelpText', { defaultMessage: - 'Use an asterisk (*) to match multiple indices. Spaces and the characters , /, ?, ", <, >, | are not allowed.', + 'Use an asterisk (*) to match multiple characters. Spaces and the characters , /, ?, ", <, >, | are not allowed.', }), validations: [ { diff --git a/src/plugins/index_pattern_editor/public/components/i18n_texts.ts b/src/plugins/index_pattern_editor/public/components/i18n_texts.ts deleted file mode 100644 index 5745714ae7bd..000000000000 --- a/src/plugins/index_pattern_editor/public/components/i18n_texts.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { i18n } from '@kbn/i18n'; - -export const geti18nTexts = () => { - return { - noTimestampOptionText: i18n.translate( - 'indexPatternEditor.createIndexPattern.stepTime.noTimeFieldsLabel', - { - defaultMessage: 'No matching data stream, index, or alias has a timestamp field.', - } - ), - timestampFieldHelp: i18n.translate('indexPatternEditor.editor.form.timeFieldHelp', { - defaultMessage: 'Select a timestamp field for use with the global time filter.', - }), - rollupLabel: i18n.translate('indexPatternEditor.rollupIndexPattern.createIndex.indexLabel', { - defaultMessage: 'Rollup', - }), - }; -}; diff --git a/src/plugins/index_pattern_editor/public/components/index.ts b/src/plugins/index_pattern_editor/public/components/index.ts index 82da708ac859..c32c4081e973 100644 --- a/src/plugins/index_pattern_editor/public/components/index.ts +++ b/src/plugins/index_pattern_editor/public/components/index.ts @@ -18,7 +18,6 @@ export { TimestampField, TypeField, TitleField } from './form_fields'; export { EmptyPrompts } from './empty_prompts'; export { PreviewPanel } from './preview_panel'; export { LoadingIndices } from './loading_indices'; -export { geti18nTexts } from './i18n_texts'; export { Footer } from './footer'; export { AdvancedParamsContent } from './advanced_params_content'; export { RollupBetaWarning } from './rollup_beta_warning'; diff --git a/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/__snapshots__/status_message.test.tsx.snap b/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/__snapshots__/status_message.test.tsx.snap index 8b492be417bf..4fd36e61c3f7 100644 --- a/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/__snapshots__/status_message.test.tsx.snap +++ b/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/__snapshots__/status_message.test.tsx.snap @@ -31,7 +31,7 @@ exports[`StatusMessage should render with no partial matches 1`] = ` title={ @@ -132,7 +132,7 @@ exports[`StatusMessage should show that system indices exist 1`] = ` title={ diff --git a/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/status_message.tsx b/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/status_message.tsx index 871ed79c27de..adf76a96b1d9 100644 --- a/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/status_message.tsx +++ b/src/plugins/index_pattern_editor/public/components/preview_panel/status_message/status_message.tsx @@ -25,8 +25,8 @@ const NoMatchStatusMessage = (allIndicesLength: number) => ( @@ -49,7 +49,7 @@ const NoMatchNoIndicesStatusMessage = () => ( ); @@ -75,9 +75,9 @@ export const StatusMessage: React.FC = ({ @@ -88,7 +88,7 @@ export const StatusMessage: React.FC = ({ ); @@ -97,7 +97,7 @@ export const StatusMessage: React.FC = ({ ); @@ -127,7 +127,7 @@ export const StatusMessage: React.FC = ({ { expect(await testSubjects.getVisibleText('createIndexPatternStatusMessage')).to.contain( - `The index pattern you've entered doesn't match any indices` + `The index pattern you entered doesn\'t match any data streams, indices, or index aliases.` ); }); });