From e28449b0b5e2f9d1ddfe92331a072c1e4d5ab180 Mon Sep 17 00:00:00 2001 From: Fatimah Zulfiqar Date: Wed, 16 Oct 2024 15:32:26 +0200 Subject: [PATCH 1/3] community: added props to make CommunitySelectionSearch reusable --- .../CommunitySelectionSearch.js | 19 +++++++++++++++---- .../CommunitySelectionModal/index.js | 2 ++ .../src/deposit/components/index.js | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js index 93797c2e6..9ff403ebd 100644 --- a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js +++ b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js @@ -43,11 +43,15 @@ export class CommunitySelectionSearch extends Component { toggleText, }, } = this.state; + const { apiConfigs: { allCommunities, myCommunities }, record, isInitialSubmission, + CommunityListItem, + pagination, } = this.props; + const searchApi = new InvenioSearchApi(selectedSearchApi); const overriddenComponents = { [`${selectedAppId}.ResultsList.item`]: parametrize(CommunityListItem, { @@ -55,6 +59,7 @@ export class CommunitySelectionSearch extends Component { isInitialSubmission: isInitialSubmission, }), }; + return ( - + - - - + {pagination && ( + + + + )} @@ -169,10 +176,14 @@ CommunitySelectionSearch.propTypes = { }), record: PropTypes.object.isRequired, isInitialSubmission: PropTypes.bool, + CommunityListItem: PropTypes.elementType, + pagination: PropTypes.bool, }; CommunitySelectionSearch.defaultProps = { isInitialSubmission: true, + pagination: true, + CommunityListItem: CommunityListItem, apiConfigs: { allCommunities: { initialQueryState: { size: 5, page: 1, sortBy: "bestmatch" }, diff --git a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js index a473e8e66..98f9edd29 100644 --- a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js +++ b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js @@ -9,4 +9,6 @@ export { CommunitySelectionModalComponent, } from "./CommunitySelectionModal"; +export { CommunitySelectionSearch } from "./CommunitySelectionSearch"; + export { CommunityContext } from "./CommunityContext"; diff --git a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js index 52d27ef3a..2dbb86ca0 100644 --- a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js +++ b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js @@ -8,6 +8,7 @@ export { CommunitySelectionModal, CommunitySelectionModalComponent, + CommunitySelectionSearch, } from "./CommunitySelectionModal"; export { DepositStatusBox } from "./DepositStatus"; export { RDMUploadProgressNotifier } from "./UploadProgressNotifier"; From 2c861decf3560f3e75d16709a3c8024c6928a403 Mon Sep 17 00:00:00 2001 From: Nicola Tarocco Date: Fri, 11 Oct 2024 22:38:56 +0200 Subject: [PATCH 2/3] DOI: fix wrong parent DOI link --- invenio_rdm_records/services/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invenio_rdm_records/services/config.py b/invenio_rdm_records/services/config.py index 7a9768c37..5c4e796ca 100644 --- a/invenio_rdm_records/services/config.py +++ b/invenio_rdm_records/services/config.py @@ -381,7 +381,7 @@ def expand(self, obj, context): when=is_record_or_draft_and_has_parent_doi, ), else_=RecordPIDLink( - "https://doi.org/{+pid_doi}", when=is_record_or_draft_and_has_parent_doi + "https://doi.org/{+parent_pid_doi}", when=is_record_or_draft_and_has_parent_doi ), ) parent_doi_html_link = RecordPIDLink( From aa67a1a9c6247dc0a0c63f1fe0b79acb63958d58 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Thu, 17 Oct 2024 17:53:28 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=A6=20release:=20v15.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.rst | 5 +++++ invenio_rdm_records/__init__.py | 2 +- .../CommunitySelectionModal/CommunitySelectionSearch.js | 2 +- .../src/deposit/components/CommunitySelectionModal/index.js | 2 +- .../js/invenio_rdm_records/src/deposit/components/index.js | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 166b26690..d84c1d41d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,6 +12,11 @@ Changes ======= +Version v15.4.0 (released 2024-10-17) + +- DOI: fix wrong parent DOI link +- community: added props to make CommunitySelectionSearch reusable + Version v15.3.0 (released 2024-10-16) - collections: display pages and REST API diff --git a/invenio_rdm_records/__init__.py b/invenio_rdm_records/__init__.py index 5999b7031..4b62fad62 100644 --- a/invenio_rdm_records/__init__.py +++ b/invenio_rdm_records/__init__.py @@ -11,6 +11,6 @@ from .ext import InvenioRDMRecords -__version__ = "15.3.0" +__version__ = "15.4.0" __all__ = ("__version__", "InvenioRDMRecords") diff --git a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js index 9ff403ebd..c7721d3a6 100644 --- a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js +++ b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/CommunitySelectionSearch.js @@ -1,5 +1,5 @@ // This file is part of Invenio-RDM-Records -// Copyright (C) 2020-2023 CERN. +// Copyright (C) 2020-2024 CERN. // Copyright (C) 2020-2022 Northwestern University. // // Invenio-RDM-Records is free software; you can redistribute it and/or modify it diff --git a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js index 98f9edd29..2884158c4 100644 --- a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js +++ b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/CommunitySelectionModal/index.js @@ -1,5 +1,5 @@ // This file is part of Invenio-RDM-Records -// Copyright (C) 2020-2023 CERN. +// Copyright (C) 2020-2024 CERN. // // Invenio-RDM-Records is free software; you can redistribute it and/or modify it // under the terms of the MIT License; see LICENSE file for more details. diff --git a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js index 2dbb86ca0..4b4ca8521 100644 --- a/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js +++ b/invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/components/index.js @@ -1,5 +1,5 @@ // This file is part of Invenio-RDM-Records -// Copyright (C) 2020-2023 CERN. +// Copyright (C) 2020-2024 CERN. // Copyright (C) 2020-2022 Northwestern University. // // Invenio-RDM-Records is free software; you can redistribute it and/or modify it