فهرست منبع

Revert "always show the Create Group button"

This reverts commit 4406af61c38a91d33178b15dc29da4537f0eefb2.
Shun Miyazawa 4 سال پیش
والد
کامیت
313e6b60ee
1فایلهای تغییر یافته به همراه21 افزوده شده و 24 حذف شده
  1. 21 24
      packages/app/src/components/Admin/UserGroup/UserGroupPage.tsx

+ 21 - 24
packages/app/src/components/Admin/UserGroup/UserGroupPage.tsx

@@ -104,6 +104,10 @@ const UserGroupPage: FC<Props> = (props: Props) => {
     }
   }, [mutateUserGroups, mutateUserGroupRelations]);
 
+  if (userGroups == null || userGroupRelations == null || childUserGroups == null) {
+    return <></>;
+  }
+
   return (
     <Fragment>
       {
@@ -125,30 +129,23 @@ const UserGroupPage: FC<Props> = (props: Props) => {
           t('admin:user_group_management.deny_create_group')
         )
       }
-
-      {
-        (userGroups != null && userGroupRelations != null && childUserGroups != null) && (
-          <>
-            <UserGroupTable
-              appContainer={props.appContainer}
-              userGroups={userGroups}
-              childUserGroups={childUserGroups}
-              isAclEnabled={isAclEnabled}
-              onDelete={showDeleteModal}
-              userGroupRelations={userGroupRelations}
-            />
-            <UserGroupDeleteModal
-              appContainer={props.appContainer}
-              userGroups={userGroups}
-              deleteUserGroup={selectedUserGroup}
-              onDelete={deleteUserGroupById}
-              isShow={isDeleteModalShown}
-              onShow={showDeleteModal}
-              onHide={hideDeleteModal}
-            />
-          </>
-        )
-      }
+      <UserGroupTable
+        appContainer={props.appContainer}
+        userGroups={userGroups}
+        childUserGroups={childUserGroups}
+        isAclEnabled={isAclEnabled}
+        onDelete={showDeleteModal}
+        userGroupRelations={userGroupRelations}
+      />
+      <UserGroupDeleteModal
+        appContainer={props.appContainer}
+        userGroups={userGroups}
+        deleteUserGroup={selectedUserGroup}
+        onDelete={deleteUserGroupById}
+        isShow={isDeleteModalShown}
+        onShow={showDeleteModal}
+        onHide={hideDeleteModal}
+      />
     </Fragment>
   );
 };