From 06800d4b997999eff4bf686f3de1cca7b6eb4b92 Mon Sep 17 00:00:00 2001 From: Javier Romero Castro Date: Fri, 8 Sep 2023 10:18:32 +0200 Subject: [PATCH] service: prevent creating a request if invalid restrictions * Community selection modal checks if the community is restricted and disables it if the record is public * closes https://github.com/inveniosoftware/invenio-app-rdm/issues/2384 --- .../CommunityHeader/CommunityHeader.js | 3 ++ .../CommunityListItem.js | 40 ++++++++++++++----- .../CommunitySelectionModal.js | 4 +- .../CommunitySelectionSearch.js | 8 +++- .../SubmitReviewOrPublishButton.js | 3 ++ .../requests/community_inclusion.py | 4 +- .../requests/community_submission.py | 6 +++ .../services/communities/service.py | 1 + .../services/community_inclusion/service.py | 5 --- 9 files changed, 53 insertions(+), 21 deletions(-) diff --git a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunityHeader/CommunityHeader.js b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunityHeader/CommunityHeader.js index 6dc9f0a0cd..7b863e294e 100644 --- a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunityHeader/CommunityHeader.js +++ b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunityHeader/CommunityHeader.js @@ -30,6 +30,7 @@ class CommunityHeaderComponent extends Component { showCommunitySelectionButton, disableCommunitySelectionButton, showCommunityHeader, + record, } = this.props; const { modalOpen } = this.state; @@ -73,6 +74,7 @@ class CommunityHeaderComponent extends Component { modalOpen={modalOpen} chosenCommunity={community} displaySelected + record={record} trigger={