diff --git a/src/plugins/data/public/data_sources/constants.tsx b/src/plugins/data/public/data_sources/constants.tsx index eb0a0cfb0ac8..ffe57487c4bc 100644 --- a/src/plugins/data/public/data_sources/constants.tsx +++ b/src/plugins/data/public/data_sources/constants.tsx @@ -40,7 +40,3 @@ export const s3DataSourceMetadata = { }, }, }; - -export const DATA_SELECTOR_REFRESHER_POPOVER_TEXT = 'Refresh data selector'; -export const DATA_SELECTOR_DEFAULT_PLACEHOLDER = 'Select a data source'; -export const DATA_SELECTOR_S3_DATA_SOURCE_GROUP_HINT_LABEL = ' - Opens in Log Explorer'; diff --git a/src/plugins/data/public/data_sources/datasource_selector/data_selector_refresher.tsx b/src/plugins/data/public/data_sources/datasource_selector/data_selector_refresher.tsx index e066d65bd8a9..a35d1e411e9e 100644 --- a/src/plugins/data/public/data_sources/datasource_selector/data_selector_refresher.tsx +++ b/src/plugins/data/public/data_sources/datasource_selector/data_selector_refresher.tsx @@ -4,7 +4,6 @@ */ import { EuiButtonIconProps, EuiSmallButtonIcon, EuiToolTip, EuiToolTipProps } from '@elastic/eui'; -import { i18n } from '@osd/i18n'; import React from 'react'; interface IDataSelectorRefresherProps { @@ -19,9 +18,7 @@ export const DataSelectorRefresher: React.FC = Reac return ( } diff --git a/src/plugins/data/public/query/query_string/language_service/lib/default_language_reference.tsx b/src/plugins/data/public/query/query_string/language_service/lib/default_language_reference.tsx index 89f188363775..a2894c4e3cab 100644 --- a/src/plugins/data/public/query/query_string/language_service/lib/default_language_reference.tsx +++ b/src/plugins/data/public/query/query_string/language_service/lib/default_language_reference.tsx @@ -27,7 +27,7 @@ export const DefaultLanguageReference = () => {
setIsLanguageReferenceOpen(!isLanguageReferenceOpen)} diff --git a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx index 3a8adb0675ca..042d2e11a664 100644 --- a/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx +++ b/src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx @@ -69,8 +69,9 @@ export function QueryResult(props: { queryStatus: QueryStatus }) { isLoading data-test-subj="queryResultLoading" > - {i18n.translate('data.query.languageService.queryResults.completeTime', { - defaultMessage: `Loading ${time} s`, + {i18n.translate('data.query.languageService.queryResults.loadTime', { + defaultMessage: 'Loading {time} s', + values: { time }, })} ); @@ -79,19 +80,21 @@ export function QueryResult(props: { queryStatus: QueryStatus }) { if (props.queryStatus.status === ResultStatus.READY) { let message; if (!props.queryStatus.elapsedMs) { - message = i18n.translate('data.query.languageService.queryResults.completeTime', { - defaultMessage: `Completed`, + message = i18n.translate('data.query.languageService.queryResults.completeNoTime', { + defaultMessage: 'Completed', }); } else if (props.queryStatus.elapsedMs < 1000) { message = i18n.translate( 'data.query.languageService.queryResults.completeTimeInMiliseconds', { - defaultMessage: `Completed in ${props.queryStatus.elapsedMs} ms`, + defaultMessage: 'Completed in {timeMS} ms', + values: { timeMS: props.queryStatus.elapsedMs }, } ); } else { message = i18n.translate('data.query.languageService.queryResults.completeTimeInSeconds', { - defaultMessage: `Completed in ${(props.queryStatus.elapsedMs / 1000).toFixed(1)} s`, + defaultMessage: 'Completed in {time} s', + values: { time: (props.queryStatus.elapsedMs / 1000).toFixed(1) }, }); } diff --git a/src/plugins/data/public/search/errors/timeout_error.test.tsx b/src/plugins/data/public/search/errors/timeout_error.test.tsx index bf227a74ba14..5f631f99fa14 100644 --- a/src/plugins/data/public/search/errors/timeout_error.test.tsx +++ b/src/plugins/data/public/search/errors/timeout_error.test.tsx @@ -28,7 +28,7 @@ * under the License. */ -import { SearchTimeoutError, TIMEOUT_MESSAGE } from './timeout_error'; +import { SearchTimeoutError } from './timeout_error'; import { coreMock } from '../../../../../core/public/mocks'; const startMock = coreMock.createStart(); @@ -45,6 +45,8 @@ describe('SearchTimeoutError', () => { it('Should create timeout message', () => { const e = new SearchTimeoutError(new AbortError()); const component = mount(e.getErrorMessage(startMock.application)); - expect(component.html()).toEqual(TIMEOUT_MESSAGE); + expect(component.html()).toEqual( + 'Your query has timed out. Contact your system administrator to review your index strategy or increase the run time.' + ); }); }); diff --git a/src/plugins/data/public/search/errors/timeout_error.tsx b/src/plugins/data/public/search/errors/timeout_error.tsx index 222c9bac1841..de2a3ad54e53 100644 --- a/src/plugins/data/public/search/errors/timeout_error.tsx +++ b/src/plugins/data/public/search/errors/timeout_error.tsx @@ -33,8 +33,6 @@ import { i18n } from '@osd/i18n'; import { ApplicationStart } from 'opensearch-dashboards/public'; import { OsdError } from '../../../../opensearch_dashboards_utils/common'; -export const TIMEOUT_MESSAGE: string = - 'Your query has timed out. Contact your system administrator to review your index strategy or increase the run time.'; /** * Request Failure - When an entire multi request fails * @param {Error} err - the Error that came back @@ -46,7 +44,12 @@ export class SearchTimeoutError extends OsdError { public getErrorMessage(application: ApplicationStart) { return ( - <>{i18n.translate('data.search.timeoutContactAdmin', { defaultMessage: TIMEOUT_MESSAGE })} + <> + {i18n.translate('data.search.timeoutContactAdmin', { + defaultMessage: + 'Your query has timed out. Contact your system administrator to review your index strategy or increase the run time.', + })} + ); } } diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index c2d79fb6d470..428aa7b70304 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -326,7 +326,7 @@ export default class QueryEditorUI extends Component { this.setIsCollapsed(!this.state.isCollapsed)} diff --git a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx index c31a40db8ddb..af57eabecbc6 100644 --- a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx +++ b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx @@ -104,7 +104,7 @@ export function QueryLanguageSwitcher(props: Props) {