From eb87a813813caf965c6e2f11aeba0b9415e91f7b Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Fri, 15 Nov 2024 21:18:35 +0100 Subject: [PATCH 01/28] config: removed unecessary INDEXER_DEFAULT_INDEX --- invenio_app_rdm/config.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/invenio_app_rdm/config.py b/invenio_app_rdm/config.py index 64b9be7e7..dd6dae132 100644 --- a/invenio_app_rdm/config.py +++ b/invenio_app_rdm/config.py @@ -708,15 +708,6 @@ def files_rest_permission_factory(obj, action): SEARCH_HOSTS = [{"host": "localhost", "port": 9200}] """Search hosts.""" -# Invenio-Indexer -# =============== -# See https://invenio-indexer.readthedocs.io/en/latest/configuration.html - -# We want that indexers are always explicit about the index they are indexing to. -# NOTE: Can be removed when https://github.com/inveniosoftware/invenio-indexer/pull/158 is merged and released. -INDEXER_DEFAULT_INDEX = None -"""Default index to use if no schema is defined.""" - # Invenio-Base # ============ # See https://invenio-base.readthedocs.io/en/latest/api.html#invenio_base.wsgi.wsgi_proxyfix # noqa From a4a7240114825386de6a9ec02d5febdfc92d3014 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Fri, 15 Nov 2024 21:19:02 +0100 Subject: [PATCH 02/28] upgrades: remove record JSONSchema version bump --- invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py b/invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py index f838c4111..739173431 100644 --- a/invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py +++ b/invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py @@ -19,6 +19,7 @@ - record - internal_notes """ + import sys from click import secho @@ -42,10 +43,7 @@ def update_record(record): try: secho(f"Updating record : {record.pid.pid_value}", fg="yellow") - # otherwise the save would not work, due to new attributes - # (media_files, parent_doi) used - record["$schema"] = "local://records/record-v7.0.0.json" - + # TODO: Add any record datamodel migration code here record.commit() secho(f"> Updated parent: {record.parent.pid.pid_value}", fg="green") From 9d733c9b63e76efdd6e715ff49b518015ad29e06 Mon Sep 17 00:00:00 2001 From: Saksham Date: Fri, 15 Nov 2024 11:18:29 +0100 Subject: [PATCH 03/28] semantic-ui: users: header: Use endpoints from config --- .../templates/semantic-ui/invenio_app_rdm/users/header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html b/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html index f220faf6a..74fe9a725 100644 --- a/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html +++ b/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html @@ -23,14 +23,14 @@

{{ current_u {% if active_dashboard_menu_item == "uploads" %} - + {{ _('New upload') }} {% endif %} {% if active_dashboard_menu_item == "communities" %} - + {{ _('New community') }} From 85ac8ccb0b87d4f08ca81f6b335cb384a0e76868 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Mon, 18 Nov 2024 21:58:10 +0100 Subject: [PATCH 04/28] records-ui: fix removing community branding * Closes #2869. * Passes "null" instead of empty string ("") as the "default" field value when removing community branding from a record. --- .../ManageDefaultBrandingAction/ManageDefaultBrandingAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageDefaultBrandingAction/ManageDefaultBrandingAction.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageDefaultBrandingAction/ManageDefaultBrandingAction.js index 2e880c34d..1a16f5585 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageDefaultBrandingAction/ManageDefaultBrandingAction.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageDefaultBrandingAction/ManageDefaultBrandingAction.js @@ -61,7 +61,7 @@ export class ManageDefaultBrandingAction extends Component { labelPosition="left" icon="paint brush" floated="right" - onClick={() => this.handleSetBranding("")} + onClick={() => this.handleSetBranding(null)} content={i18next.t("Remove branding")} aria-label={i18next.t( "{{communityTitle}} is a default branding for this record", From f96a44333bfb123e5983f1606d8e5513a19c53ec Mon Sep 17 00:00:00 2001 From: Tom Morrell Date: Wed, 20 Nov 2024 09:36:08 -0800 Subject: [PATCH 05/28] package: remove unused AUTHORS.rst (#2735) --- AUTHORS.rst | 11 ----------- docs/authors.rst | 9 --------- 2 files changed, 20 deletions(-) delete mode 100644 AUTHORS.rst delete mode 100644 docs/authors.rst diff --git a/AUTHORS.rst b/AUTHORS.rst deleted file mode 100644 index 70b7970f3..000000000 --- a/AUTHORS.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. - Copyright (C) 2019 CERN. - Copyright (C) 2019 Northwestern University. - - Invenio App RDM is free software; you can redistribute it and/or modify - it under the terms of the MIT License; see LICENSE file for more details. - -Authors -======= - -- CERN diff --git a/docs/authors.rst b/docs/authors.rst deleted file mode 100644 index a0863bcd9..000000000 --- a/docs/authors.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. - Copyright (C) 2019 CERN. - Copyright (C) 2019 Northwestern University. - - Invenio App RDM is free software; you can redistribute it and/or modify - it under the terms of the MIT License; see LICENSE file for more details. - - -.. include:: ../AUTHORS.rst From 9d9664d477729e5bd730c53f813b492711743b4f Mon Sep 17 00:00:00 2001 From: Pablo Tamarit Date: Thu, 21 Nov 2024 15:05:37 +0100 Subject: [PATCH 06/28] fix: ui: escape journal title once --- .../js/invenio_app_rdm/components/RecordsResultsListItem.js | 2 +- .../user_dashboard/uploads_items/ComputerTabletUploadsItem.js | 2 +- .../user_dashboard/uploads_items/MobileUploadsItem.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordsResultsListItem.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordsResultsListItem.js index c2dcf2692..d3710d396 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordsResultsListItem.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordsResultsListItem.js @@ -132,7 +132,7 @@ class RecordsResultsListItem extends Component { {publishingInformation && ( <> - {i18next.t("Published in: {{publishInfo}}", { + {i18next.t("Published in: {{- publishInfo }}", { publishInfo: publishingInformation, })} diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/ComputerTabletUploadsItem.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/ComputerTabletUploadsItem.js index 2e70f94c4..e26544bfd 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/ComputerTabletUploadsItem.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/ComputerTabletUploadsItem.js @@ -125,7 +125,7 @@ export const ComputerTabletUploadsItem = ({ {" "} |{" "} - {i18next.t("Published in: {{publishInfo}}", { + {i18next.t("Published in: {{- publishInfo }}", { publishInfo: publishingInformation, })} diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/MobileUploadsItem.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/MobileUploadsItem.js index 0b1b5d4c7..86b160ba8 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/MobileUploadsItem.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads_items/MobileUploadsItem.js @@ -102,7 +102,7 @@ export const MobileUploadsItem = ({ {publishingInformation && ( - {i18next.t("Published in: {{publishedIn}}", { + {i18next.t("Published in: {{- publishedIn }}", { publishedIn: publishingInformation, })} From fbe030e3a4fd53e1d11d4fffac6fce4652f96c70 Mon Sep 17 00:00:00 2001 From: Saksham Date: Fri, 22 Nov 2024 14:33:20 +0100 Subject: [PATCH 07/28] semantic-ui: users: header: Pass entrypoint namespace in url_for --- .../templates/semantic-ui/invenio_app_rdm/users/header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html b/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html index 74fe9a725..6ed2c008b 100644 --- a/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html +++ b/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html @@ -23,14 +23,14 @@

{{ current_u {% if active_dashboard_menu_item == "uploads" %} - + {{ _('New upload') }} {% endif %} {% if active_dashboard_menu_item == "communities" %} - + {{ _('New community') }} From 633ac130bc57886fb09e5a16fed028860bc4131f Mon Sep 17 00:00:00 2001 From: Saksham Date: Fri, 22 Nov 2024 16:37:59 +0100 Subject: [PATCH 08/28] communities_ui: views: Add RecordPermissionDeniedError Handler --- invenio_app_rdm/communities_ui/views/ui.py | 53 +++++----------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/invenio_app_rdm/communities_ui/views/ui.py b/invenio_app_rdm/communities_ui/views/ui.py index f795f8b33..08b5458c6 100644 --- a/invenio_app_rdm/communities_ui/views/ui.py +++ b/invenio_app_rdm/communities_ui/views/ui.py @@ -15,10 +15,18 @@ UICommunityJSONSerializer, ) from invenio_communities.errors import CommunityDeletedError +from invenio_communities.views.ui import ( + not_found_error, + record_permission_denied_error, + record_tombstone_error, +) from invenio_i18n import lazy_gettext as _ from invenio_pidstore.errors import PIDDeletedError, PIDDoesNotExistError from invenio_rdm_records.collections import search_app_context as c_search_app_context -from invenio_records_resources.services.errors import PermissionDeniedError +from invenio_records_resources.services.errors import ( + PermissionDeniedError, + RecordPermissionDeniedError, +) from ..searchapp import search_app_context from .communities import ( @@ -30,46 +38,6 @@ ) -# -# Error handlers -# -def not_found_error(error): - """Handler for 'Not Found' errors.""" - return render_template(current_app.config["THEME_404_TEMPLATE"]), 404 - - -def record_tombstone_error(error): - """Tombstone page.""" - # the RecordDeletedError will have the following properties, - # while the PIDDeletedError won't - record = getattr(error, "record", None) - if (record_ui := getattr(error, "result_item", None)) is not None: - if record is None: - record = record_ui._record - record_ui = UICommunityJSONSerializer().dump_obj(record_ui.to_dict()) - - # render a 404 page if the tombstone isn't visible - if not record.tombstone.is_visible: - return not_found_error(error) - - # we only render a tombstone page if there is a record with a visible tombstone - return ( - render_template( - "invenio_communities/tombstone.html", - record=record_ui, - ), - 410, - ) - - -def record_permission_denied_error(error): - """Handle permission denier error on record views.""" - if not current_user.is_authenticated: - # trigger the flask-login unauthorized handler - return current_app.login_manager.unauthorized() - return render_template(current_app.config["THEME_403_TEMPLATE"]), 403 - - def _show_browse_page(): """Whether the browse page should be visible in the menu.""" return ( @@ -118,6 +86,9 @@ def create_ui_blueprint(app): blueprint.register_error_handler( PermissionDeniedError, record_permission_denied_error ) + blueprint.register_error_handler( + RecordPermissionDeniedError, record_permission_denied_error + ) blueprint.register_error_handler(PIDDeletedError, record_tombstone_error) blueprint.register_error_handler(CommunityDeletedError, record_tombstone_error) blueprint.register_error_handler(PIDDoesNotExistError, not_found_error) From ab81bd40c6b38d3148529e9313fb73096fad62a7 Mon Sep 17 00:00:00 2001 From: Zacharias Zacharodimos Date: Mon, 25 Nov 2024 13:13:52 +0100 Subject: [PATCH 09/28] release: v13.0.0b1.dev19 --- invenio_app_rdm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invenio_app_rdm/__init__.py b/invenio_app_rdm/__init__.py index e05449036..1978757ef 100644 --- a/invenio_app_rdm/__init__.py +++ b/invenio_app_rdm/__init__.py @@ -17,6 +17,6 @@ # # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440 -__version__ = "13.0.0b1.dev18" +__version__ = "13.0.0b1.dev19" __all__ = ("__version__",) From 61f87dbcfee4542d8754cdda339fd73f3ed14cb8 Mon Sep 17 00:00:00 2001 From: Fatimah Zulfiqar Date: Mon, 25 Nov 2024 13:46:54 +0100 Subject: [PATCH 10/28] creatibutors: added config for identifiers scheme --- invenio_app_rdm/config.py | 19 +++++ .../records/macros/creatibutors.html | 79 +++++++++++-------- 2 files changed, 64 insertions(+), 34 deletions(-) diff --git a/invenio_app_rdm/config.py b/invenio_app_rdm/config.py index dd6dae132..f5a9f099f 100644 --- a/invenio_app_rdm/config.py +++ b/invenio_app_rdm/config.py @@ -994,6 +994,25 @@ def github_link_render(record): APP_RDM_ADMIN_EMAIL_RECIPIENT = "info@inveniosoftware.org" """Admin e-mail""" +APP_RDM_IDENTIFIER_SCHEMES_UI = { + "orcid": { + "url_prefix": "http://orcid.org/", + "icon": "images/orcid.svg", + "label": "ORCID", + }, + "ror": { + "url_prefix": "https://ror.org/", + "icon": "images/ror-icon.svg", + "label": "ROR", + }, + "gnd": { + "url_prefix": "http://d-nb.info/gnd/", + "icon": "images/gnd-icon.svg", + "label": "GND", + }, +} +"""Identifier Schemes UI config""" + # Invenio-Communities # =================== diff --git a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html index 6930a5025..45c034cac 100644 --- a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html +++ b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/creatibutors.html @@ -11,32 +11,33 @@ {% macro creatibutor_icon(creatibutor) %} {% set identifier_found = namespace(value=False) %} - {% for scheme, identifier in creatibutor.person_or_org.identifiers|groupby("scheme") %} - {%- if scheme == "orcid" %} - {% set identifier_found.value = True %} - - ORCID icon - - {%- elif scheme == "ror" %} - {% set identifier_found.value = True %} - - ROR icon - - {%- elif scheme == "gnd" %} - {% set identifier_found.value = True %} - - GND icon - - {%- endif %} - {% endfor %} + {% if config.APP_RDM_IDENTIFIER_SCHEMES_UI %} + {% for scheme, details in config.APP_RDM_IDENTIFIER_SCHEMES_UI.items() %} + {% for identifier in creatibutor.person_or_org.identifiers|selectattr("scheme", "equalto", scheme) %} + {% set identifier_found.value = True %} + + {{ details.label }} icon + + {% endfor %} + {% endfor %} + {% endif %} - {# if no identifiers: distinguish btw people and organizations #} - {%- if not identifier_found.value and creatibutor.person_or_org.type == 'organizational'%} - - {%- endif %} + {# Fallback for missing identifiers #} + {% if not identifier_found.value %} + {% if creatibutor.person_or_org.type == 'organizational' %} + + {% else %} + + {% endif %} + {% endif %} {% endmacro %} + {% macro show_creatibutors(creatibutors, show_affiliations=False, type="creators", show_role=False) %} {% for creatibutor in creatibutors %}
  • @@ -81,22 +82,32 @@
      - {% for affiliation in affiliations %} -
    • - {{ affiliation[0] }}. - - {% if affiliation[2] %} + {% for affiliation in affiliations %} +
    • + {{ affiliation[0] }}. + + {% if affiliation[2] %} + {% set scheme, identifier = (affiliation[2].split(':', 1) if ':' in affiliation[2] else ('ror', affiliation[2])) %} + {% set scheme_config = config.APP_RDM_IDENTIFIER_SCHEMES_UI.get(scheme) %} + + {% if scheme_config %} - ROR icon + {{ scheme_config.label }} icon - {%- endif %} - {{affiliation[1]}} -
    • + {% endif %} + {% endif %} + + {{ affiliation[1] }} + {% endfor %} +
    {% endmacro %} From 475a08888b70a24233affc13434913f776946d89 Mon Sep 17 00:00:00 2001 From: Carlin MacKenzie Date: Mon, 18 Nov 2024 11:35:57 +0100 Subject: [PATCH 11/28] requests: add subcommunity invitation request details page --- .../subcommunity-invitation/index.html | 49 +++++++++++++++++++ invenio_app_rdm/requests_ui/views/requests.py | 19 ++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/subcommunity-invitation/index.html diff --git a/invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/subcommunity-invitation/index.html b/invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/subcommunity-invitation/index.html new file mode 100644 index 000000000..501b7d52a --- /dev/null +++ b/invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/subcommunity-invitation/index.html @@ -0,0 +1,49 @@ +{# -*- coding: utf-8 -*- + + This file is part of Invenio. + Copyright (C) 2024 CERN. + + Invenio is free software; you can redistribute it and/or modify it + under the terms of the MIT License; see LICENSE file for more details. +#} + +{# + Renders the request details page when requesting a subcommunity +#} + +{% extends "invenio_requests/details/index.html" %} + +{% set active_dashboard_menu_item = 'requests' %} +{% set active_community_header_menu_item = 'requests' %} + +{%- block request_header %} + {% if permissions.can_search_requests %} + {% set back_button_url = url_for("invenio_communities.communities_requests", pid_value=community.slug) %} + {% endif %} + {% from "invenio_requests/macros/request_header.html" import inclusion_request_header %} + {{ inclusion_request_header( + request=invenio_request, + record=record, + accepted=request_is_accepted, + back_button_url=back_button_url, + back_button_text=_("Back to requests") + ) }} +{%- endblock request_header %} + +{% block request_timeline %} +
    +
    + {{ super() }} +
    + +
    +{% endblock request_timeline %} diff --git a/invenio_app_rdm/requests_ui/views/requests.py b/invenio_app_rdm/requests_ui/views/requests.py index 6f7a7daba..94ed307d6 100644 --- a/invenio_app_rdm/requests_ui/views/requests.py +++ b/invenio_app_rdm/requests_ui/views/requests.py @@ -14,7 +14,10 @@ from invenio_communities.config import COMMUNITIES_ROLES from invenio_communities.members.services.request import CommunityInvitation from invenio_communities.proxies import current_identities_cache -from invenio_communities.subcommunities.services.request import SubCommunityRequest +from invenio_communities.subcommunities.services.request import ( + SubCommunityRequest, + SubCommunityInvitationRequest, +) from invenio_communities.utils import identity_cache_key from invenio_communities.views.communities import render_community_theme_template from invenio_communities.views.decorators import pass_community @@ -242,6 +245,7 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs) is_record_inclusion = request_type == CommunityInclusion.type_id is_member_invitation = request_type == CommunityInvitation.type_id is_subcommunity_request = request_type == SubCommunityRequest.type_id + is_subcommunity_invitation_request = request_type == SubCommunityInvitationRequest.type_id request_is_accepted = request["status"] == AcceptAction.status_to permissions = community.has_permissions_to( @@ -305,3 +309,16 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs) user_avatar=avatar, include_deleted=False, ) + + elif is_subcommunity_invitation_request: + return render_community_theme_template( + f"invenio_requests/{request_type}/index.html", + theme=community.to_dict().get("theme", {}), + base_template="invenio_communities/details/base.html", + invenio_request=request.to_dict(), + community=community_ui, + permissions=permissions, + request_is_accepted=request_is_accepted, + user_avatar=avatar, + include_deleted=False, + ) From ecb42e150d590c6288377c1abc6f21f882e4a4de Mon Sep 17 00:00:00 2001 From: Carlin MacKenzie Date: Wed, 20 Nov 2024 11:00:51 +0100 Subject: [PATCH 12/28] config: add subcommunity invitation request notifications --- invenio_app_rdm/config.py | 5 +++++ invenio_app_rdm/requests_ui/views/requests.py | 21 +++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/invenio_app_rdm/config.py b/invenio_app_rdm/config.py index f5a9f099f..6c4de0adf 100644 --- a/invenio_app_rdm/config.py +++ b/invenio_app_rdm/config.py @@ -1384,6 +1384,11 @@ def github_link_render(record): community_notifications.SubCommunityCreate.type: community_notifications.SubCommunityCreate, community_notifications.SubCommunityAccept.type: community_notifications.SubCommunityAccept, community_notifications.SubCommunityDecline.type: community_notifications.SubCommunityDecline, + # Subcommunity invitation request + community_notifications.SubComInvitationCreate.type: community_notifications.SubComInvitationCreate, + community_notifications.SubComInvitationAccept.type: community_notifications.SubComInvitationAccept, + community_notifications.SubComInvitationDecline.type: community_notifications.SubComInvitationDecline, + community_notifications.SubComInvitationExpire.type: community_notifications.SubComInvitationExpire, } """Notification builders.""" diff --git a/invenio_app_rdm/requests_ui/views/requests.py b/invenio_app_rdm/requests_ui/views/requests.py index 94ed307d6..35c82843e 100644 --- a/invenio_app_rdm/requests_ui/views/requests.py +++ b/invenio_app_rdm/requests_ui/views/requests.py @@ -15,8 +15,8 @@ from invenio_communities.members.services.request import CommunityInvitation from invenio_communities.proxies import current_identities_cache from invenio_communities.subcommunities.services.request import ( - SubCommunityRequest, SubCommunityInvitationRequest, + SubCommunityRequest, ) from invenio_communities.utils import identity_cache_key from invenio_communities.views.communities import render_community_theme_template @@ -245,7 +245,9 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs) is_record_inclusion = request_type == CommunityInclusion.type_id is_member_invitation = request_type == CommunityInvitation.type_id is_subcommunity_request = request_type == SubCommunityRequest.type_id - is_subcommunity_invitation_request = request_type == SubCommunityInvitationRequest.type_id + is_subcommunity_invitation_request = ( + request_type == SubCommunityInvitationRequest.type_id + ) request_is_accepted = request["status"] == AcceptAction.status_to permissions = community.has_permissions_to( @@ -297,20 +299,7 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs) include_deleted=False, ) - elif is_subcommunity_request: - return render_community_theme_template( - f"invenio_requests/{request_type}/index.html", - theme=community.to_dict().get("theme", {}), - base_template="invenio_communities/details/base.html", - invenio_request=request.to_dict(), - community=community_ui, - permissions=permissions, - request_is_accepted=request_is_accepted, - user_avatar=avatar, - include_deleted=False, - ) - - elif is_subcommunity_invitation_request: + elif is_subcommunity_request or is_subcommunity_invitation_request: return render_community_theme_template( f"invenio_requests/{request_type}/index.html", theme=community.to_dict().get("theme", {}), From 4fb9918c210b93422613af06e2ca6a4674737bc5 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Thu, 28 Nov 2024 10:16:47 +0100 Subject: [PATCH 13/28] =?UTF-8?q?=F0=9F=93=A6=20release:=20v13.0.0b1.dev20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.rst | 6 ++++++ invenio_app_rdm/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 42068842a..1c6d8f24e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,12 @@ Changes ======= +Version v13.0.0b1.dev20 (released 2024-11-28) + +- config: add subcommunity invitation request notifications +- requests: add subcommunity invitation request details page +- creatibutors: added config for identifiers scheme + Version v13.0.0b1.dev15 (released 2024-10-18) - communities-ui: verified icon display logic change and deterministic sorting diff --git a/invenio_app_rdm/__init__.py b/invenio_app_rdm/__init__.py index 1978757ef..61d3b78a9 100644 --- a/invenio_app_rdm/__init__.py +++ b/invenio_app_rdm/__init__.py @@ -17,6 +17,6 @@ # # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440 -__version__ = "13.0.0b1.dev19" +__version__ = "13.0.0b1.dev20" __all__ = ("__version__",) From 42e46ff821976737939718713b02dbf254133ba0 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Thu, 28 Nov 2024 11:37:13 +0100 Subject: [PATCH 14/28] installation: remove "sentry_sdk" extra from invenio-logging --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2d2a43d79..4f75cee63 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,7 @@ install_requires = # Invenio base bundle invenio-assets>=3.0.0,<4.0.0 invenio-formatter>=2.0.0,<3.0.0 - invenio-logging[sentry_sdk]>=2.0.0,<3.0.0 + invenio-logging>=2.0.0,<3.0.0 invenio-mail>=2.0.0,<3.0.0 invenio-rest>=1.3.0,<2.0.0 invenio-theme>=3.0.0,<4.0.0 From 7bc5359e61d2db45e04944f58b7c2a17487269f3 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Thu, 28 Nov 2024 11:43:44 +0100 Subject: [PATCH 15/28] =?UTF-8?q?=F0=9F=93=A6=20release:=20v13.0.0b1.dev21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.rst | 4 ++++ invenio_app_rdm/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1c6d8f24e..c705293ae 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,10 @@ Changes ======= +Version v13.0.0b1.dev21 (released 2024-11-28) + +- installation: remove "sentry_sdk" extra from invenio-logging + Version v13.0.0b1.dev20 (released 2024-11-28) - config: add subcommunity invitation request notifications diff --git a/invenio_app_rdm/__init__.py b/invenio_app_rdm/__init__.py index 61d3b78a9..8eb7b851e 100644 --- a/invenio_app_rdm/__init__.py +++ b/invenio_app_rdm/__init__.py @@ -17,6 +17,6 @@ # # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440 -__version__ = "13.0.0b1.dev20" +__version__ = "13.0.0b1.dev21" __all__ = ("__version__",) From ad25d7a763e59f9f61626adcc27eff4dcb8d097f Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Thu, 28 Nov 2024 10:05:41 +0100 Subject: [PATCH 16/28] installation: bump invenio-access * This removes the invenio-admin dependency. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 4f75cee63..c2717043a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,7 +43,7 @@ install_requires = invenio-rest>=1.3.0,<2.0.0 invenio-theme>=3.0.0,<4.0.0 # Invenio auth bundle - invenio-access>=2.0.0,<3.0.0 + invenio-access>=3.0.0,<4.0.0 invenio-accounts>=5.0.0,<6.0.0 invenio-oauth2server>=2.0.0,<3.0.0 invenio-oauthclient>=4.0.0,<5.0.0 From e4a4d38f1406a5c8c58d5a46fd77a55a9b944423 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Thu, 28 Nov 2024 12:50:37 +0100 Subject: [PATCH 17/28] =?UTF-8?q?=F0=9F=93=A6=20release:=20v13.0.0b1.dev22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.rst | 5 +++++ invenio_app_rdm/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index c705293ae..aa836f2cf 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,11 @@ Changes ======= +Version v13.0.0b1.dev22 (released 2024-11-28) + +- installation: bump invenio-access + * This removes the invenio-admin dependency. + Version v13.0.0b1.dev21 (released 2024-11-28) - installation: remove "sentry_sdk" extra from invenio-logging diff --git a/invenio_app_rdm/__init__.py b/invenio_app_rdm/__init__.py index 8eb7b851e..32c1f0f32 100644 --- a/invenio_app_rdm/__init__.py +++ b/invenio_app_rdm/__init__.py @@ -17,6 +17,6 @@ # # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440 -__version__ = "13.0.0b1.dev21" +__version__ = "13.0.0b1.dev22" __all__ = ("__version__",) From b9e866fe6807bc6f7ed9ac0af3f966da400a6c82 Mon Sep 17 00:00:00 2001 From: Maximilian Moser Date: Tue, 24 Sep 2024 23:30:04 +0200 Subject: [PATCH 18/28] webpack: configure copy patterns for TinyMCE --- invenio_app_rdm/theme/webpack.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/invenio_app_rdm/theme/webpack.py b/invenio_app_rdm/theme/webpack.py index 2b4ca7406..66df3c171 100644 --- a/invenio_app_rdm/theme/webpack.py +++ b/invenio_app_rdm/theme/webpack.py @@ -72,6 +72,22 @@ "@js/invenio_app_rdm": "js/invenio_app_rdm", "@translations/invenio_app_rdm": "translations/invenio_app_rdm", }, + copy=[ + # Copy some assets into "static/dist", as TinyMCE requires that + # Note that the base path for all entries is the `config.json` directory + { + "from": "../node_modules/tinymce/skins/content/default/content.css", + "to": "../../static/dist/js/skins/content/default", + }, + { + "from": "../node_modules/tinymce/skins/ui/oxide/skin.min.css", + "to": "../../static/dist/js/skins/ui/oxide", + }, + { + "from": "../node_modules/tinymce/skins/ui/oxide/content.min.css", + "to": "../../static/dist/js/skins/ui/oxide", + }, + ], ), }, ) From 399ebb4f996fe3453907ac7cb6445ca40edc3bbc Mon Sep 17 00:00:00 2001 From: Nicola Date: Thu, 28 Nov 2024 22:23:56 +0100 Subject: [PATCH 19/28] =?UTF-8?q?=F0=9F=93=A6=20release:=20v13.0.0b1.dev23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.rst | 4 ++++ invenio_app_rdm/__init__.py | 2 +- setup.cfg | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index aa836f2cf..6dfa93dca 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,10 @@ Changes ======= +Version v13.0.0b1.dev23 (released 2024-11-28) + +- assets: use the new copy feature to copy needed TinyMCE static assets + Version v13.0.0b1.dev22 (released 2024-11-28) - installation: bump invenio-access diff --git a/invenio_app_rdm/__init__.py b/invenio_app_rdm/__init__.py index 32c1f0f32..6794af2cf 100644 --- a/invenio_app_rdm/__init__.py +++ b/invenio_app_rdm/__init__.py @@ -17,6 +17,6 @@ # # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440 -__version__ = "13.0.0b1.dev22" +__version__ = "13.0.0b1.dev23" __all__ = ("__version__",) diff --git a/setup.cfg b/setup.cfg index c2717043a..01a326d89 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,7 +36,7 @@ install_requires = invenio-i18n>=2.0.0,<3.0.0 invenio-db[postgresql,mysql]>=1.1.0,<2.0.0 # Invenio base bundle - invenio-assets>=3.0.0,<4.0.0 + invenio-assets>=3.1.0,<4.0.0 invenio-formatter>=2.0.0,<3.0.0 invenio-logging>=2.0.0,<3.0.0 invenio-mail>=2.0.0,<3.0.0 From 31262a8b970cd39a58bc907e602bec7a4237d8d6 Mon Sep 17 00:00:00 2001 From: Carlin MacKenzie Date: Tue, 3 Dec 2024 16:36:54 +0100 Subject: [PATCH 20/28] config: add subcommunity comment notifications --- invenio_app_rdm/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/invenio_app_rdm/config.py b/invenio_app_rdm/config.py index 6c4de0adf..cb6b917e8 100644 --- a/invenio_app_rdm/config.py +++ b/invenio_app_rdm/config.py @@ -1368,6 +1368,8 @@ def github_link_render(record): GrantUserAccessNotificationBuilder.type: GrantUserAccessNotificationBuilder, # Comment request event CommentRequestEventCreateNotificationBuilder.type: CommentRequestEventCreateNotificationBuilder, + community_notifications.SubComReqCommentNotificationBuilder.type: community_notifications.SubComReqCommentNotificationBuilder, + community_notifications.SubComInvCommentNotificationBuilder.type: community_notifications.SubComInvCommentNotificationBuilder, # Community inclusion CommunityInclusionAcceptNotificationBuilder.type: CommunityInclusionAcceptNotificationBuilder, CommunityInclusionCancelNotificationBuilder.type: CommunityInclusionCancelNotificationBuilder, From 7dccbcc3bafce5534ce628556119eebb2e24cb91 Mon Sep 17 00:00:00 2001 From: Pablo Tamarit Date: Mon, 9 Dec 2024 12:13:59 +0100 Subject: [PATCH 21/28] fix: meta: add missing HighWire authors --- .../semantic-ui/invenio_app_rdm/records/details/meta.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/meta.html b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/meta.html index dc086e5b9..54aa09fe7 100644 --- a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/meta.html +++ b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/meta.html @@ -1,5 +1,5 @@ {# -Copyright (C) 2020 CERN. +Copyright (C) 2020-2024 CERN. Copyright (C) 2020 Northwestern University. Copyright (C) 2021 New York University. Copyright (C) 2023 Front Matter. @@ -12,7 +12,7 @@ {%- set meta_title = record.metadata.title|striptags -%} {%- set meta_description = record.metadata.description|striptags -%} -{%- set meta_authors = record.creators|map(attribute='name') -%} +{%- set meta_authors = record.metadata.creators|map(attribute='person_or_org')|map(attribute='name') -%} {%- set files = record.files %} {{- meta_highwire(meta_title,meta_description,authors=meta_authors,publisher=meta_publisher,publication_date=record.publication_date|from_isodate,doi=record.pids.get("doi", {}).get("identifier"),keywords=record.metadata.subjects | map(attribute="subject"),url=record.links.self_html) }} From 8130283e9a97b8da32eb754bf277f0d9d3367791 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Tue, 10 Dec 2024 10:04:13 +0100 Subject: [PATCH 22/28] =?UTF-8?q?=F0=9F=93=A6=20release:=20v13.0.0b1.dev24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.rst | 5 +++++ invenio_app_rdm/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 6dfa93dca..f11fc613d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,11 @@ Changes ======= +Version v13.0.0b1.dev24 (released 2024-12-10) + +- fix: meta: add missing HighWire authors +- config: add subcommunity comment notifications + Version v13.0.0b1.dev23 (released 2024-11-28) - assets: use the new copy feature to copy needed TinyMCE static assets diff --git a/invenio_app_rdm/__init__.py b/invenio_app_rdm/__init__.py index 6794af2cf..30cd19f46 100644 --- a/invenio_app_rdm/__init__.py +++ b/invenio_app_rdm/__init__.py @@ -17,6 +17,6 @@ # # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440 -__version__ = "13.0.0b1.dev23" +__version__ = "13.0.0b1.dev24" __all__ = ("__version__",) From ecbbc0fcb0f3b64b6189da80a4f22a857c19bcd7 Mon Sep 17 00:00:00 2001 From: Anika Churilova Date: Fri, 13 Dec 2024 10:50:29 +0100 Subject: [PATCH 23/28] pages: do not create a static page if it already exists * closes https://github.com/CERNDocumentServer/cds-rdm/issues/160 --- invenio_app_rdm/fixtures/pages.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/invenio_app_rdm/fixtures/pages.py b/invenio_app_rdm/fixtures/pages.py index 67cfba06b..9789643f3 100644 --- a/invenio_app_rdm/fixtures/pages.py +++ b/invenio_app_rdm/fixtures/pages.py @@ -13,6 +13,7 @@ from invenio_access.permissions import system_identity from invenio_db import db from invenio_pages.proxies import current_pages_service +from invenio_pages.records.errors import PageNotFoundError from invenio_rdm_records.fixtures.fixture import FixtureMixin @@ -45,11 +46,15 @@ def page_data(self, page): def create(self, entry): """Load a single page.""" - data = { - "url": entry.pop("url"), - "title": entry.get("title"), - "content": self.page_data(entry.get("template")), - "description": entry.get("description"), - "template_name": current_app.config["PAGES_DEFAULT_TEMPLATE"], - } - current_pages_service.create(system_identity, data) + url = entry["url"] + try: + current_pages_service.read_by_url(system_identity, url) + except PageNotFoundError: + data = { + "url": url, + "title": entry.get("title", ""), + "content": self.page_data(entry["template"]), + "description": entry.get("description", ""), + "template_name": current_app.config["PAGES_DEFAULT_TEMPLATE"], + } + current_pages_service.create(system_identity, data) From c0c7e9dd6f9bd0973916769c5bccabf534bd2711 Mon Sep 17 00:00:00 2001 From: Anika Churilova Date: Fri, 13 Dec 2024 15:33:14 +0100 Subject: [PATCH 24/28] theme: put banner message below other objects *closes https://github.com/CERNDocumentServer/cds-rdm/issues/163 --- .../less/invenio_app_rdm/theme/collections/message.overrides | 1 + 1 file changed, 1 insertion(+) diff --git a/invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/collections/message.overrides b/invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/collections/message.overrides index dd387c13f..2b9944303 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/collections/message.overrides +++ b/invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/collections/message.overrides @@ -5,6 +5,7 @@ .ui.flashed.message, .ui.form .flashed.message { + z-index: 0; &.manage { padding: 1em 0; } From 339114db63d78c1bf5d98f6463e2e32282b8833f Mon Sep 17 00:00:00 2001 From: Anika Churilova Date: Thu, 5 Dec 2024 11:42:08 +0100 Subject: [PATCH 25/28] doi: handle UI for optional DOI feature * closes https://github.com/CERNDocumentServer/cds-rdm/issues/163 --- invenio_app_rdm/ext.py | 13 ++++ invenio_app_rdm/records_ui/views/deposits.py | 60 ++++++++++++++++--- .../invenio_app_rdm/deposit/RDMDepositForm.js | 3 +- .../js/invenio_app_rdm/deposit/index.js | 1 + 4 files changed, 67 insertions(+), 10 deletions(-) diff --git a/invenio_app_rdm/ext.py b/invenio_app_rdm/ext.py index a6c6e20de..61e949e9f 100644 --- a/invenio_app_rdm/ext.py +++ b/invenio_app_rdm/ext.py @@ -33,6 +33,19 @@ def finalize_app(app): def init_config(app): """Initialize configuration.""" + record_doi_required = ( + app.config["RDM_PERSISTENT_IDENTIFIERS"].get("doi", {}).get("required") + ) + parent_doi_required = ( + app.config["RDM_PARENT_PERSISTENT_IDENTIFIERS"].get("doi", {}).get("required") + ) + + if record_doi_required != parent_doi_required: + raise Exception( + "Config variables RDM_PERSISTENT_IDENTIFIERS.doi.required and " + "RDM_PARENT_PERSISTENT_IDENTIFIERS.doi.required must be set to the same value." + ) + if "COMMUNITIES_GROUPS_ENABLED" in app.config: warnings.warn( "COMMUNITIES_GROUPS_ENABLED config variable is deprecated. Please use USERS_RESOURCES_GROUPS_ENABLED " diff --git a/invenio_app_rdm/records_ui/views/deposits.py b/invenio_app_rdm/records_ui/views/deposits.py index d9afc7487..79793b312 100644 --- a/invenio_app_rdm/records_ui/views/deposits.py +++ b/invenio_app_rdm/records_ui/views/deposits.py @@ -60,6 +60,12 @@ def get_form_pids_config(): continue record_pid_config = current_app.config["RDM_PERSISTENT_IDENTIFIERS"] scheme_label = record_pid_config.get(scheme, {}).get("label", scheme) + is_doi_required = record_pid_config.get(scheme, {}).get("required") + default_selected = ( + record_pid_config.get(scheme, {}).get("ui", {}).get("default_selected") + ) + if is_doi_required and default_selected == "not_needed": + default_selected = "yes" pids_provider = { "scheme": scheme, "field_label": "Digital Object Identifier", @@ -82,6 +88,7 @@ def get_form_pids_config(): "A {scheme_label} allows your upload to be easily and " "unambiguously cited. Example: 10.1234/foo.bar" ).format(scheme_label=scheme_label), + "default_selected": default_selected, } pids_providers.append(pids_provider) @@ -360,7 +367,16 @@ def new_record(): record = dump_empty(RDMRecordSchema) record["files"] = {"enabled": current_app.config.get("RDM_DEFAULT_FILES_ENABLED")} if "doi" in current_rdm_records.records_service.config.pids_providers: - record["pids"] = {"doi": {"provider": "external", "identifier": ""}} + if ( + current_app.config["RDM_PERSISTENT_IDENTIFIERS"] + .get("doi", {}) + .get("ui", {}) + .get("default_selected") + == "yes" # yes, no or not_needed + ): + record["pids"] = {"doi": {"provider": "external", "identifier": ""}} + else: + record["pids"] = {} else: record["pids"] = {} record["status"] = "draft" @@ -389,6 +405,11 @@ def deposit_create(community=None): community_use_jinja_header = bool(community_theme) dashboard_routes = current_app.config["APP_RDM_USER_DASHBOARD_ROUTES"] + is_doi_required = ( + current_app.config.get("RDM_PERSISTENT_IDENTIFIERS", {}) + .get("doi", {}) + .get("required") + ) return render_community_theme_template( current_app.config["APP_RDM_DEPOSIT_FORM_TEMPLATE"], theme=community_theme, @@ -397,6 +418,7 @@ def deposit_create(community=None): createUrl="/api/records", quota=get_files_quota(), hide_community_selection=community_use_jinja_header, + is_doi_required=is_doi_required, ), searchbar_config=dict(searchUrl=get_search_url()), record=new_record(), @@ -455,17 +477,37 @@ def deposit_edit(pid_value, draft=None, draft_files=None, files_locked=True): # communities community_use_jinja_header = bool(community_theme) dashboard_routes = current_app.config["APP_RDM_USER_DASHBOARD_ROUTES"] + is_doi_required = ( + current_app.config.get("RDM_PERSISTENT_IDENTIFIERS", {}) + .get("doi", {}) + .get("required") + ) + form_config = get_form_config( + apiUrl=f"/api/records/{pid_value}/draft", + dashboard_routes=dashboard_routes, + # maybe quota should be serialized into the record e.g for admins + quota=get_files_quota(draft._record), + # hide react community component + hide_community_selection=community_use_jinja_header, + is_doi_required=is_doi_required, + ) + + if is_doi_required and not record.get("pids", {}).get("doi"): + # if the DOI is required but there is no value, we set the default selected pid + # to no i.e. system should automatically mint a local DOI + if record["status"] == "new_version_draft": + doi_provider_config = [ + pid_config + for pid_config in form_config["pids"] + if pid_config.get("scheme") == "doi" + ] + if doi_provider_config: + doi_provider_config[0]["default_selected"] = "no" + return render_community_theme_template( current_app.config["APP_RDM_DEPOSIT_FORM_TEMPLATE"], theme=community_theme, - forms_config=get_form_config( - apiUrl=f"/api/records/{pid_value}/draft", - dashboard_routes=dashboard_routes, - # maybe quota should be serialized into the record e.g for admins - quota=get_files_quota(draft._record), - # hide react community component - hide_community_selection=community_use_jinja_header, - ), + forms_config=form_config, record=record, community=community, community_use_jinja_header=community_use_jinja_header, diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js index aa0eab5cd..ef0329622 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js @@ -221,7 +221,8 @@ export class RDMDepositForm extends Component { pidPlaceholder={pid.pid_placeholder} pidType={pid.scheme} unmanagedHelpText={pid.unmanaged_help_text} - required + doiDefaultSelection={pid.default_selected} + required={this.config.is_doi_required} record={record} /> diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js index 2005fa220..3894697d5 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js @@ -29,6 +29,7 @@ ReactDOM.render( allowRecordRestriction={getInputFromDOM("deposits-allow-record-restriction")} groupsEnabled={getInputFromDOM("config-groups-enabled")} allowEmptyFiles={getInputFromDOM("records-resources-allow-empty-files")} + isDoiRequired={getInputFromDOM("deposits-is-doi-required")} /> , document.getElementById("deposit-form") From 20b01c4d3492d63f58349a9fe1db730fde0f444b Mon Sep 17 00:00:00 2001 From: Zacharias Zacharodimos Date: Mon, 16 Dec 2024 09:09:43 +0100 Subject: [PATCH 26/28] release: v13.0.0b1.dev25 --- invenio_app_rdm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invenio_app_rdm/__init__.py b/invenio_app_rdm/__init__.py index 30cd19f46..4bdd0ab56 100644 --- a/invenio_app_rdm/__init__.py +++ b/invenio_app_rdm/__init__.py @@ -17,6 +17,6 @@ # # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440 -__version__ = "13.0.0b1.dev24" +__version__ = "13.0.0b1.dev25" __all__ = ("__version__",) From a5e65d39354fc8c2ef6fb4e27af0347367f7534f Mon Sep 17 00:00:00 2001 From: Carlin MacKenzie Date: Mon, 16 Dec 2024 11:39:34 +0100 Subject: [PATCH 27/28] bug: close unclosed div --- .../theme/templates/semantic-ui/invenio_app_rdm/header.html | 1 + 1 file changed, 1 insertion(+) diff --git a/invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/header.html b/invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/header.html index 1b3acc3a3..aabca7c5f 100644 --- a/invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/header.html +++ b/invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/header.html @@ -126,6 +126,7 @@ {%- endblock navbar_right %} + {%- endblock navbar %} From af193c7a5fcb728343c7898ac4f52a5a5b44c95a Mon Sep 17 00:00:00 2001 From: Carlin MacKenzie Date: Mon, 16 Dec 2024 11:45:48 +0100 Subject: [PATCH 28/28] bug: remove unnecessary p tag --- .../invenio_app_rdm/records/details/description.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/description.html b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/description.html index 9b10fec64..48d7cfba1 100644 --- a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/description.html +++ b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/description.html @@ -15,7 +15,7 @@

    {{ _('Description') }}

    {# description data is being sanitized by marshmallow in the backend #}
    -

    {{ description | safe }}

    + {{ description | safe }}
    {% endif %}