diff --git a/package.json b/package.json index d809bb2e025f7..76a84675c2eb2 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.2.0-canary.1", "@elastic/ems-client": "8.2.0", - "@elastic/eui": "52.2.0", + "@elastic/eui": "53.0.1", "@elastic/filesaver": "1.1.2", "@elastic/node-crypto": "1.2.1", "@elastic/numeral": "^2.5.1", diff --git a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap index aae1b026a4e11..69439d1927745 100644 --- a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap +++ b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap @@ -6,6 +6,7 @@ exports[`#start() returns \`Context\` component 1`] = ` i18n={ Object { "mapping": Object { + "euiAbsoluteTab.dateFormatError": [Function], "euiAccordion.isLoading": "Loading", "euiAutoRefresh.autoRefreshLabel": "Auto refresh", "euiAutoRefresh.buttonLabelOff": "Auto refresh is off", @@ -100,6 +101,14 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiDataGridSchema.numberSortTextDesc": "High-Low", "euiDatePopoverButton.invalidTitle": [Function], "euiDatePopoverButton.outdatedTitle": [Function], + "euiDatePopoverContent.absoluteTabLabel": "Absolute", + "euiDatePopoverContent.endDateLabel": "End date", + "euiDatePopoverContent.nowTabButtonEnd": "Set end date and time to now", + "euiDatePopoverContent.nowTabButtonStart": "Set start date and time to now", + "euiDatePopoverContent.nowTabContent": "Setting the time to \\"now\\" means that on every refresh this time will be set to the time of the refresh.", + "euiDatePopoverContent.nowTabLabel": "Now", + "euiDatePopoverContent.relativeTabLabel": "Relative", + "euiDatePopoverContent.startDateLabel": "Start date", "euiDisplaySelector.buttonText": "Display options", "euiDisplaySelector.densityLabel": "Density", "euiDisplaySelector.labelAuto": "Auto fit", @@ -177,6 +186,39 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiPinnableListGroup.pinExtraActionLabel": "Pin item", "euiPinnableListGroup.pinnedExtraActionLabel": "Unpin item", "euiPopover.screenReaderAnnouncement": "You are in a dialog. To close this dialog, hit escape.", + "euiPrettyDuration.durationRoundedToDay": [Function], + "euiPrettyDuration.durationRoundedToHour": [Function], + "euiPrettyDuration.durationRoundedToMinute": [Function], + "euiPrettyDuration.durationRoundedToMonth": [Function], + "euiPrettyDuration.durationRoundedToSecond": [Function], + "euiPrettyDuration.durationRoundedToWeek": [Function], + "euiPrettyDuration.durationRoundedToYear": [Function], + "euiPrettyDuration.fallbackDuration": [Function], + "euiPrettyDuration.invalid": "Invalid date", + "euiPrettyDuration.lastDurationDays": [Function], + "euiPrettyDuration.lastDurationHours": [Function], + "euiPrettyDuration.lastDurationMinutes": [Function], + "euiPrettyDuration.lastDurationMonths": [Function], + "euiPrettyDuration.lastDurationSeconds": [Function], + "euiPrettyDuration.lastDurationWeeks": [Function], + "euiPrettyDuration.lastDurationYears": [Function], + "euiPrettyDuration.nextDurationHours": [Function], + "euiPrettyDuration.nextDurationMinutes": [Function], + "euiPrettyDuration.nextDurationMonths": [Function], + "euiPrettyDuration.nextDurationSeconds": [Function], + "euiPrettyDuration.nextDurationWeeks": [Function], + "euiPrettyDuration.nextDurationYears": [Function], + "euiPrettyDuration.nexttDurationDays": [Function], + "euiPrettyDuration.now": "now", + "euiPrettyInterval.days": [Function], + "euiPrettyInterval.daysShorthand": [Function], + "euiPrettyInterval.hours": [Function], + "euiPrettyInterval.hoursShorthand": [Function], + "euiPrettyInterval.minutes": [Function], + "euiPrettyInterval.minutesShorthand": [Function], + "euiPrettyInterval.off": "Off", + "euiPrettyInterval.seconds": [Function], + "euiPrettyInterval.secondsShorthand": [Function], "euiProgress.valueText": [Function], "euiQuickSelect.applyButton": "Apply", "euiQuickSelect.fullDescription": [Function], @@ -195,8 +237,6 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiRelativeTab.fullDescription": [Function], "euiRelativeTab.numberInputError": "Must be >= 0", "euiRelativeTab.numberInputLabel": "Time span amount", - "euiRelativeTab.relativeDate": [Function], - "euiRelativeTab.roundingLabel": [Function], "euiRelativeTab.unitInputLabel": "Relative time span", "euiResizableButton.horizontalResizerAriaLabel": "Press left or right to adjust panels size", "euiResizableButton.verticalResizerAriaLabel": "Press up or down to adjust panels size", @@ -256,6 +296,44 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiTablePagination.rowsPerPageOption": [Function], "euiTablePagination.rowsPerPageOptionShowAllRows": "Show all rows", "euiTableSortMobile.sorting": "Sorting", + "euiTimeOptions.days": "Days", + "euiTimeOptions.daysAgo": "Days ago", + "euiTimeOptions.daysFromNow": "Days from now", + "euiTimeOptions.hours": "Hours", + "euiTimeOptions.hoursAgo": "Hours ago", + "euiTimeOptions.hoursFromNow": "Hours from now", + "euiTimeOptions.last": "Last", + "euiTimeOptions.minutes": "Minutes", + "euiTimeOptions.minutesAgo": "Minutes ago", + "euiTimeOptions.minutesFromNow": "Minutes from now", + "euiTimeOptions.monthToDate": "Month to date", + "euiTimeOptions.months": "Months", + "euiTimeOptions.monthsAgo": "Months ago", + "euiTimeOptions.monthsFromNow": "Months from now", + "euiTimeOptions.next": "Next", + "euiTimeOptions.roundToDay": "Round to the day", + "euiTimeOptions.roundToHour": "Round to the hour", + "euiTimeOptions.roundToMinute": "Round to the minute", + "euiTimeOptions.roundToMonth": "Round to the month", + "euiTimeOptions.roundToSecond": "Round to the second", + "euiTimeOptions.roundToWeek": "Round to the week", + "euiTimeOptions.roundToYear": "Round to the year", + "euiTimeOptions.seconds": "Seconds", + "euiTimeOptions.secondsAgo": "Seconds ago", + "euiTimeOptions.secondsFromNow": "Seconds from now", + "euiTimeOptions.thisMonth": "This month", + "euiTimeOptions.thisWeek": "This week", + "euiTimeOptions.thisYear": "This year", + "euiTimeOptions.today": "Today", + "euiTimeOptions.weekToDate": "Week to date", + "euiTimeOptions.weeks": "Weeks", + "euiTimeOptions.weeksAgo": "Weeks ago", + "euiTimeOptions.weeksFromNow": "Weeks from now", + "euiTimeOptions.yearToDate": "Year to date", + "euiTimeOptions.years": "Years", + "euiTimeOptions.yearsAgo": "Years ago", + "euiTimeOptions.yearsFromNow": "Years from now", + "euiTimeOptions.yesterday": "Yesterday", "euiToast.dismissToast": "Dismiss toast", "euiToast.newNotification": "A new notification appears", "euiToast.notification": "Notification", diff --git a/src/core/public/i18n/i18n_eui_mapping.test.ts b/src/core/public/i18n/i18n_eui_mapping.test.ts index 2b29fa4d0d66c..aa78345a86de1 100644 --- a/src/core/public/i18n/i18n_eui_mapping.test.ts +++ b/src/core/public/i18n/i18n_eui_mapping.test.ts @@ -76,7 +76,31 @@ describe('@elastic/eui i18n tokens', () => { test('defaultMessage is in sync with defString', () => { // Certain complex tokens (e.g. ones that have a function as a defaultMessage) // need custom i18n handling, and can't be checked for basic defString equality - const tokensToSkip = ['euiColumnSorting.buttonActive', 'euiSelectable.searchResults']; + const tokensToSkip = [ + 'euiColumnSorting.buttonActive', + 'euiSelectable.searchResults', + 'euiPrettyDuration.lastDurationSeconds', + 'euiPrettyDuration.nextDurationSeconds', + 'euiPrettyDuration.lastDurationMinutes', + 'euiPrettyDuration.nextDurationMinutes', + 'euiPrettyDuration.lastDurationHours', + 'euiPrettyDuration.nextDurationHours', + 'euiPrettyDuration.lastDurationDays', + 'euiPrettyDuration.nexttDurationDays', + 'euiPrettyDuration.lastDurationWeeks', + 'euiPrettyDuration.nextDurationWeeks', + 'euiPrettyDuration.lastDurationMonths', + 'euiPrettyDuration.nextDurationMonths', + 'euiPrettyDuration.lastDurationYears', + 'euiPrettyDuration.nextDurationYears', + 'euiPrettyInterval.seconds', + 'euiPrettyInterval.minutes', + 'euiPrettyInterval.hours', + 'euiPrettyInterval.days', + 'euiPrettyInterval.weeks', + 'euiPrettyInterval.months', + 'euiPrettyInterval.years', + ]; if (tokensToSkip.includes(token)) return; // Clean up typical errors from the `@elastic/eui` extraction token tool diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 7e0fff16d56eb..b58780db3087d 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -843,6 +843,279 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: '{value}%', values: { value }, }), + 'euiPrettyDuration.lastDurationSeconds': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.lastDurationSeconds', { + defaultMessage: 'Last {duration, plural, one {# second} other {# seconds}}', + values: { duration }, + }), + 'euiPrettyDuration.nextDurationSeconds': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.nextDurationSeconds', { + defaultMessage: 'Next {duration, plural, one {# second} other {# seconds}}', + values: { duration }, + }), + 'euiPrettyDuration.lastDurationMinutes': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.lastDurationMinutes', { + defaultMessage: 'Last {duration, plural, one {# minute} other {# minutes}}', + values: { duration }, + }), + 'euiPrettyDuration.nextDurationMinutes': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.nextDurationMinutes', { + defaultMessage: 'Next {duration, plural, one {# minute} other {# minutes}}', + values: { duration }, + }), + 'euiPrettyDuration.lastDurationHours': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.lastDurationHours', { + defaultMessage: 'Last {duration, plural, one {# hour} other {# hours}}', + values: { duration }, + }), + 'euiPrettyDuration.nextDurationHours': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.nextDurationHours', { + defaultMessage: 'Next {duration, plural, one {# hour} other {# hours}}', + values: { duration }, + }), + 'euiPrettyDuration.lastDurationDays': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.lastDurationDays', { + defaultMessage: 'Last {duration, plural, one {# day} other {# days}}', + values: { duration }, + }), + 'euiPrettyDuration.nexttDurationDays': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.nexttDurationDays', { + defaultMessage: 'Next {duration, plural, one {# day} other {# days}}', + values: { duration }, + }), + 'euiPrettyDuration.lastDurationWeeks': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.lastDurationWeeks', { + defaultMessage: 'Last {duration, plural, one {# week} other {# weeks}}', + values: { duration }, + }), + 'euiPrettyDuration.nextDurationWeeks': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.nextDurationWeeks', { + defaultMessage: 'Next {duration, plural, one {# week} other {# weeks}}', + values: { duration }, + }), + 'euiPrettyDuration.lastDurationMonths': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.lastDurationMonths', { + defaultMessage: 'Last {duration, plural, one {# month} other {# months}}', + values: { duration }, + }), + 'euiPrettyDuration.nextDurationMonths': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.nextDurationMonths', { + defaultMessage: 'Next {duration, plural, one {# month} other {# months}}', + values: { duration }, + }), + 'euiPrettyDuration.lastDurationYears': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.lastDurationYears', { + defaultMessage: 'Last {duration, plural, one {# year} other {# years}}', + values: { duration }, + }), + 'euiPrettyDuration.nextDurationYears': ({ duration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.nextDurationYears', { + defaultMessage: 'Next {duration, plural, one {# year} other {# years}}', + values: { duration }, + }), + 'euiPrettyDuration.durationRoundedToSecond': ({ prettyDuration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.durationRoundedToSecond', { + defaultMessage: '{prettyDuration} rounded to the second', + values: { prettyDuration }, + }), + 'euiPrettyDuration.durationRoundedToMinute': ({ prettyDuration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.durationRoundedToMinute', { + defaultMessage: '{prettyDuration} rounded to the minute', + values: { prettyDuration }, + }), + 'euiPrettyDuration.durationRoundedToHour': ({ prettyDuration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.durationRoundedToHour', { + defaultMessage: '{prettyDuration} rounded to the hour', + values: { prettyDuration }, + }), + 'euiPrettyDuration.durationRoundedToDay': ({ prettyDuration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.durationRoundedToDay', { + defaultMessage: '{prettyDuration} rounded to the day', + values: { prettyDuration }, + }), + 'euiPrettyDuration.durationRoundedToWeek': ({ prettyDuration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.durationRoundedToWeek', { + defaultMessage: '{prettyDuration} rounded to the week', + values: { prettyDuration }, + }), + 'euiPrettyDuration.durationRoundedToMonth': ({ prettyDuration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.durationRoundedToMonth', { + defaultMessage: '{prettyDuration} rounded to the month', + values: { prettyDuration }, + }), + 'euiPrettyDuration.durationRoundedToYear': ({ prettyDuration }: EuiValues) => + i18n.translate('core.euiPrettyDuration.durationRoundedToYear', { + defaultMessage: '{prettyDuration} rounded to the year', + values: { prettyDuration }, + }), + 'euiPrettyDuration.now': i18n.translate('core.euiPrettyDuration.now', { + defaultMessage: 'now', + }), + 'euiPrettyDuration.invalid': i18n.translate('core.euiPrettyDuration.invalid', { + defaultMessage: 'Invalid date', + }), + 'euiPrettyDuration.fallbackDuration': ({ displayFrom, displayTo }: EuiValues) => + i18n.translate('core.euiPrettyDuration.fallbackDuration', { + defaultMessage: '{displayFrom} to {displayTo}', + values: { displayFrom, displayTo }, + }), + 'euiPrettyInterval.seconds': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.seconds', { + defaultMessage: '{interval, plural, one {# second} other {# seconds}}', + values: { interval }, + }), + 'euiPrettyInterval.minutes': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.minutes', { + defaultMessage: '{interval, plural, one {# minute} other {# minutes}}', + values: { interval }, + }), + 'euiPrettyInterval.hours': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.hours', { + defaultMessage: '{interval, plural, one {# hour} other {# hours}}', + values: { interval }, + }), + 'euiPrettyInterval.days': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.days', { + defaultMessage: '{interval, plural, one {# day} other {# days}}', + values: { interval }, + }), + 'euiPrettyInterval.secondsShorthand': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.secondsShorthand', { + defaultMessage: '{interval} s', + values: { interval }, + }), + 'euiPrettyInterval.minutesShorthand': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.minutesShorthand', { + defaultMessage: '{interval} m', + values: { interval }, + }), + 'euiPrettyInterval.hoursShorthand': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.hoursShorthand', { + defaultMessage: '{interval} h', + values: { interval }, + }), + 'euiPrettyInterval.daysShorthand': ({ interval }: EuiValues) => + i18n.translate('core.euiPrettyInterval.daysShorthand', { + defaultMessage: '{interval} d', + values: { interval }, + }), + 'euiPrettyInterval.off': i18n.translate('core.euiPrettyInterval.off', { + defaultMessage: 'Off', + }), + 'euiTimeOptions.last': i18n.translate('core.euiTimeOptions.last', { + defaultMessage: 'Last', + }), + 'euiTimeOptions.next': i18n.translate('core.euiTimeOptions.next', { + defaultMessage: 'Next', + }), + 'euiTimeOptions.seconds': i18n.translate('core.euiTimeOptions.seconds', { + defaultMessage: 'Seconds', + }), + 'euiTimeOptions.minutes': i18n.translate('core.euiTimeOptions.minutes', { + defaultMessage: 'Minutes', + }), + 'euiTimeOptions.hours': i18n.translate('core.euiTimeOptions.hours', { + defaultMessage: 'Hours', + }), + 'euiTimeOptions.days': i18n.translate('core.euiTimeOptions.days', { + defaultMessage: 'Days', + }), + 'euiTimeOptions.weeks': i18n.translate('core.euiTimeOptions.weeks', { + defaultMessage: 'Weeks', + }), + 'euiTimeOptions.months': i18n.translate('core.euiTimeOptions.months', { + defaultMessage: 'Months', + }), + 'euiTimeOptions.years': i18n.translate('core.euiTimeOptions.years', { + defaultMessage: 'Years', + }), + 'euiTimeOptions.secondsAgo': i18n.translate('core.euiTimeOptions.secondsAgo', { + defaultMessage: 'Seconds ago', + }), + 'euiTimeOptions.minutesAgo': i18n.translate('core.euiTimeOptions.minutesAgo', { + defaultMessage: 'Minutes ago', + }), + 'euiTimeOptions.hoursAgo': i18n.translate('core.euiTimeOptions.hoursAgo', { + defaultMessage: 'Hours ago', + }), + 'euiTimeOptions.daysAgo': i18n.translate('core.euiTimeOptions.daysAgo', { + defaultMessage: 'Days ago', + }), + 'euiTimeOptions.weeksAgo': i18n.translate('core.euiTimeOptions.weeksAgo', { + defaultMessage: 'Weeks ago', + }), + 'euiTimeOptions.monthsAgo': i18n.translate('core.euiTimeOptions.monthsAgo', { + defaultMessage: 'Months ago', + }), + 'euiTimeOptions.yearsAgo': i18n.translate('core.euiTimeOptions.yearsAgo', { + defaultMessage: 'Years ago', + }), + 'euiTimeOptions.secondsFromNow': i18n.translate('core.euiTimeOptions.secondsFromNow', { + defaultMessage: 'Seconds from now', + }), + 'euiTimeOptions.minutesFromNow': i18n.translate('core.euiTimeOptions.minutesFromNow', { + defaultMessage: 'Minutes from now', + }), + 'euiTimeOptions.hoursFromNow': i18n.translate('core.euiTimeOptions.hoursFromNow', { + defaultMessage: 'Hours from now', + }), + 'euiTimeOptions.daysFromNow': i18n.translate('core.euiTimeOptions.daysFromNow', { + defaultMessage: 'Days from now', + }), + 'euiTimeOptions.weeksFromNow': i18n.translate('core.euiTimeOptions.weeksFromNow', { + defaultMessage: 'Weeks from now', + }), + 'euiTimeOptions.monthsFromNow': i18n.translate('core.euiTimeOptions.monthsFromNow', { + defaultMessage: 'Months from now', + }), + 'euiTimeOptions.yearsFromNow': i18n.translate('core.euiTimeOptions.yearsFromNow', { + defaultMessage: 'Years from now', + }), + 'euiTimeOptions.roundToSecond': i18n.translate('core.euiTimeOptions.roundToSecond', { + defaultMessage: 'Round to the second', + }), + 'euiTimeOptions.roundToMinute': i18n.translate('core.euiTimeOptions.roundToMinute', { + defaultMessage: 'Round to the minute', + }), + 'euiTimeOptions.roundToHour': i18n.translate('core.euiTimeOptions.roundToHour', { + defaultMessage: 'Round to the hour', + }), + 'euiTimeOptions.roundToDay': i18n.translate('core.euiTimeOptions.roundToDay', { + defaultMessage: 'Round to the day', + }), + 'euiTimeOptions.roundToWeek': i18n.translate('core.euiTimeOptions.roundToWeek', { + defaultMessage: 'Round to the week', + }), + 'euiTimeOptions.roundToMonth': i18n.translate('core.euiTimeOptions.roundToMonth', { + defaultMessage: 'Round to the month', + }), + 'euiTimeOptions.roundToYear': i18n.translate('core.euiTimeOptions.roundToYear', { + defaultMessage: 'Round to the year', + }), + 'euiTimeOptions.today': i18n.translate('core.euiTimeOptions.today', { + defaultMessage: 'Today', + }), + 'euiTimeOptions.thisWeek': i18n.translate('core.euiTimeOptions.thisWeek', { + defaultMessage: 'This week', + }), + 'euiTimeOptions.thisMonth': i18n.translate('core.euiTimeOptions.thisMonth', { + defaultMessage: 'This month', + }), + 'euiTimeOptions.thisYear': i18n.translate('core.euiTimeOptions.thisYear', { + defaultMessage: 'This year', + }), + 'euiTimeOptions.yesterday': i18n.translate('core.euiTimeOptions.yesterday', { + defaultMessage: 'Yesterday', + }), + 'euiTimeOptions.weekToDate': i18n.translate('core.euiTimeOptions.weekToDate', { + defaultMessage: 'Week to date', + }), + 'euiTimeOptions.monthToDate': i18n.translate('core.euiTimeOptions.monthToDate', { + defaultMessage: 'Month to date', + }), + 'euiTimeOptions.yearToDate': i18n.translate('core.euiTimeOptions.yearToDate', { + defaultMessage: 'Year to date', + }), 'euiQuickSelect.applyButton': i18n.translate('core.euiQuickSelect.applyButton', { defaultMessage: 'Apply', }), @@ -888,21 +1161,50 @@ export const getEuiContextMapping = (): EuiTokensObject => { defaultMessage: 'Refresh is on, interval set to {optionValue} {optionText}.', values: { optionValue, optionText }, }), + 'euiDatePopoverContent.startDateLabel': i18n.translate( + 'core.euiDatePopoverContent.startDateLabel', + { defaultMessage: 'Start date' } + ), + 'euiDatePopoverContent.endDateLabel': i18n.translate( + 'core.euiDatePopoverContent.endDateLabel', + { defaultMessage: 'End date' } + ), + 'euiDatePopoverContent.absoluteTabLabel': i18n.translate( + 'core.euiDatePopoverContent.absoluteTabLabel', + { defaultMessage: 'Absolute' } + ), + 'euiDatePopoverContent.relativeTabLabel': i18n.translate( + 'core.euiDatePopoverContent.relativeTabLabel', + { defaultMessage: 'Relative' } + ), + 'euiDatePopoverContent.nowTabLabel': i18n.translate('core.euiDatePopoverContent.nowTabLabel', { + defaultMessage: 'Now', + }), + 'euiDatePopoverContent.nowTabContent': i18n.translate( + 'core.euiDatePopoverContent.nowTabContent', + { + defaultMessage: + 'Setting the time to "now" means that on every refresh this time will be set to the time of the refresh.', + } + ), + 'euiDatePopoverContent.nowTabButtonStart': i18n.translate( + 'core.euiDatePopoverContent.nowTabButtonStart', + { defaultMessage: 'Set start date and time to now' } + ), + 'euiDatePopoverContent.nowTabButtonEnd': i18n.translate( + 'core.euiDatePopoverContent.nowTabButtonEnd', + { defaultMessage: 'Set end date and time to now' } + ), + 'euiAbsoluteTab.dateFormatError': ({ dateFormat }: EuiValues) => + i18n.translate('core.euiAbsoluteTab.dateFormatError', { + defaultMessage: 'Expected format: {dateFormat}', + values: { dateFormat }, + }), 'euiRelativeTab.fullDescription': ({ unit }: EuiValues) => i18n.translate('core.euiRelativeTab.fullDescription', { defaultMessage: 'The unit is changeable. Currently set to {unit}.', values: { unit }, }), - 'euiRelativeTab.relativeDate': ({ position }: EuiValues) => - i18n.translate('core.euiRelativeTab.relativeDate', { - defaultMessage: '{position} date', - values: { position }, - }), - 'euiRelativeTab.roundingLabel': ({ unit }: EuiValues) => - i18n.translate('core.euiRelativeTab.roundingLabel', { - defaultMessage: 'Round to the {unit}', - values: { unit }, - }), 'euiRelativeTab.unitInputLabel': i18n.translate('core.euiRelativeTab.unitInputLabel', { defaultMessage: 'Relative time span', }), diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 354121fc88936..cb1c61b0a47e0 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -77,6 +77,6 @@ export const LICENSE_OVERRIDES = { 'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint '@elastic/ems-client@8.2.0': ['Elastic License 2.0'], - '@elastic/eui@52.2.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@53.0.1': ['SSPL-1.0 OR Elastic License 2.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry }; diff --git a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx index 56dd901055fbc..9f99049d3e788 100644 --- a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx @@ -105,7 +105,7 @@ function wrapQueryBarTopRowInContext(testProps: any) { describe('QueryBarTopRowTopRow', () => { const QUERY_INPUT_SELECTOR = 'QueryStringInputUI'; - const TIMEPICKER_SELECTOR = 'EuiSuperDatePicker'; + const TIMEPICKER_SELECTOR = 'Memo(EuiSuperDatePicker)'; const TIMEPICKER_DURATION = '[data-shared-timefilter-duration]'; beforeEach(() => { diff --git a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx index 75d22137937e9..424347834c3db 100644 --- a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx @@ -19,7 +19,7 @@ import { EuiFlexItem, EuiSuperDatePicker, EuiFieldText, - prettyDuration, + usePrettyDuration, EuiIconProps, EuiSuperUpdateButton, OnRefreshProps, @@ -92,12 +92,12 @@ const SharingMetaFields = React.memo(function SharingMetaFields({ return valueAsMoment.toISOString(); } - const dateRangePretty = prettyDuration( - toAbsoluteString(from), - toAbsoluteString(to), - [], - dateFormat - ); + const dateRangePretty = usePrettyDuration({ + timeFrom: toAbsoluteString(from), + timeTo: toAbsoluteString(to), + quickRanges: [], + dateFormat, + }); return (