ryoji-s 2 лет назад
Родитель
Сommit
4ee54c03c6

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

@@ -736,7 +736,6 @@
       "cannot_remove": "You cannot remove yourself from administrator",
       "give_admin_access": "Give admin access",
       "remove_read_only_access": "Remove read only access",
-      "cannot_give_read_only": "You cannot give read only flag to administrator",
       "give_read_only_access": "Give read only access",
       "send_invitation_email": "Send invitation email",
       "resend_invitation_email": "Resend invitation email"

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

@@ -744,7 +744,6 @@
       "cannot_remove": "自分自身を管理者から外すことはできません",
       "give_admin_access": "管理者にする",
       "remove_read_only_access": "閲覧ユーザーから外す",
-      "cannot_give_read_only": "管理者を閲覧ユーザーにすることはできません",
       "give_read_only_access": "閲覧ユーザーにする",
       "send_invitation_email": "招待メールの送信",
       "resend_invitation_email": "招待メールの再送信"

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

@@ -744,7 +744,6 @@
       "cannot_remove": "您不能从管理员中删除自己",
       "give_admin_access": "授予管理员访问权限",
       "remove_read_only_access": "删除一个用户作为浏览用户",
-      "cannot_give_read_only": "管理员不能成为浏览用户",
       "give_read_only_access": "使一个用户成为阅读用户",
       "send_invitation_email": "发送邀请邮件",
       "resend_invitation_email": "重发邀请函"

+ 5 - 19
apps/app/src/components/Admin/Users/GiveReadOnlyButton.tsx

@@ -8,18 +8,6 @@ import { toastSuccess, toastError } from '~/client/util/toastr';
 
 import { withUnstatedContainers } from '../../UnstatedUtils';
 
-const GiveReadOnlyAlert = React.memo((): JSX.Element => {
-  const { t } = useTranslation('admin');
-
-  return (
-    <div className="px-4">
-      <i className="icon-fw icon-user-unfollow mb-2"></i>{t('user_management.user_table.remove_read_only_access')}
-      <p className="alert alert-danger">{t('user_management.user_table.cannot_give_read_only')}</p>
-    </div>
-  );
-});
-GiveReadOnlyAlert.displayName = 'GiveReadOnlyAlert';
-
 const GiveReadOnlyButton: React.FC<{
   adminUsersContainer: AdminUsersContainer,
   user: IUserHasId,
@@ -36,13 +24,11 @@ const GiveReadOnlyButton: React.FC<{
     }
   }, [adminUsersContainer, t, user._id]);
 
-  return user.admin
-    ? <GiveReadOnlyAlert />
-    : (
-      <button className="dropdown-item" type="button" onClick={onClickGiveReadOnlyBtnHandler}>
-        <i className="icon-fw icon-user-following"></i> {t('user_management.user_table.give_read_only_access')}
-      </button>
-    );
+  return (
+    <button className="dropdown-item" type="button" onClick={onClickGiveReadOnlyBtnHandler}>
+      <i className="icon-fw icon-user-following"></i> {t('user_management.user_table.give_read_only_access')}
+    </button>
+  );
 };
 
 /**