Browse Source

fix user

Signed-off-by: nameczz <zizhao.chen@zilliz.com>
nameczz 3 years ago
parent
commit
4c7af29870

+ 4 - 1
client/src/i18n/cn/user.ts

@@ -1,5 +1,6 @@
 const userTrans = {
 const userTrans = {
-  createTitle: 'Create user',
+  createTitle: 'Create User',
+  updateTitle: 'Update User',
   user: 'User',
   user: 'User',
   deleteWarning: 'You are trying to delete user. This action cannot be undone.',
   deleteWarning: 'You are trying to delete user. This action cannot be undone.',
   oldPassword: 'Current Password',
   oldPassword: 'Current Password',
@@ -7,6 +8,8 @@ const userTrans = {
   confirmPassword: 'Confirm Password',
   confirmPassword: 'Confirm Password',
   update: 'Update password',
   update: 'Update password',
   isNotSame: 'Confirm password is not same as new password',
   isNotSame: 'Confirm password is not same as new password',
+  deleteTip:
+    'Please select at least one item to delete and root can not be deleted.',
 };
 };
 
 
 export default userTrans;
 export default userTrans;

+ 4 - 1
client/src/i18n/en/user.ts

@@ -1,5 +1,6 @@
 const userTrans = {
 const userTrans = {
-  createTitle: 'Create user',
+  createTitle: 'Create User',
+  updateTitle: 'Update User',
   user: 'User',
   user: 'User',
   deleteWarning: 'You are trying to delete user. This action cannot be undone.',
   deleteWarning: 'You are trying to delete user. This action cannot be undone.',
   oldPassword: 'Current Password',
   oldPassword: 'Current Password',
@@ -7,6 +8,8 @@ const userTrans = {
   confirmPassword: 'Confirm Password',
   confirmPassword: 'Confirm Password',
   update: 'Update password',
   update: 'Update password',
   isNotSame: 'Not same as new password',
   isNotSame: 'Not same as new password',
+  deleteTip:
+    'Please select at least one item to delete and root can not be deleted.',
 };
 };
 
 
 export default userTrans;
 export default userTrans;

+ 1 - 1
client/src/pages/user/Update.tsx

@@ -116,7 +116,7 @@ const UpdateUser: FC<UpdateUserProps> = ({
 
 
   return (
   return (
     <DialogTemplate
     <DialogTemplate
-      title={userTrans('createTitle')}
+      title={userTrans('updateTitle')}
       handleClose={handleClose}
       handleClose={handleClose}
       confirmLabel={btnTrans('create')}
       confirmLabel={btnTrans('create')}
       handleConfirm={handleUpdateUser}
       handleConfirm={handleUpdateUser}

+ 5 - 0
client/src/pages/user/User.tsx

@@ -115,6 +115,11 @@ const Users = () => {
         });
         });
       },
       },
       label: '',
       label: '',
+      disabled: () =>
+        selectedUser.length === 0 ||
+        selectedUser.findIndex(v => v.name === 'root') > -1,
+      disabledTooltip: userTrans('deleteTip'),
+
       icon: 'delete',
       icon: 'delete',
     },
     },
   ];
   ];