From c6e8b4149ad877ef53ed22fe1b2f8ba6b340bda3 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Mon, 18 Mar 2024 22:57:13 -0700 Subject: [PATCH 1/8] Add i18n support for acc overlay and acc operation Signed-off-by: Ryan Liang --- .../acceleration_action_overlay.tsx | 29 ++++++++++++++++--- .../utils/acceleration_utils.tsx | 14 +++++++-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx b/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx index 1dac3599f..bdaf0cd99 100644 --- a/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx +++ b/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx @@ -5,6 +5,7 @@ import React, { useState } from 'react'; import { EuiOverlayMask, EuiConfirmModal, EuiFormRow, EuiFieldText } from '@elastic/eui'; +import { i18n } from '@osd/i18n'; import { CachedAcceleration } from '../../../../../../common/types/data_connections'; import { ACC_DELETE_MSG, @@ -48,9 +49,14 @@ export const AccelerationActionOverlay: React.FC switch (actionType) { case 'vacuum': - title = `Vacuum acceleration ${displayIndexName} on ${displayFullPath} ?`; + title = i18n.translate('accelerationActionOverlay.vacuum.title', { + defaultMessage: 'Vacuum acceleration {displayIndexName} on {displayFullPath}?', + values: { displayIndexName, displayFullPath }, + }); description = ACC_VACUUM_MSG; - confirmButtonText = 'Vacuum'; + confirmButtonText = i18n.translate('accelerationActionOverlay.vacuum.confirmButtonText', { + defaultMessage: 'Vacuum', + }); confirmEnabled = confirmationInput === displayIndexName; break; case 'delete': @@ -59,10 +65,25 @@ export const AccelerationActionOverlay: React.FC confirmButtonText = 'Delete'; break; case 'sync': - title = 'Manual sync data?'; + title = i18n.translate('accelerationActionOverlay.sync.title', { + defaultMessage: 'Manual sync data?', + }); description = ACC_SYNC_MSG; - confirmButtonText = 'Sync'; + confirmButtonText = i18n.translate('accelerationActionOverlay.sync.confirmButtonText', { + defaultMessage: 'Sync', + }); break; + default: + title = i18n.translate('accelerationActionOverlay.unknownAction.title', { + defaultMessage: 'Unknown Action', + }); + description = ''; + confirmButtonText = i18n.translate( + 'accelerationActionOverlay.unknownAction.confirmButtonText', + { + defaultMessage: 'Confirm', + } + ); } return ( diff --git a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx index 84b674739..975696ac1 100644 --- a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx +++ b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx @@ -5,6 +5,7 @@ import React from 'react'; import { EuiButton, EuiHealth } from '@elastic/eui'; +import { i18n } from '@osd/i18n'; import { CachedAcceleration } from '../../../../../../../common/types/data_connections'; import { redirectToExplorerOSIdx, @@ -16,11 +17,18 @@ export const ACC_PANEL_TITLE = 'Accelerations'; export const ACC_PANEL_DESC = 'Accelerations optimize query performance by indexing external data into OpenSearch.'; export const ACC_LOADING_MSG = 'Loading/Refreshing accelerations...'; + export const ACC_DELETE_MSG = (name: string) => `Are you sure you want to delete ${name}? Any accelerations associated with this data source will also be deleted.This action cannot be undone.`; -export const ACC_VACUUM_MSG = - 'Vacuuming will remove the actual data from the disk since the associated index will be removed from the cluster. To confirm your action, type the name of the acceleration below.'; -export const ACC_SYNC_MSG = 'Syncing data may require querying all data. Do you want to continue?'; + +export const ACC_VACUUM_MSG = i18n.translate('accelerationActionOverlay.vacuum.description', { + defaultMessage: + 'Vacuuming will remove the actual data from the disk since the associated index will be removed from the cluster. To confirm your action, type the name of the acceleration below.', +}); + +export const ACC_SYNC_MSG = i18n.translate('accelerationActionOverlay.sync.description', { + defaultMessage: 'Syncing data may require querying all data. Do you want to continue?', +}); export type AccelerationActionType = 'delete' | 'vacuum' | 'sync'; From 0f52a4fa990cc591f07d882a13d6fdb824c48922 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Mon, 18 Mar 2024 23:14:35 -0700 Subject: [PATCH 2/8] Add i18n support for acc overlay and acc operation 2 Signed-off-by: Ryan Liang --- .../accelerations/acceleration_operation.tsx | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/public/components/datasources/components/manage/accelerations/acceleration_operation.tsx b/public/components/datasources/components/manage/accelerations/acceleration_operation.tsx index 36acdecb2..710072812 100644 --- a/public/components/datasources/components/manage/accelerations/acceleration_operation.tsx +++ b/public/components/datasources/components/manage/accelerations/acceleration_operation.tsx @@ -4,6 +4,7 @@ */ import { useEffect, useState } from 'react'; +import { i18n } from '@osd/i18n'; import { CachedAcceleration } from '../../../../../../common/types/data_connections'; import { useToast } from '../../../../common/toast'; import { useDirectQuery } from '../../../../../framework/datasources/direct_query_hook'; @@ -36,17 +37,38 @@ export const useAccelerationOperation = (dataSource: string) => { switch (operationType) { case 'delete': - operationInProgressMessage = `Deleting acceleration: ${displayAccelerationName}`; - operationSuccessMessage = `Successfully deleted acceleration: ${displayAccelerationName}`; - operationFailureMessage = `Failed to delete acceleration: ${displayAccelerationName}`; + operationInProgressMessage = i18n.translate('useAccelerationOperation.deletingInProgress', { + defaultMessage: 'Deleting acceleration: {displayAccelerationName}', + values: { displayAccelerationName }, + }); + operationSuccessMessage = i18n.translate('useAccelerationOperation.deleteSuccess', { + defaultMessage: 'Successfully deleted acceleration: {displayAccelerationName}', + values: { displayAccelerationName }, + }); + operationFailureMessage = i18n.translate('useAccelerationOperation.deleteFailure', { + defaultMessage: 'Failed to delete acceleration: {displayAccelerationName}', + values: { displayAccelerationName }, + }); break; case 'vacuum': - operationInProgressMessage = `Vacuuming acceleration: ${displayAccelerationName}`; - operationSuccessMessage = `Successfully vacuumed acceleration: ${displayAccelerationName}`; - operationFailureMessage = `Failed to vacuum acceleration: ${displayAccelerationName}`; + operationInProgressMessage = i18n.translate('useAccelerationOperation.vacuumInProgress', { + defaultMessage: 'Vacuuming acceleration: {displayAccelerationName}', + values: { displayAccelerationName }, + }); + operationSuccessMessage = i18n.translate('useAccelerationOperation.vacuumSuccess', { + defaultMessage: 'Successfully vacuumed acceleration: {displayAccelerationName}', + values: { displayAccelerationName }, + }); + operationFailureMessage = i18n.translate('useAccelerationOperation.vacuumFailure', { + defaultMessage: 'Failed to vacuum acceleration: {displayAccelerationName}', + values: { displayAccelerationName }, + }); break; case 'sync': - operationInProgressMessage = `Syncing acceleration: ${displayAccelerationName}`; + operationInProgressMessage = i18n.translate('useAccelerationOperation.syncInProgress', { + defaultMessage: 'Syncing acceleration: {displayAccelerationName}', + values: { displayAccelerationName }, + }); break; } From 33100afda3d19b9b1529436e0ad74574b2530525 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Mon, 18 Mar 2024 23:45:56 -0700 Subject: [PATCH 3/8] Add i18n for acc details tab Signed-off-by: Ryan Liang --- .../acceleration_details_tab.tsx | 99 ++++++++++++++++--- 1 file changed, 83 insertions(+), 16 deletions(-) diff --git a/public/components/datasources/components/manage/accelerations/flyout_modules/acceleration_details_tab.tsx b/public/components/datasources/components/manage/accelerations/flyout_modules/acceleration_details_tab.tsx index fd78bc0a8..d37ca8e9c 100644 --- a/public/components/datasources/components/manage/accelerations/flyout_modules/acceleration_details_tab.tsx +++ b/public/components/datasources/components/manage/accelerations/flyout_modules/acceleration_details_tab.tsx @@ -14,6 +14,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; +import { i18n } from '@osd/i18n'; import { AccelerationHealth, AccelerationStatus } from '../utils/acceleration_utils'; import { coreRefs } from '../../../../../../framework/core_refs'; import { observabilityDataConnectionsID } from '../../../../../../../common/constants/shared'; @@ -58,6 +59,7 @@ export const AccelerationDetailsTab = ({ ).toLocaleString(); const checkpointName = mappings?.data?.[acceleration.flintIndexName]?.mappings?._meta?.options?.checkpoint_location; + const DetailComponent = ({ title, description, @@ -67,7 +69,11 @@ export const AccelerationDetailsTab = ({ }) => ( - {title} + + {i18n.translate(`accelerationDetailsTab.details.${title}`, { + defaultMessage: title, + })} + {description} @@ -76,7 +82,11 @@ export const AccelerationDetailsTab = ({ const TitleComponent = ({ title }: { title: string }) => ( <> -

{title}

+

+ {i18n.translate(`accelerationDetailsTab.titles.${title}`, { + defaultMessage: title, + })} +

@@ -87,20 +97,36 @@ export const AccelerationDetailsTab = ({ } /> - + - + { @@ -115,29 +141,70 @@ export const AccelerationDetailsTab = ({ } /> - - + + {!isSkippingIndex && ( <> - + - + } /> )} - + - - + + {checkpointName && ( - + )} From c341e8c87203289d9281d501ed18c250157a8826 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Mon, 18 Mar 2024 23:49:31 -0700 Subject: [PATCH 4/8] Add i18n for acc schema tab Signed-off-by: Ryan Liang --- .../flyout_modules/accelerations_schema_tab.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/public/components/datasources/components/manage/accelerations/flyout_modules/accelerations_schema_tab.tsx b/public/components/datasources/components/manage/accelerations/flyout_modules/accelerations_schema_tab.tsx index 9c11fd726..dc15c6fea 100644 --- a/public/components/datasources/components/manage/accelerations/flyout_modules/accelerations_schema_tab.tsx +++ b/public/components/datasources/components/manage/accelerations/flyout_modules/accelerations_schema_tab.tsx @@ -4,6 +4,7 @@ */ import { EuiInMemoryTable, EuiTableFieldDataColumnType } from '@elastic/eui'; +import { i18n } from '@osd/i18n'; import React from 'react'; interface AccelerationSchemaTabProps { @@ -27,18 +28,24 @@ export const AccelerationSchemaTab = ({ mappings, indexInfo }: AccelerationSchem const columns = [ { field: 'columns_name', - name: 'Column name', + name: i18n.translate('accelerationSchemaTab.columnNameHeader', { + defaultMessage: 'Column name', + }), }, { field: 'data_type', - name: 'Data type', + name: i18n.translate('accelerationSchemaTab.dataTypeHeader', { + defaultMessage: 'Data type', + }), }, ] as Array>; if (isSkippingIndex) { columns.push({ field: 'acceleration_type', - name: 'Acceleration index type', + name: i18n.translate('accelerationSchemaTab.accelerationIndexTypeHeader', { + defaultMessage: 'Acceleration index type', + }), }); } From 1547f8b38c44b7d50cc0cf24fc0bceaf2218648e Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Tue, 19 Mar 2024 00:01:11 -0700 Subject: [PATCH 5/8] Add i18n for acc flyout Signed-off-by: Ryan Liang --- .../manage/accelerations/acceleration_details_flyout.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx b/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx index 76294a209..3d42482dd 100644 --- a/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx +++ b/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx @@ -16,6 +16,7 @@ import { EuiText, } from '@elastic/eui'; import React, { useEffect, useState } from 'react'; +import { i18n } from '@osd/i18n'; import { AccelerationDetailsTab } from './flyout_modules/acceleration_details_tab'; import { AccelerationSchemaTab } from './flyout_modules/accelerations_schema_tab'; import { @@ -186,12 +187,16 @@ export const AccelerationDetailsFlyout = (props: AccelerationDetailsFlyoutProps) const accelerationDetailsTabs = [ { id: 'details', - name: 'Details', + name: i18n.translate('accelerationDetailsFlyout.tabs.details', { + defaultMessage: 'Details', + }), disabled: false, }, { id: 'schema', - name: 'Schema', + name: i18n.translate('accelerationDetailsFlyout.tabs.schema', { + defaultMessage: 'Schema', + }), disabled: false, }, ]; From 2a471eb8c8b344a96c5ba6cb5a25ed451b8bb581 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Tue, 19 Mar 2024 00:04:58 -0700 Subject: [PATCH 6/8] Add i18n for acc utils 2 Signed-off-by: Ryan Liang --- .../accelerations/utils/acceleration_utils.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx index 975696ac1..2c611697d 100644 --- a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx +++ b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx @@ -13,10 +13,18 @@ import { } from '../../associated_objects/utils/associated_objects_tab_utils'; import { DATA_SOURCE_TYPES } from '../../../../../../../common/constants/data_sources'; -export const ACC_PANEL_TITLE = 'Accelerations'; -export const ACC_PANEL_DESC = - 'Accelerations optimize query performance by indexing external data into OpenSearch.'; -export const ACC_LOADING_MSG = 'Loading/Refreshing accelerations...'; +export const ACC_PANEL_TITLE = i18n.translate('accelerationTable.panelTitle', { + defaultMessage: 'Accelerations', +}); + +export const ACC_PANEL_DESC = i18n.translate('accelerationTable.panelDescription', { + defaultMessage: + 'Accelerations optimize query performance by indexing external data into OpenSearch.', +}); + +export const ACC_LOADING_MSG = i18n.translate('accelerationTable.loadingMessage', { + defaultMessage: 'Loading/Refreshing accelerations...', +}); export const ACC_DELETE_MSG = (name: string) => `Are you sure you want to delete ${name}? Any accelerations associated with this data source will also be deleted.This action cannot be undone.`; From 21e318ae21849aaab8ed9bd3f121695e78047f8a Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Tue, 19 Mar 2024 00:33:02 -0700 Subject: [PATCH 7/8] Add i18n for acc table and utils Signed-off-by: Ryan Liang --- opensearch_dashboards.json | 4 +- package.json | 2 +- .../accelerations/acceleration_table.tsx | 22 ++++++----- .../utils/acceleration_utils.tsx | 39 +++++++++++++++++++ 4 files changed, 54 insertions(+), 13 deletions(-) diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index efaf21587..711320d99 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "observabilityDashboards", - "version": "3.0.0.0", - "opensearchDashboardsVersion": "3.0.0", + "version": "2.13.0.0", + "opensearchDashboardsVersion": "2.13.0", "server": true, "ui": true, "requiredPlugins": [ diff --git a/package.json b/package.json index 9b8e340ec..c1adf3696 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "observability-dashboards", - "version": "3.0.0.0", + "version": "2.13.0.0", "main": "index.ts", "license": "Apache-2.0", "scripts": { diff --git a/public/components/datasources/components/manage/accelerations/acceleration_table.tsx b/public/components/datasources/components/manage/accelerations/acceleration_table.tsx index 266d77c8f..936329f45 100644 --- a/public/components/datasources/components/manage/accelerations/acceleration_table.tsx +++ b/public/components/datasources/components/manage/accelerations/acceleration_table.tsx @@ -24,9 +24,11 @@ import { ACC_LOADING_MSG, ACC_PANEL_TITLE, ACC_PANEL_DESC, + ACC_TABLE_ACTION_DESC, getAccelerationName, AccelerationActionType, CreateAccelerationFlyoutButton, + ACC_TABLE_COLUMN_NAMES, } from './utils/acceleration_utils'; import { getRenderAccelerationDetailsFlyout } from '../../../../../plugin'; import { CatalogCacheManager } from '../../../../../framework/catalog_cache/cache_manager'; @@ -213,21 +215,21 @@ export const AccelerationTable = ({ }, { name: 'Sync', - description: 'Manual Sync Data', + description: ACC_TABLE_ACTION_DESC.syncAction, icon: 'inputOutput', onClick: (item: CachedAcceleration) => handleActionClick('sync', item), enabled: (item: CachedAcceleration) => !item.autoRefresh && item.status === 'active', }, { name: 'Delete', - description: 'Delete acceleration', + description: ACC_TABLE_ACTION_DESC.deleteAction, icon: 'trash', onClick: (item: CachedAcceleration) => handleActionClick('delete', item), enabled: (item: CachedAcceleration) => item.status !== 'deleted', }, { name: 'Vacuum', - description: 'Vacuum acceleration', + description: ACC_TABLE_ACTION_DESC.vacuumAction, icon: 'broom', onClick: (item: CachedAcceleration) => handleActionClick('vacuum', item), enabled: (item: CachedAcceleration) => item.status === 'deleted', @@ -237,7 +239,7 @@ export const AccelerationTable = ({ const accelerationTableColumns = [ { field: 'indexName', - name: 'Name', + name: ACC_TABLE_COLUMN_NAMES.columnName, sortable: true, render: (indexName: string, acceleration: CachedAcceleration) => { const displayName = getAccelerationName(acceleration); @@ -254,13 +256,13 @@ export const AccelerationTable = ({ }, { field: 'status', - name: 'Status', + name: ACC_TABLE_COLUMN_NAMES.columnStatus, sortable: true, render: (status: string) => , }, { field: 'type', - name: 'Type', + name: ACC_TABLE_COLUMN_NAMES.columnType, sortable: true, render: (type: string) => { let label; @@ -282,19 +284,19 @@ export const AccelerationTable = ({ }, { field: 'database', - name: 'Database', + name: ACC_TABLE_COLUMN_NAMES.columnDatabase, sortable: true, render: (database: string) => {database}, }, { field: 'table', - name: 'Table', + name: ACC_TABLE_COLUMN_NAMES.columnTable, sortable: true, render: (table: string) => {table || '-'}, }, { field: 'refreshType', - name: 'Refresh Type', + name: ACC_TABLE_COLUMN_NAMES.columnRefreshType, sortable: true, render: (autoRefresh: boolean, acceleration: CachedAcceleration) => { return {acceleration.autoRefresh ? 'Auto refresh' : 'Manual'}; @@ -302,7 +304,7 @@ export const AccelerationTable = ({ }, { field: 'flintIndexName', - name: 'Destination Index', + name: ACC_TABLE_COLUMN_NAMES.columnDestinationIndex, sortable: true, render: (flintIndexName: string, acceleration: CachedAcceleration) => { if (acceleration.type === 'skipping') { diff --git a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx index 2c611697d..d87b7a29d 100644 --- a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx +++ b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx @@ -38,6 +38,45 @@ export const ACC_SYNC_MSG = i18n.translate('accelerationActionOverlay.sync.descr defaultMessage: 'Syncing data may require querying all data. Do you want to continue?', }); +export const ACC_TABLE_ACTION_DESC = { + discoverAction: i18n.translate('accelerationTable.actions.discover', { + defaultMessage: 'Open in Discover', + }), + syncAction: i18n.translate('accelerationTable.actions.sync', { + defaultMessage: 'Manual Sync Data', + }), + deleteAction: i18n.translate('accelerationTable.actions.delete', { + defaultMessage: 'Delete acceleration', + }), + vacuumAction: i18n.translate('accelerationTable.actions.vacuum', { + defaultMessage: 'Vacuum acceleration', + }), +}; + +export const ACC_TABLE_COLUMN_NAMES = { + columnName: i18n.translate('accelerationTable.columns.columnName', { + defaultMessage: 'Name', + }), + columnStatus: i18n.translate('accelerationTable.columns.columnStatus', { + defaultMessage: 'Status', + }), + columnType: i18n.translate('accelerationTable.columns.columnType', { + defaultMessage: 'Type', + }), + columnDatabase: i18n.translate('accelerationTable.columns.columnDatabase', { + defaultMessage: 'Database', + }), + columnTable: i18n.translate('accelerationTable.columns.columnTable', { + defaultMessage: 'Table', + }), + columnRefreshType: i18n.translate('accelerationTable.columns.columnRefreshType', { + defaultMessage: 'Refresh Type', + }), + columnDestinationIndex: i18n.translate('accelerationTable.columns.columnDestinationIndex', { + defaultMessage: 'Destination Index', + }), +}; + export type AccelerationActionType = 'delete' | 'vacuum' | 'sync'; export const getAccelerationName = (acceleration: CachedAcceleration) => { From baa98d7c9778b942857fe264798d85106cde46ed Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Tue, 19 Mar 2024 00:56:42 -0700 Subject: [PATCH 8/8] Add i18n for acc create button Signed-off-by: Ryan Liang --- opensearch_dashboards.json | 4 ++-- package.json | 2 +- .../create/create_acceleration_button.tsx | 6 +++++- .../manage/accelerations/utils/acceleration_utils.tsx | 8 ++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 711320d99..efaf21587 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "observabilityDashboards", - "version": "2.13.0.0", - "opensearchDashboardsVersion": "2.13.0", + "version": "3.0.0.0", + "opensearchDashboardsVersion": "3.0.0", "server": true, "ui": true, "requiredPlugins": [ diff --git a/package.json b/package.json index c1adf3696..9b8e340ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "observability-dashboards", - "version": "2.13.0.0", + "version": "3.0.0.0", "main": "index.ts", "license": "Apache-2.0", "scripts": { diff --git a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx index 76d668276..e9102ec91 100644 --- a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx +++ b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx @@ -15,6 +15,10 @@ import { useDirectQuery } from '../../../../../../../framework/datasources/direc import { useToast } from '../../../../../../common/toast'; import { accelerationQueryBuilder } from '../visual_editors/query_builder'; import { formValidator, hasError } from './utils'; +import { + ACC_CREATE_SUBMIT_SUCCESS_MSG, + ACC_CREATE_SUBMIT_FAIL_MSG, +} from '../../utils/acceleration_utils'; interface CreateAccelerationButtonProps { accelerationFormData: CreateAccelerationForm; @@ -54,7 +58,7 @@ export const CreateAccelerationButton = ({ const status = directqueryLoadStatus.toLowerCase(); if (status === DirectQueryLoadingStatus.SUCCESS) { setIsLoading(false); - setToast('Create acceleration query submitted successfully!', 'success'); + setToast(ACC_CREATE_SUBMIT_SUCCESS_MSG, 'success'); if (refreshHandler) refreshHandler(); resetFlyout(); } else if ( diff --git a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx index d87b7a29d..4b512fe8d 100644 --- a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx +++ b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx @@ -38,6 +38,14 @@ export const ACC_SYNC_MSG = i18n.translate('accelerationActionOverlay.sync.descr defaultMessage: 'Syncing data may require querying all data. Do you want to continue?', }); +export const ACC_CREATE_SUBMIT_SUCCESS_MSG = i18n.translate('acceleration.create.submitSuccess', { + defaultMessage: 'Create acceleration query submitted successfully!', +}); + +export const ACC_CREATE_SUBMIT_FAIL_MSG = i18n.translate('acceleration.create.submitFail', { + defaultMessage: 'Create acceleration query failed', +}); + export const ACC_TABLE_ACTION_DESC = { discoverAction: i18n.translate('accelerationTable.actions.discover', { defaultMessage: 'Open in Discover',