Skip to content

Commit 837d1c0

Browse files
authored
Merge branch 'inveniosoftware:master' into recordlandingpage_funding-display
2 parents 32bc035 + af193c7 commit 837d1c0

File tree

26 files changed

+277
-141
lines changed

26 files changed

+277
-141
lines changed

AUTHORS.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

CHANGES.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@
1010
Changes
1111
=======
1212

13+
Version v13.0.0b1.dev24 (released 2024-12-10)
14+
15+
- fix: meta: add missing HighWire authors
16+
- config: add subcommunity comment notifications
17+
18+
Version v13.0.0b1.dev23 (released 2024-11-28)
19+
20+
- assets: use the new copy feature to copy needed TinyMCE static assets
21+
22+
Version v13.0.0b1.dev22 (released 2024-11-28)
23+
24+
- installation: bump invenio-access
25+
* This removes the invenio-admin dependency.
26+
27+
Version v13.0.0b1.dev21 (released 2024-11-28)
28+
29+
- installation: remove "sentry_sdk" extra from invenio-logging
30+
31+
Version v13.0.0b1.dev20 (released 2024-11-28)
32+
33+
- config: add subcommunity invitation request notifications
34+
- requests: add subcommunity invitation request details page
35+
- creatibutors: added config for identifiers scheme
36+
1337
Version v13.0.0b1.dev15 (released 2024-10-18)
1438

1539
- communities-ui: verified icon display logic change and deterministic sorting

docs/authors.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

invenio_app_rdm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
#
1818
# See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440
1919

20-
__version__ = "13.0.0b1.dev18"
20+
__version__ = "13.0.0b1.dev25"
2121

2222
__all__ = ("__version__",)

invenio_app_rdm/communities_ui/views/ui.py

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@
1515
UICommunityJSONSerializer,
1616
)
1717
from invenio_communities.errors import CommunityDeletedError
18+
from invenio_communities.views.ui import (
19+
not_found_error,
20+
record_permission_denied_error,
21+
record_tombstone_error,
22+
)
1823
from invenio_i18n import lazy_gettext as _
1924
from invenio_pidstore.errors import PIDDeletedError, PIDDoesNotExistError
2025
from invenio_rdm_records.collections import search_app_context as c_search_app_context
21-
from invenio_records_resources.services.errors import PermissionDeniedError
26+
from invenio_records_resources.services.errors import (
27+
PermissionDeniedError,
28+
RecordPermissionDeniedError,
29+
)
2230

2331
from ..searchapp import search_app_context
2432
from .communities import (
@@ -30,46 +38,6 @@
3038
)
3139

3240

33-
#
34-
# Error handlers
35-
#
36-
def not_found_error(error):
37-
"""Handler for 'Not Found' errors."""
38-
return render_template(current_app.config["THEME_404_TEMPLATE"]), 404
39-
40-
41-
def record_tombstone_error(error):
42-
"""Tombstone page."""
43-
# the RecordDeletedError will have the following properties,
44-
# while the PIDDeletedError won't
45-
record = getattr(error, "record", None)
46-
if (record_ui := getattr(error, "result_item", None)) is not None:
47-
if record is None:
48-
record = record_ui._record
49-
record_ui = UICommunityJSONSerializer().dump_obj(record_ui.to_dict())
50-
51-
# render a 404 page if the tombstone isn't visible
52-
if not record.tombstone.is_visible:
53-
return not_found_error(error)
54-
55-
# we only render a tombstone page if there is a record with a visible tombstone
56-
return (
57-
render_template(
58-
"invenio_communities/tombstone.html",
59-
record=record_ui,
60-
),
61-
410,
62-
)
63-
64-
65-
def record_permission_denied_error(error):
66-
"""Handle permission denier error on record views."""
67-
if not current_user.is_authenticated:
68-
# trigger the flask-login unauthorized handler
69-
return current_app.login_manager.unauthorized()
70-
return render_template(current_app.config["THEME_403_TEMPLATE"]), 403
71-
72-
7341
def _show_browse_page():
7442
"""Whether the browse page should be visible in the menu."""
7543
return (
@@ -118,6 +86,9 @@ def create_ui_blueprint(app):
11886
blueprint.register_error_handler(
11987
PermissionDeniedError, record_permission_denied_error
12088
)
89+
blueprint.register_error_handler(
90+
RecordPermissionDeniedError, record_permission_denied_error
91+
)
12192
blueprint.register_error_handler(PIDDeletedError, record_tombstone_error)
12293
blueprint.register_error_handler(CommunityDeletedError, record_tombstone_error)
12394
blueprint.register_error_handler(PIDDoesNotExistError, not_found_error)

invenio_app_rdm/config.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -708,15 +708,6 @@ def files_rest_permission_factory(obj, action):
708708
SEARCH_HOSTS = [{"host": "localhost", "port": 9200}]
709709
"""Search hosts."""
710710

711-
# Invenio-Indexer
712-
# ===============
713-
# See https://invenio-indexer.readthedocs.io/en/latest/configuration.html
714-
715-
# We want that indexers are always explicit about the index they are indexing to.
716-
# NOTE: Can be removed when https://github.com/inveniosoftware/invenio-indexer/pull/158 is merged and released.
717-
INDEXER_DEFAULT_INDEX = None
718-
"""Default index to use if no schema is defined."""
719-
720711
# Invenio-Base
721712
# ============
722713
# See https://invenio-base.readthedocs.io/en/latest/api.html#invenio_base.wsgi.wsgi_proxyfix # noqa
@@ -1003,6 +994,25 @@ def github_link_render(record):
1003994
APP_RDM_ADMIN_EMAIL_RECIPIENT = "[email protected]"
1004995
"""Admin e-mail"""
1005996

997+
APP_RDM_IDENTIFIER_SCHEMES_UI = {
998+
"orcid": {
999+
"url_prefix": "http://orcid.org/",
1000+
"icon": "images/orcid.svg",
1001+
"label": "ORCID",
1002+
},
1003+
"ror": {
1004+
"url_prefix": "https://ror.org/",
1005+
"icon": "images/ror-icon.svg",
1006+
"label": "ROR",
1007+
},
1008+
"gnd": {
1009+
"url_prefix": "http://d-nb.info/gnd/",
1010+
"icon": "images/gnd-icon.svg",
1011+
"label": "GND",
1012+
},
1013+
}
1014+
"""Identifier Schemes UI config"""
1015+
10061016
# Invenio-Communities
10071017
# ===================
10081018

@@ -1358,6 +1368,8 @@ def github_link_render(record):
13581368
GrantUserAccessNotificationBuilder.type: GrantUserAccessNotificationBuilder,
13591369
# Comment request event
13601370
CommentRequestEventCreateNotificationBuilder.type: CommentRequestEventCreateNotificationBuilder,
1371+
community_notifications.SubComReqCommentNotificationBuilder.type: community_notifications.SubComReqCommentNotificationBuilder,
1372+
community_notifications.SubComInvCommentNotificationBuilder.type: community_notifications.SubComInvCommentNotificationBuilder,
13611373
# Community inclusion
13621374
CommunityInclusionAcceptNotificationBuilder.type: CommunityInclusionAcceptNotificationBuilder,
13631375
CommunityInclusionCancelNotificationBuilder.type: CommunityInclusionCancelNotificationBuilder,
@@ -1374,6 +1386,11 @@ def github_link_render(record):
13741386
community_notifications.SubCommunityCreate.type: community_notifications.SubCommunityCreate,
13751387
community_notifications.SubCommunityAccept.type: community_notifications.SubCommunityAccept,
13761388
community_notifications.SubCommunityDecline.type: community_notifications.SubCommunityDecline,
1389+
# Subcommunity invitation request
1390+
community_notifications.SubComInvitationCreate.type: community_notifications.SubComInvitationCreate,
1391+
community_notifications.SubComInvitationAccept.type: community_notifications.SubComInvitationAccept,
1392+
community_notifications.SubComInvitationDecline.type: community_notifications.SubComInvitationDecline,
1393+
community_notifications.SubComInvitationExpire.type: community_notifications.SubComInvitationExpire,
13771394
}
13781395
"""Notification builders."""
13791396

invenio_app_rdm/ext.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ def finalize_app(app):
3333

3434
def init_config(app):
3535
"""Initialize configuration."""
36+
record_doi_required = (
37+
app.config["RDM_PERSISTENT_IDENTIFIERS"].get("doi", {}).get("required")
38+
)
39+
parent_doi_required = (
40+
app.config["RDM_PARENT_PERSISTENT_IDENTIFIERS"].get("doi", {}).get("required")
41+
)
42+
43+
if record_doi_required != parent_doi_required:
44+
raise Exception(
45+
"Config variables RDM_PERSISTENT_IDENTIFIERS.doi.required and "
46+
"RDM_PARENT_PERSISTENT_IDENTIFIERS.doi.required must be set to the same value."
47+
)
48+
3649
if "COMMUNITIES_GROUPS_ENABLED" in app.config:
3750
warnings.warn(
3851
"COMMUNITIES_GROUPS_ENABLED config variable is deprecated. Please use USERS_RESOURCES_GROUPS_ENABLED "

invenio_app_rdm/fixtures/pages.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from invenio_access.permissions import system_identity
1414
from invenio_db import db
1515
from invenio_pages.proxies import current_pages_service
16+
from invenio_pages.records.errors import PageNotFoundError
1617
from invenio_rdm_records.fixtures.fixture import FixtureMixin
1718

1819

@@ -45,11 +46,15 @@ def page_data(self, page):
4546

4647
def create(self, entry):
4748
"""Load a single page."""
48-
data = {
49-
"url": entry.pop("url"),
50-
"title": entry.get("title"),
51-
"content": self.page_data(entry.get("template")),
52-
"description": entry.get("description"),
53-
"template_name": current_app.config["PAGES_DEFAULT_TEMPLATE"],
54-
}
55-
current_pages_service.create(system_identity, data)
49+
url = entry["url"]
50+
try:
51+
current_pages_service.read_by_url(system_identity, url)
52+
except PageNotFoundError:
53+
data = {
54+
"url": url,
55+
"title": entry.get("title", ""),
56+
"content": self.page_data(entry["template"]),
57+
"description": entry.get("description", ""),
58+
"template_name": current_app.config["PAGES_DEFAULT_TEMPLATE"],
59+
}
60+
current_pages_service.create(system_identity, data)

invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/description.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<h2 id="description-heading" class="sr-only">{{ _('Description') }}</h2>
1616
{# description data is being sanitized by marshmallow in the backend #}
1717
<div style="word-wrap: break-word;">
18-
<p>{{ description | safe }}</p>
18+
{{ description | safe }}
1919
</div>
2020
</section>
2121
{% endif %}

invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/meta.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{#
2-
Copyright (C) 2020 CERN.
2+
Copyright (C) 2020-2024 CERN.
33
Copyright (C) 2020 Northwestern University.
44
Copyright (C) 2021 New York University.
55
Copyright (C) 2023 Front Matter.
@@ -12,7 +12,7 @@
1212

1313
{%- set meta_title = record.metadata.title|striptags -%}
1414
{%- set meta_description = record.metadata.description|striptags -%}
15-
{%- set meta_authors = record.creators|map(attribute='name') -%}
15+
{%- set meta_authors = record.metadata.creators|map(attribute='person_or_org')|map(attribute='name') -%}
1616
{%- set files = record.files %}
1717

1818
{{- 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) }}

0 commit comments

Comments
 (0)