Feat: Modify the prompt text for deleting team members #2834 (#3599)

### What problem does this PR solve?
Feat: Modify the prompt text for deleting team members #2834

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu 2024-11-22 18:50:53 +08:00 committed by GitHub
parent 55692e4da6
commit 8872aed512
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 3 deletions

View File

@ -77,6 +77,7 @@ export function useDynamicSVGImport(
}
interface IProps {
title?: string;
onOk?: (...args: any[]) => any;
onCancel?: (...args: any[]) => any;
}
@ -86,10 +87,10 @@ export const useShowDeleteConfirm = () => {
const { t } = useTranslation();
const showDeleteConfirm = useCallback(
({ onOk, onCancel }: IProps): Promise<number> => {
({ title, onOk, onCancel }: IProps): Promise<number> => {
return new Promise((resolve, reject) => {
modal.confirm({
title: t('common.deleteModalTitle'),
title: title ?? t('common.deleteModalTitle'),
icon: <ExclamationCircleFilled />,
// content: 'Some descriptions',
okText: t('common.ok'),

View File

@ -2,7 +2,7 @@ export default {
translation: {
common: {
delete: 'Delete',
deleteModalTitle: 'Are you sure delete this item?',
deleteModalTitle: 'Are you sure to delete this item?',
ok: 'Yes',
cancel: 'No',
total: 'Total',
@ -598,6 +598,7 @@ The above is the content you need to summarize.`,
refuse: 'Decline',
teamMembers: 'Team Members',
joinedTeams: 'Joined Teams',
sureDelete: 'Are you sure to remove this member?',
},
message: {
registered: 'Registered!',

View File

@ -565,6 +565,7 @@ export default {
refuse: '拒絕',
teamMembers: '團隊成員',
joinedTeams: '加入的團隊',
sureDelete: '您確定刪除該成員嗎?',
},
message: {
registered: '註冊成功',

View File

@ -585,6 +585,7 @@ export default {
refuse: '拒绝',
teamMembers: '团队成员',
joinedTeams: '加入的团队',
sureDelete: '您确定要删除该成员吗?',
},
message: {
registered: '注册成功',

View File

@ -6,6 +6,7 @@ import {
useFetchUserInfo,
} from '@/hooks/user-setting-hooks';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
export const useAddUser = () => {
const { addTenantUser } = useAddTenantUser();
@ -36,9 +37,11 @@ export const useAddUser = () => {
export const useHandleDeleteUser = () => {
const { deleteTenantUser, loading } = useDeleteTenantUser();
const showDeleteConfirm = useShowDeleteConfirm();
const { t } = useTranslation();
const handleDeleteTenantUser = (userId: string) => () => {
showDeleteConfirm({
title: t('setting.sureDelete'),
onOk: async () => {
const code = await deleteTenantUser({ userId });
if (code === 0) {