diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js index a8d34ba5e1c54..003a446facd8f 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/header/header.js @@ -87,7 +87,7 @@ export const Header = ({ {prompt} - ) : '' + ) : null } diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js index 4566442a92552..d184c099e8fcc 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.js @@ -247,18 +247,18 @@ export class StepIndexPatternComponent extends Component { if (!query || !query.length || query === '.' || query === '..') { // This is an error scenario but do not report an error containsErrors = true; - } - else if (containsIllegalCharacters(query, ILLEGAL_CHARACTERS)) { + } else if (containsIllegalCharacters(query, ILLEGAL_CHARACTERS)) { const errorMessage = intl.formatMessage( { id: 'kbn.management.createIndexPattern.step.invalidCharactersErrorMessage', defaultMessage: 'A {indexPatternName} cannot contain spaces or the characters: {characterList}' }, - { characterList, indexPatternName }); + { characterList, indexPatternName } + ); errors.push(errorMessage); containsErrors = true; - } else if(checkIndices) { + } else if (checkIndices) { errors.push(...checkIndices); containsErrors = true; } diff --git a/src/core_plugins/kibana/public/management/sections/indices/index.js b/src/core_plugins/kibana/public/management/sections/indices/index.js index cc16fa4b24931..2d890efee0330 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/index.js +++ b/src/core_plugins/kibana/public/management/sections/indices/index.js @@ -57,11 +57,10 @@ export function updateIndexPatternList( ); } -export function destroyIndexPatternList() { +export const destroyIndexPatternList = () => { const node = document.getElementById(INDEX_PATTERN_LIST_DOM_ELEMENT_ID); node && unmountComponentAtNode(node); -} - +}; const indexPatternsResolutions = { indexPatterns: function (Private) { @@ -132,7 +131,7 @@ uiModules.get('apps/management') updateIndexPatternList($scope, indexPatternCreationOptions, $scope.defaultIndex, $scope.indexPatternList); }; - $scope.$on('$destroy', () => destroyIndexPatternList()); + $scope.$on('$destroy', destroyIndexPatternList); $scope.editingId = $route.current.params.indexPatternId; $scope.$watch('defaultIndex', () => renderList()); config.bindToScope($scope, 'defaultIndex'); diff --git a/src/ui/public/agg_types/buckets/histogram.js b/src/ui/public/agg_types/buckets/histogram.js index 5772218ce53be..1def0142a9f18 100644 --- a/src/ui/public/agg_types/buckets/histogram.js +++ b/src/ui/public/agg_types/buckets/histogram.js @@ -19,6 +19,7 @@ import _ from 'lodash'; +import { i18n } from '@kbn/i18n'; import { toastNotifications } from 'ui/notify'; import '../../validate_date_interval'; import chrome from '../../chrome'; @@ -98,10 +99,10 @@ export const histogramBucketAgg = new BucketAggType({ }); }) .catch(() => { - toastNotifications.addWarning(` - Unable to retrieve max and min values to auto-scale histogram buckets. - This may lead to poor visualization performance. - `); + toastNotifications.addWarning(i18n.translate('ui.aggTypes.histogram.missingMaxMinValuesWarning', { + defaultMessage: 'Unable to retrieve max and min values to auto-scale histogram buckets.' + + ' This may lead to poor visualization performance.' + })); }); }, write: function (aggConfig, output) { diff --git a/src/ui/public/management/index_pattern_creation/index_pattern_creation_config.js b/src/ui/public/management/index_pattern_creation/index_pattern_creation_config.js index aad1184d1d248..a8d01821c427d 100644 --- a/src/ui/public/management/index_pattern_creation/index_pattern_creation_config.js +++ b/src/ui/public/management/index_pattern_creation/index_pattern_creation_config.js @@ -20,8 +20,10 @@ import { i18n } from '@kbn/i18n'; const indexPatternTypeName = i18n.translate('common.ui.management.editIndexPattern.createIndex.defaultTypeName', { defaultMessage: 'index pattern' }); + const indexPatternButtonText = i18n.translate('common.ui.management.editIndexPattern.createIndex.defaultButtonText', { defaultMessage: 'Standard index pattern' }); + const indexPatternButtonDescription = i18n.translate('common.ui.management.editIndexPattern.createIndex.defaultButtonDescription', { defaultMessage: 'Can perform full aggregations against any data' }); diff --git a/src/ui/public/utils/parse_es_interval/index.ts b/src/ui/public/utils/parse_es_interval/index.ts index ff0f59607f78f..f01fb97347fe3 100644 --- a/src/ui/public/utils/parse_es_interval/index.ts +++ b/src/ui/public/utils/parse_es_interval/index.ts @@ -18,7 +18,5 @@ */ export { parseEsInterval } from './parse_es_interval'; -export { - ParseEsIntervalInvalidCalendarIntervalError, -} from './parse_es_interval_invalid_calendar_interval_error'; -export { ParseEsIntervalInvalidFormatError } from './parse_es_interval_invalid_format_error'; +export { InvalidEsCalendarIntervalError } from './invalid_es_calendar_interval_error'; +export { InvalidEsIntervalFormatError } from './invalid_es_interval_format_error'; diff --git a/src/ui/public/utils/parse_es_interval/parse_es_interval_invalid_calendar_interval_error.ts b/src/ui/public/utils/parse_es_interval/invalid_es_calendar_interval_error.ts similarity index 82% rename from src/ui/public/utils/parse_es_interval/parse_es_interval_invalid_calendar_interval_error.ts rename to src/ui/public/utils/parse_es_interval/invalid_es_calendar_interval_error.ts index a813615093ceb..f5cf91ae092fd 100644 --- a/src/ui/public/utils/parse_es_interval/parse_es_interval_invalid_calendar_interval_error.ts +++ b/src/ui/public/utils/parse_es_interval/invalid_es_calendar_interval_error.ts @@ -17,7 +17,7 @@ * under the License. */ -export class ParseEsIntervalInvalidCalendarIntervalError extends Error { +export class InvalidEsCalendarIntervalError extends Error { constructor( public readonly interval: string, public readonly value: number, @@ -26,7 +26,7 @@ export class ParseEsIntervalInvalidCalendarIntervalError extends Error { ) { super(`Invalid calendar interval: ${interval}, value must be 1`); - this.name = 'ParseEsIntervalInvalidCalendarIntervalError'; + this.name = 'InvalidEsCalendarIntervalError'; this.value = value; this.unit = unit; this.type = type; @@ -34,11 +34,11 @@ export class ParseEsIntervalInvalidCalendarIntervalError extends Error { // captureStackTrace is only available in the V8 engine, so any browser using // a different JS engine won't have access to this method. if (Error.captureStackTrace) { - Error.captureStackTrace(this, ParseEsIntervalInvalidCalendarIntervalError); + Error.captureStackTrace(this, InvalidEsCalendarIntervalError); } // Babel doesn't support traditional `extends` syntax for built-in classes. // https://babeljs.io/docs/en/caveats/#classes - Object.setPrototypeOf(this, ParseEsIntervalInvalidCalendarIntervalError.prototype); + Object.setPrototypeOf(this, InvalidEsCalendarIntervalError.prototype); } } diff --git a/src/ui/public/utils/parse_es_interval/parse_es_interval_invalid_format_error.ts b/src/ui/public/utils/parse_es_interval/invalid_es_interval_format_error.ts similarity index 82% rename from src/ui/public/utils/parse_es_interval/parse_es_interval_invalid_format_error.ts rename to src/ui/public/utils/parse_es_interval/invalid_es_interval_format_error.ts index 78521b8821293..b13004592e271 100644 --- a/src/ui/public/utils/parse_es_interval/parse_es_interval_invalid_format_error.ts +++ b/src/ui/public/utils/parse_es_interval/invalid_es_interval_format_error.ts @@ -17,19 +17,19 @@ * under the License. */ -export class ParseEsIntervalInvalidFormatError extends Error { +export class InvalidEsIntervalFormatError extends Error { constructor(public readonly interval: string) { super(`Invalid interval format: ${interval}`); - this.name = 'ParseEsIntervalInvalidFormatError'; + this.name = 'InvalidEsIntervalFormatError'; // captureStackTrace is only available in the V8 engine, so any browser using // a different JS engine won't have access to this method. if (Error.captureStackTrace) { - Error.captureStackTrace(this, ParseEsIntervalInvalidFormatError); + Error.captureStackTrace(this, InvalidEsIntervalFormatError); } // Babel doesn't support traditional `extends` syntax for built-in classes. // https://babeljs.io/docs/en/caveats/#classes - Object.setPrototypeOf(this, ParseEsIntervalInvalidFormatError.prototype); + Object.setPrototypeOf(this, InvalidEsIntervalFormatError.prototype); } } diff --git a/src/ui/public/utils/parse_es_interval/parse_es_interval.test.ts b/src/ui/public/utils/parse_es_interval/parse_es_interval.test.ts index 56014da5fea7b..03147acf0bec5 100644 --- a/src/ui/public/utils/parse_es_interval/parse_es_interval.test.ts +++ b/src/ui/public/utils/parse_es_interval/parse_es_interval.test.ts @@ -18,8 +18,8 @@ */ import { parseEsInterval } from './parse_es_interval'; -import { ParseEsIntervalInvalidCalendarIntervalError } from './parse_es_interval_invalid_calendar_interval_error'; -import { ParseEsIntervalInvalidFormatError } from './parse_es_interval_invalid_format_error'; +import { InvalidEsCalendarIntervalError } from './invalid_es_calendar_interval_error'; +import { InvalidEsIntervalFormatError } from './invalid_es_interval_format_error'; describe('parseEsInterval', () => { it('should correctly parse an interval containing unit and single value', () => { @@ -41,7 +41,7 @@ describe('parseEsInterval', () => { expect(parseEsInterval('7d')).toEqual({ value: 7, unit: 'd', type: 'fixed' }); }); - it('should throw a ParseEsIntervalInvalidCalendarIntervalError for intervals containing calendar unit and multiple value', () => { + it('should throw a InvalidEsCalendarIntervalError for intervals containing calendar unit and multiple value', () => { const intervals = ['4w', '12M', '10y']; expect.assertions(intervals.length); @@ -49,12 +49,12 @@ describe('parseEsInterval', () => { try { parseEsInterval(interval); } catch (error) { - expect(error instanceof ParseEsIntervalInvalidCalendarIntervalError).toBe(true); + expect(error instanceof InvalidEsCalendarIntervalError).toBe(true); } }); }); - it('should throw a ParseEsIntervalInvalidFormatError for invalid interval formats', () => { + it('should throw a InvalidEsIntervalFormatError for invalid interval formats', () => { const intervals = ['1', 'h', '0m', '0.5h']; expect.assertions(intervals.length); @@ -62,7 +62,7 @@ describe('parseEsInterval', () => { try { parseEsInterval(interval); } catch (error) { - expect(error instanceof ParseEsIntervalInvalidFormatError).toBe(true); + expect(error instanceof InvalidEsIntervalFormatError).toBe(true); } }); }); diff --git a/src/ui/public/utils/parse_es_interval/parse_es_interval.ts b/src/ui/public/utils/parse_es_interval/parse_es_interval.ts index f8b88dd57668b..5251edc8c8722 100644 --- a/src/ui/public/utils/parse_es_interval/parse_es_interval.ts +++ b/src/ui/public/utils/parse_es_interval/parse_es_interval.ts @@ -19,8 +19,8 @@ import dateMath from '@kbn/datemath'; -import { ParseEsIntervalInvalidCalendarIntervalError } from './parse_es_interval_invalid_calendar_interval_error'; -import { ParseEsIntervalInvalidFormatError } from './parse_es_interval_invalid_format_error'; +import { InvalidEsCalendarIntervalError } from './invalid_es_calendar_interval_error'; +import { InvalidEsIntervalFormatError } from './invalid_es_interval_format_error'; const ES_INTERVAL_STRING_REGEX = new RegExp( '^([1-9][0-9]*)\\s*(' + dateMath.units.join('|') + ')$' @@ -51,7 +51,7 @@ export function parseEsInterval(interval: string): { value: number; unit: string .match(ES_INTERVAL_STRING_REGEX); if (!matches) { - throw new ParseEsIntervalInvalidFormatError(interval); + throw new InvalidEsIntervalFormatError(interval); } const value = matches && parseFloat(matches[1]); @@ -59,7 +59,7 @@ export function parseEsInterval(interval: string): { value: number; unit: string const type = unit && dateMath.unitsMap[unit].type; if (type === 'calendar' && value !== 1) { - throw new ParseEsIntervalInvalidCalendarIntervalError(interval, value, unit, type); + throw new InvalidEsCalendarIntervalError(interval, value, unit, type); } return { diff --git a/src/ui/public/vis/editors/default/sidebar.html b/src/ui/public/vis/editors/default/sidebar.html index 20e016a9bb62a..36de0c967ac81 100644 --- a/src/ui/public/vis/editors/default/sidebar.html +++ b/src/ui/public/vis/editors/default/sidebar.html @@ -19,15 +19,6 @@