Skip to content

Commit

Permalink
Add i18n for acc create button
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Mar 19, 2024
1 parent 8a8bfe0 commit f3d978b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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;
Expand Down Expand Up @@ -51,14 +55,14 @@ 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');

Check warning on line 58 in public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx#L58

Added line #L58 was not covered by tests
resetFlyout();
} else if (
status === DirectQueryLoadingStatus.FAILED ||
status === DirectQueryLoadingStatus.CANCELED
) {
setIsLoading(false);
setToast('Create acceleration query failed', 'success');
setToast(ACC_CREATE_SUBMIT_FAIL_MSG, 'success');

Check warning on line 65 in public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx#L65

Added line #L65 was not covered by tests
}
}, [directqueryLoadStatus]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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',
Expand Down

0 comments on commit f3d978b

Please sign in to comment.