From 47b84f2d782e6013215820e3a803298aabc4f7e1 Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Fri, 20 Jan 2023 16:17:18 +0800 Subject: [PATCH] refactor(phrases): update rbac-related removing phrases (#3005) --- packages/console/src/components/PermissionsTable/index.tsx | 4 +++- .../console/src/pages/RoleDetails/RolePermissions/index.tsx | 3 ++- packages/console/src/pages/RoleDetails/RoleUsers/index.tsx | 4 ++-- packages/console/src/pages/UserDetails/UserRoles/index.tsx | 4 ++-- .../src/locales/de/translation/admin-console/general.ts | 1 + .../src/locales/de/translation/admin-console/role-details.ts | 2 +- .../src/locales/en/translation/admin-console/general.ts | 1 + .../src/locales/en/translation/admin-console/role-details.ts | 2 +- .../src/locales/fr/translation/admin-console/general.ts | 1 + .../src/locales/fr/translation/admin-console/role-details.ts | 2 +- .../src/locales/ko/translation/admin-console/general.ts | 1 + .../src/locales/ko/translation/admin-console/role-details.ts | 2 +- .../src/locales/pt-br/translation/admin-console/general.ts | 1 + .../locales/pt-br/translation/admin-console/role-details.ts | 2 +- .../src/locales/pt-pt/translation/admin-console/general.ts | 1 + .../locales/pt-pt/translation/admin-console/role-details.ts | 2 +- .../src/locales/tr-tr/translation/admin-console/general.ts | 1 + .../locales/tr-tr/translation/admin-console/role-details.ts | 2 +- .../src/locales/zh-cn/translation/admin-console/general.ts | 1 + .../locales/zh-cn/translation/admin-console/role-details.ts | 2 +- 20 files changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/console/src/components/PermissionsTable/index.tsx b/packages/console/src/components/PermissionsTable/index.tsx index 370ad10be..810005fcc 100644 --- a/packages/console/src/components/PermissionsTable/index.tsx +++ b/packages/console/src/components/PermissionsTable/index.tsx @@ -28,6 +28,7 @@ type Props = { isLoading: boolean; errorMessage?: string; createButtonTitle: AdminConsoleKey; + deleteButtonTitle?: AdminConsoleKey; isReadOnly?: boolean; isApiColumnVisible?: boolean; pagination?: PaginationProps; @@ -42,6 +43,7 @@ const PermissionsTable = ({ isLoading, errorMessage, createButtonTitle, + deleteButtonTitle = 'general.delete', isReadOnly = false, isApiColumnVisible = false, pagination, @@ -89,7 +91,7 @@ const PermissionsTable = ({ * When the table is read-only, hide the delete button rather than the whole column to keep the table column spaces. */ isReadOnly ? null : ( - + {t(deleteButtonTitle)}}> { deleteHandler(scope); diff --git a/packages/console/src/pages/RoleDetails/RolePermissions/index.tsx b/packages/console/src/pages/RoleDetails/RolePermissions/index.tsx index 497a0f15a..cf119ed5d 100644 --- a/packages/console/src/pages/RoleDetails/RolePermissions/index.tsx +++ b/packages/console/src/pages/RoleDetails/RolePermissions/index.tsx @@ -72,6 +72,7 @@ const RolePermissions = () => { scopes={scopes} isLoading={isLoading} createButtonTitle="role_details.permission.assign_button" + deleteButtonTitle="general.remove" createHandler={() => { setIsAssignPermissionsModalOpen(true); }} @@ -100,7 +101,7 @@ const RolePermissions = () => { { setScopeToBeDeleted(undefined); }} diff --git a/packages/console/src/pages/RoleDetails/RoleUsers/index.tsx b/packages/console/src/pages/RoleDetails/RoleUsers/index.tsx index bc1723f4e..625fc2665 100644 --- a/packages/console/src/pages/RoleDetails/RoleUsers/index.tsx +++ b/packages/console/src/pages/RoleDetails/RoleUsers/index.tsx @@ -114,7 +114,7 @@ const RoleUsers = () => { dataIndex: 'delete', colSpan: 1, render: (user) => ( - + { setUserToBeDeleted(user); @@ -174,7 +174,7 @@ const RoleUsers = () => { { setUserToBeDeleted(undefined); }} diff --git a/packages/console/src/pages/UserDetails/UserRoles/index.tsx b/packages/console/src/pages/UserDetails/UserRoles/index.tsx index 2e3a67428..2ba43b178 100644 --- a/packages/console/src/pages/UserDetails/UserRoles/index.tsx +++ b/packages/console/src/pages/UserDetails/UserRoles/index.tsx @@ -98,7 +98,7 @@ const UserRoles = () => { dataIndex: 'delete', colSpan: 1, render: (role) => ( - + { setRoleToBeDeleted(role); @@ -161,7 +161,7 @@ const UserRoles = () => { { setRoleToBeDeleted(undefined); }} diff --git a/packages/phrases/src/locales/de/translation/admin-console/general.ts b/packages/phrases/src/locales/de/translation/admin-console/general.ts index 0f4c5e60f..24a955823 100644 --- a/packages/phrases/src/locales/de/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/de/translation/admin-console/general.ts @@ -43,6 +43,7 @@ const general = { learn_more: 'Learn more', // UNTRANSLATED tab_errors: '{{count, number}} errors', // UNTRANSLATED skip_for_now: 'Skip for now', // UNTRANSLATED + remove: 'Remove', // UNTRANSLATED }; export default general; diff --git a/packages/phrases/src/locales/de/translation/admin-console/role-details.ts b/packages/phrases/src/locales/de/translation/admin-console/role-details.ts index 2617137ea..04a42a7a5 100644 --- a/packages/phrases/src/locales/de/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/de/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', // UNTRANSLATED permission_assigned: 'The selected permissions were successfully assigned to this role!', // UNTRANSLATED deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', // UNTRANSLATED empty: 'No permission available', // UNTRANSLATED }, diff --git a/packages/phrases/src/locales/en/translation/admin-console/general.ts b/packages/phrases/src/locales/en/translation/admin-console/general.ts index f2a80eb22..7f45e987c 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/general.ts @@ -42,6 +42,7 @@ const general = { learn_more: 'Learn more', tab_errors: '{{count, number}} errors', skip_for_now: 'Skip for now', + remove: 'Remove', }; export default general; diff --git a/packages/phrases/src/locales/en/translation/admin-console/role-details.ts b/packages/phrases/src/locales/en/translation/admin-console/role-details.ts index 599f22d1b..364edd9f3 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', permission_assigned: 'The selected permissions were successfully assigned to this role!', deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', empty: 'No permission available', }, diff --git a/packages/phrases/src/locales/fr/translation/admin-console/general.ts b/packages/phrases/src/locales/fr/translation/admin-console/general.ts index 1b2b213c9..905558b32 100644 --- a/packages/phrases/src/locales/fr/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/fr/translation/admin-console/general.ts @@ -43,6 +43,7 @@ const general = { learn_more: 'Learn more', // UNTRANSLATED tab_errors: '{{count, number}} errors', // UNTRANSLATED skip_for_now: 'Skip for now', // UNTRANSLATED + remove: 'Remove', // UNTRANSLATED }; export default general; diff --git a/packages/phrases/src/locales/fr/translation/admin-console/role-details.ts b/packages/phrases/src/locales/fr/translation/admin-console/role-details.ts index 2617137ea..04a42a7a5 100644 --- a/packages/phrases/src/locales/fr/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/fr/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', // UNTRANSLATED permission_assigned: 'The selected permissions were successfully assigned to this role!', // UNTRANSLATED deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', // UNTRANSLATED empty: 'No permission available', // UNTRANSLATED }, diff --git a/packages/phrases/src/locales/ko/translation/admin-console/general.ts b/packages/phrases/src/locales/ko/translation/admin-console/general.ts index a0746db57..af4cbcac7 100644 --- a/packages/phrases/src/locales/ko/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/ko/translation/admin-console/general.ts @@ -42,6 +42,7 @@ const general = { learn_more: '더 알아보기', tab_errors: '{{count, number}} 오류', skip_for_now: 'Skip for now', // UNTRANSLATED + remove: 'Remove', // UNTRANSLATED }; export default general; diff --git a/packages/phrases/src/locales/ko/translation/admin-console/role-details.ts b/packages/phrases/src/locales/ko/translation/admin-console/role-details.ts index 2617137ea..04a42a7a5 100644 --- a/packages/phrases/src/locales/ko/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/ko/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', // UNTRANSLATED permission_assigned: 'The selected permissions were successfully assigned to this role!', // UNTRANSLATED deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', // UNTRANSLATED empty: 'No permission available', // UNTRANSLATED }, diff --git a/packages/phrases/src/locales/pt-br/translation/admin-console/general.ts b/packages/phrases/src/locales/pt-br/translation/admin-console/general.ts index 1eafd774e..1f4ab7ef8 100644 --- a/packages/phrases/src/locales/pt-br/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/pt-br/translation/admin-console/general.ts @@ -43,6 +43,7 @@ const general = { learn_more: 'Saber mais', tab_errors: '{{count, number}} erros', skip_for_now: 'Skip for now', // UNTRANSLATED + remove: 'Remove', // UNTRANSLATED }; export default general; diff --git a/packages/phrases/src/locales/pt-br/translation/admin-console/role-details.ts b/packages/phrases/src/locales/pt-br/translation/admin-console/role-details.ts index 2617137ea..04a42a7a5 100644 --- a/packages/phrases/src/locales/pt-br/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/pt-br/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', // UNTRANSLATED permission_assigned: 'The selected permissions were successfully assigned to this role!', // UNTRANSLATED deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', // UNTRANSLATED empty: 'No permission available', // UNTRANSLATED }, diff --git a/packages/phrases/src/locales/pt-pt/translation/admin-console/general.ts b/packages/phrases/src/locales/pt-pt/translation/admin-console/general.ts index 50e5db538..b1e00f247 100644 --- a/packages/phrases/src/locales/pt-pt/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/pt-pt/translation/admin-console/general.ts @@ -42,6 +42,7 @@ const general = { learn_more: 'Learn more', // UNTRANSLATED tab_errors: '{{count, number}} errors', // UNTRANSLATED skip_for_now: 'Skip for now', // UNTRANSLATED + remove: 'Remove', // UNTRANSLATED }; export default general; diff --git a/packages/phrases/src/locales/pt-pt/translation/admin-console/role-details.ts b/packages/phrases/src/locales/pt-pt/translation/admin-console/role-details.ts index 2617137ea..04a42a7a5 100644 --- a/packages/phrases/src/locales/pt-pt/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/pt-pt/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', // UNTRANSLATED permission_assigned: 'The selected permissions were successfully assigned to this role!', // UNTRANSLATED deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', // UNTRANSLATED empty: 'No permission available', // UNTRANSLATED }, diff --git a/packages/phrases/src/locales/tr-tr/translation/admin-console/general.ts b/packages/phrases/src/locales/tr-tr/translation/admin-console/general.ts index 5b484782c..d5f4fc3f3 100644 --- a/packages/phrases/src/locales/tr-tr/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/tr-tr/translation/admin-console/general.ts @@ -43,6 +43,7 @@ const general = { learn_more: 'Learn more', // UNTRANSLATED tab_errors: '{{count, number}} errors', // UNTRANSLATED skip_for_now: 'Skip for now', // UNTRANSLATED + remove: 'Remove', // UNTRANSLATED }; export default general; diff --git a/packages/phrases/src/locales/tr-tr/translation/admin-console/role-details.ts b/packages/phrases/src/locales/tr-tr/translation/admin-console/role-details.ts index 2617137ea..04a42a7a5 100644 --- a/packages/phrases/src/locales/tr-tr/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/tr-tr/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', // UNTRANSLATED permission_assigned: 'The selected permissions were successfully assigned to this role!', // UNTRANSLATED deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', // UNTRANSLATED empty: 'No permission available', // UNTRANSLATED }, diff --git a/packages/phrases/src/locales/zh-cn/translation/admin-console/general.ts b/packages/phrases/src/locales/zh-cn/translation/admin-console/general.ts index ae77d9fa8..6dcee2389 100644 --- a/packages/phrases/src/locales/zh-cn/translation/admin-console/general.ts +++ b/packages/phrases/src/locales/zh-cn/translation/admin-console/general.ts @@ -42,6 +42,7 @@ const general = { learn_more: 'Learn more', // UNTRANSLATED tab_errors: '{{count, number}} errors', // UNTRANSLATED skip_for_now: 'Skip for now', // UNTRANSLATED + remove: '移除', }; export default general; diff --git a/packages/phrases/src/locales/zh-cn/translation/admin-console/role-details.ts b/packages/phrases/src/locales/zh-cn/translation/admin-console/role-details.ts index e1dca9677..d42d83b5d 100644 --- a/packages/phrases/src/locales/zh-cn/translation/admin-console/role-details.ts +++ b/packages/phrases/src/locales/zh-cn/translation/admin-console/role-details.ts @@ -23,7 +23,7 @@ const role_details = { confirm_assign: 'Assign Permission', // UNTRANSLATED permission_assigned: 'The selected permissions were successfully assigned to this role!', // UNTRANSLATED deletion_description: - 'If this permission is deleted, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED + 'If this permission is removed, the affected user with this role will lose the access granted by this permission.', // UNTRANSLATED permission_deleted: 'The permission "{{name}}" was successfully removed from this role!', // UNTRANSLATED empty: 'No permission available', // UNTRANSLATED },