From a6d81e2e30bc61c789be5709f322257993776c94 Mon Sep 17 00:00:00 2001 From: Anika Churilova Date: Tue, 16 Apr 2024 15:43:00 +0200 Subject: [PATCH] invitations: rework for the groups invitations * deprecate COMMUNITIES_GROUPS_ENABLED (moved to USERS_RESOURCES_GROUPS_ENABLED) * closes https://github.com/inveniosoftware/invenio-app-rdm/issues/2592 --- .../js/invenio_communities/api/index.js | 2 ++ .../components/SearchWithRoleSelection.js | 22 ++++++++++----- .../invitations/InvitationsEmptyResults.js | 6 ++-- .../InvitationsResultsContainer.js | 6 ++-- .../invitations/InvitationsSearchLayout.js | 16 ++++------- .../members/invitations/index.js | 8 +++--- .../invitationsModal/GroupTabPane.js | 15 +++++----- .../InvitationsMembersModal.js | 12 ++++++-- .../invitationsModal/MemberSearchBar.js | 2 +- .../manager_view/ManagerEmptyResults.js | 6 ++-- .../manager_view/ManagerMemberBulkActions.js | 2 +- .../ManagerMembersResultContainer.js | 6 ++-- .../manager_view/ManagerSearchLayout.js | 16 ++++------- .../members/members/manager_view/index.js | 8 +++--- invenio_communities/config.py | 2 ++ invenio_communities/generators.py | 28 +------------------ invenio_communities/permissions.py | 2 +- .../details/members/invitations.html | 2 +- .../details/members/members.html | 2 +- tests/members/test_members_no_groups.py | 6 ++-- 20 files changed, 74 insertions(+), 95 deletions(-) diff --git a/invenio_communities/assets/semantic-ui/js/invenio_communities/api/index.js b/invenio_communities/assets/semantic-ui/js/invenio_communities/api/index.js index bcefd7f40..ac5ecb095 100644 --- a/invenio_communities/assets/semantic-ui/js/invenio_communities/api/index.js +++ b/invenio_communities/assets/semantic-ui/js/invenio_communities/api/index.js @@ -7,3 +7,5 @@ export { CommunityInvitationsApi } from "./invitations/api"; export { CommunityApi } from "./CommunityApi"; export { CommunityMembersApi } from "./members/api"; +export { GroupsApi } from "./GroupsApi"; +export { UsersApi } from "./UsersApi"; diff --git a/invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/SearchWithRoleSelection.js b/invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/SearchWithRoleSelection.js index c2c7af005..9de152fde 100644 --- a/invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/SearchWithRoleSelection.js +++ b/invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/SearchWithRoleSelection.js @@ -13,14 +13,12 @@ import PropTypes from "prop-types"; import React, { Component } from "react"; import { Trans } from "react-i18next"; import { Button, Form, Modal } from "semantic-ui-react"; -import { UsersApi } from "../../api/UsersApi"; import { MembersSearchBar } from "../invitations/invitationsModal/MemberSearchBar"; import { SelectedMembers } from "./bulk_actions/SelectedMembers"; export class SearchWithRoleSelection extends Component { constructor(props) { super(props); - this.usersApi = new UsersApi(); this.state = { role: undefined, selected: {}, @@ -69,6 +67,10 @@ export class SearchWithRoleSelection extends Component { messageComponent, existingEntities, existingEntitiesDescription, + fetchMembers, + searchType, + searchBarPlaceholder, + doneButtonTipType, } = this.props; const { selected, loading, error } = this.state; const selectedCount = Object.keys(selected).length; @@ -88,11 +90,11 @@ export class SearchWithRoleSelection extends Component { @@ -102,7 +104,7 @@ export class SearchWithRoleSelection extends Component { onOptionChangeCallback={this.handleRoleUpdate} checked={false} /> - {messageComponent} + {searchType !== "group" && {messageComponent}} @@ -117,7 +119,7 @@ export class SearchWithRoleSelection extends Component { /> {selectedCount > 0 && ( - {doneButtonTip} {{ selectedCount }} users + {doneButtonTip} {{ selectedCount }} {doneButtonTipType} )}