Skip to content

Commit

Permalink
Merge branch 'inveniosoftware:master' into czech-vocabulary-translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mesemus authored Oct 18, 2024
2 parents a34dd6a + aa67a1a commit ca63cfb
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion invenio_rdm_records/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from .ext import InvenioRDMRecords

__version__ = "15.3.0"
__version__ = "15.4.0"

__all__ = ("__version__", "InvenioRDMRecords")
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -43,18 +43,23 @@ 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, {
record: record,
isInitialSubmission: isInitialSubmission,
}),
};

return (
<OverridableContext.Provider value={overriddenComponents}>
<ReactSearchKit
Expand All @@ -75,7 +80,7 @@ export class CommunitySelectionSearch extends Component {
floated="left"
className="pt-0 pl-0"
>
<Menu role="tablist" compact>
<Menu role="tablist" className="theme-primary-menu" compact>
<Menu.Item
as="button"
role="tab"
Expand Down Expand Up @@ -144,9 +149,11 @@ export class CommunitySelectionSearch extends Component {
</ResultsLoader>
</Modal.Content>

<Modal.Content className="text-align-center">
<Pagination />
</Modal.Content>
{pagination && (
<Modal.Content className="text-align-center">
<Pagination />
</Modal.Content>
)}
</>
</ReactSearchKit>
</OverridableContext.Provider>
Expand All @@ -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" },
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -9,4 +9,6 @@ export {
CommunitySelectionModalComponent,
} from "./CommunitySelectionModal";

export { CommunitySelectionSearch } from "./CommunitySelectionSearch";

export { CommunityContext } from "./CommunityContext";
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,6 +8,7 @@
export {
CommunitySelectionModal,
CommunitySelectionModalComponent,
CommunitySelectionSearch,
} from "./CommunitySelectionModal";
export { DepositStatusBox } from "./DepositStatus";
export { RDMUploadProgressNotifier } from "./UploadProgressNotifier";
Expand Down
2 changes: 1 addition & 1 deletion invenio_rdm_records/services/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ca63cfb

Please sign in to comment.