Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix i18n issue for submit label in delete resource modal #9406

Merged
merged 1 commit into from Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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