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

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

Merged
merged 1 commit into from
Nov 22, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/src/hooks/common-hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function useDynamicSVGImport(
}

interface IProps {
title?: string;
onOk?: (...args: any[]) => any;
onCancel?: (...args: any[]) => any;
}
Expand All @@ -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'),
Expand Down
3 changes: 2 additions & 1 deletion web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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!',
Expand Down
1 change: 1 addition & 0 deletions web/src/locales/zh-traditional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ export default {
refuse: '拒絕',
teamMembers: '團隊成員',
joinedTeams: '加入的團隊',
sureDelete: '您確定刪除該成員嗎?',
},
message: {
registered: '註冊成功',
Expand Down
1 change: 1 addition & 0 deletions web/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ export default {
refuse: '拒绝',
teamMembers: '团队成员',
joinedTeams: '加入的团队',
sureDelete: '您确定要删除该成员吗?',
},
message: {
registered: '注册成功',
Expand Down
3 changes: 3 additions & 0 deletions web/src/pages/user-setting/setting-team/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down