Skip to content

Commit

Permalink
Fix i18n issue for submit label in delete resource modal
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitkrai03 committed Jul 6, 2021
1 parent 8135af4 commit 838b972
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -16,7 +16,8 @@ import { YellowExclamationTriangleIcon } from '../status';
type DeleteResourceModalProps = {
resourceName: string;
resourceType: string;
actionLabelKey?: string;
actionLabel?: string; // Used to send translated strings as action label.
actionLabelKey?: string; // Used to send translation key for action label.
redirect?: string;
onSubmit: (values: FormikValues) => Promise<K8sResourceKind[]>;
cancel?: () => void;
Expand All @@ -32,6 +33,7 @@ const DeleteResourceForm: React.FC<FormikProps<FormikValues> & DeleteResourceMod
handleSubmit,
resourceName,
resourceType,
actionLabel,
// t('console-shared~Delete')
actionLabelKey = 'console-shared~Delete',
isSubmitting,
Expand All @@ -41,7 +43,7 @@ const DeleteResourceForm: React.FC<FormikProps<FormikValues> & DeleteResourceMod
}) => {
const { t } = useTranslation();
const isValid = values.resourceName === resourceName;
const submitLabel = t(actionLabelKey);
const submitLabel = actionLabel || t(actionLabelKey);
return (
<form onSubmit={handleSubmit} className="modal-content modal-content--no-inner-scroll">
<ModalTitle>
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/helm-plugin/src/actions/creators.ts
Expand Up @@ -15,7 +15,7 @@ export const getHelmDeleteAction = (
blocking: true,
resourceName: releaseName,
resourceType: 'Helm Release',
actionLabelKey: t('helm-plugin~Uninstall'),
actionLabel: t('helm-plugin~Uninstall'),
redirect,
onSubmit: () => {
return coFetchJSON.delete(
Expand Down

0 comments on commit 838b972

Please sign in to comment.