Parcourir la source

feat: Add 'deleted_user' label to user management localization and update UserTable to display it

Shun Miyazawa il y a 1 semaine
Parent
commit
8c62db9df5

+ 2 - 1
apps/app/public/static/locales/en_US/admin.json

@@ -781,7 +781,8 @@
       "revoke_read_only_access": "Revoke read only access",
       "grant_read_only_access": "Grant read only access",
       "send_invitation_email": "Send invitation email",
-      "resend_invitation_email": "Resend invitation email"
+      "resend_invitation_email": "Resend invitation email",
+      "deleted_user": "(Deleted User)"
     },
     "reset_password": "Reset Password",
     "reset_password_modal": {

+ 2 - 1
apps/app/public/static/locales/fr_FR/admin.json

@@ -781,7 +781,8 @@
       "revoke_read_only_access": "Révoquer permission de lecture",
       "grant_read_only_access": "Permission de lecture-seule",
       "send_invitation_email": "Envoyer courriel d'invitation",
-      "resend_invitation_email": "Renvoyer courriel d'invitation"
+      "resend_invitation_email": "Renvoyer courriel d'invitation",
+      "deleted_user": "(Utilisateur supprimé)"
     },
     "reset_password": "Réinitialiser mot de passe",
     "reset_password_modal": {

+ 2 - 1
apps/app/public/static/locales/ja_JP/admin.json

@@ -790,7 +790,8 @@
       "revoke_read_only_access": "閲覧のみアクセス権を外す",
       "grant_read_only_access": "閲覧のみアクセス権を付与する",
       "send_invitation_email": "招待メールの送信",
-      "resend_invitation_email": "招待メールの再送信"
+      "resend_invitation_email": "招待メールの再送信",
+      "deleted_user": "(削除されたユーザー)"
     },
     "reset_password": "パスワードのリセット",
     "reset_password_modal": {

+ 2 - 1
apps/app/public/static/locales/ko_KR/admin.json

@@ -781,7 +781,8 @@
       "revoke_read_only_access": "읽기 전용 권한 취소",
       "grant_read_only_access": "읽기 전용 권한 부여",
       "send_invitation_email": "초대 이메일 전송",
-      "resend_invitation_email": "초대 이메일 재전송"
+      "resend_invitation_email": "초대 이메일 재전송",
+      "deleted_user": "(삭제된 사용자)"
     },
     "reset_password": "비밀번호 재설정",
     "reset_password_modal": {

+ 2 - 1
apps/app/public/static/locales/zh_CN/admin.json

@@ -790,7 +790,8 @@
       "revoke_read_only_access": "取消只读访问",
       "grant_read_only_access": "给予只读权限",
       "send_invitation_email": "发送邀请邮件",
-      "resend_invitation_email": "重发邀请函"
+      "resend_invitation_email": "重发邀请函",
+      "deleted_user": "(已删除的用户)"
     },
     "reset_password": "重置密码",
     "reset_password_modal": {

+ 8 - 1
apps/app/src/client/components/Admin/Users/UserTable.tsx

@@ -5,6 +5,7 @@ import { format as dateFnsFormat } from 'date-fns/format';
 import { useTranslation } from 'next-i18next';
 
 import AdminUsersContainer from '~/client/services/AdminUsersContainer';
+import { UserStatus } from '~/server/models/user/conts';
 
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { SortIcons } from './SortIcons';
@@ -164,7 +165,13 @@ const UserTable = (props: UserTableProps) => {
                   )}
                 </td>
                 <td>
-                  <strong>{user.username}</strong>
+                  {user.status === UserStatus.STATUS_DELETED ? (
+                    <p className="text-secondary">
+                      {t('admin:user_management.user_table.deleted_user')}
+                    </p>
+                  ) : (
+                    <strong>{user.username}</strong>
+                  )}
                 </td>
                 <td>{user.name}</td>
                 <td>{user.email}</td>