diff --git a/CHANGES.rst b/CHANGES.rst index 1dcd0c3569ef2a4d0cadf6b4dda08975e78d1deb..d4ee79476f279a7e093230bde52b525680501e02 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,12 @@ Changes ======= +Version 2025.1.3 (released 2025-02-06) + +- Update translation infrastructure +- Fix config class override not being reflected in Jinja templates + + Version 2025.1.2 (released 2025-02-05) - Rework the Flask config class override as a `finalize_app` handler diff --git a/README.rst b/README.rst index 453d145d6ef915dd6400f3abc14605d877af8861..2816141f5e59a99accc65f531037ef1a443f214c 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ .. - Copyright (C) 2020-2024 TU Wien. + Copyright (C) 2020-2025 TU Wien. Invenio-Config-TUW is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more @@ -15,10 +15,13 @@ The following list is a quick overview of the most relevant customizations happe * Configuration values * Permission policies +* Mandatory submission reviews * OIDC authentication handling * E-Mail notification on errors +* Customized notification backends * User profile extension * Integration with other TU Wien services +* Custom background tasks Details @@ -35,7 +38,7 @@ Permission policies ------------------- InvenioRDM is not just some sort of cheap storage platform where users can upload their data and update it at any time. -Instead, it is a platform intended to host digital objects that get [DOIs](https://www.doi.org/) assigned. +Instead, it is a platform intended to host digital objects that get `DOIs <https://www.doi.org/>`_ assigned. Since the idea behind DOIs (and persistent identifiers in general) is to point at the same content over time, it does not allow users to change the files after publication. This is one of the unique features that the system offers that may not be immediately obvious to users. @@ -48,6 +51,17 @@ Also, communities can be quite confusing in the beginning. Thus, we restrict the creation of new communities for non-administrators. +Mandatory submission reviews +---------------------------- + +Before any upload can be published, it needs to undergo a mandatory submission review. +This enhances the quality, reusability, and long-term preservation of uploaded content. + +Previously, this was implemented via customized permission policies and required communication via external channels. +As of ``v2025.1.0``, the workflow is based on `Invenio-Curations <https://github.com/tu-graz-library/invenio-curations>`_. +This allows the entire workflow to be handled through the system, and allows the system to act as a ticketing system for reviews. + + OIDC authentication handling ---------------------------- @@ -59,7 +73,13 @@ Sometimes we have slightly non-standard requirements, which are satisfied by the E-Mail notification on errors ----------------------------- -This module defines a custom log handler for error-level logs which sends out notifications as e-mail to a set of configured recipient addresses. +This package defines a custom log handler for error-level logs which sends out notifications as e-mail to a set of configured recipient addresses. + + +Customized notification backends +-------------------------------- + +To make setting automatic email handling rules simple, we set the ``X-Sender`` email header field to a configurable value. User profile extension @@ -73,4 +93,14 @@ Integration with other TU Wien services --------------------------------------- One of the benefits of hosting InvenioRDM as an institutional repository is that it enables some conveniences by integrating with the local environment more. -For example, we integrate with [TISS](https://tiss.tuwien.ac.at/) by periodically querying it for TU Wien employees and adding their names to the controlled vocabulary of known ``names``. +For example, we integrate with `TISS <https://tiss.tuwien.ac.at/>`_ by periodically querying it for TU Wien employees and adding their names to the controlled vocabulary of known ``names``. + + +Custom background tasks +----------------------- + +To make the continued operation of the system smoother, this package also provides some background tasks: + +* Reminder notifications to reviewers about open submission reviews +* Reminder notifications to users about accepted submissions +* Periodic updates of the ``names`` vocabulary via TISS diff --git a/babel.ini b/babel.ini index 4e3f3b7d339a87a4d4b4f1cd9691f484c5199b48..23e3b7823913f9528a886a42bbbf8caa1dbe1c65 100644 --- a/babel.ini +++ b/babel.ini @@ -14,7 +14,6 @@ encoding = utf-8 [jinja2: **/templates/**.html] encoding = utf-8 -extensions = jinja2.ext.autoescape, jinja2.ext.with_ # Extraction from JavaScript files diff --git a/babel.sh b/babel.sh index a1dec6141b0cb3c627e59f590a5e6787fb615520..71998add3a5f13bffe153b8e9bddcf1bc6560441 100755 --- a/babel.sh +++ b/babel.sh @@ -1,24 +1,35 @@ #!/bin/bash # -*- coding: utf-8 -*- # -# Copyright (C) 2024 TU Wien. +# Copyright (C) 2024-2025 TU Wien. # # Invenio-Config-TUW is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. +function usage() { + echo "usage: ${0} <COMMAND> [args...]" + echo + echo "available commands: compile, extract, init, update" +} + if [[ $# -lt 1 ]]; then - echo >&2 "error: expected at least one argument" + usage >&2 + exit 1 fi -case "${1}" in +command="${1}" +shift +case "${command}" in init) pybabel init \ --input-file "invenio_config_tuw/translations/messages.pot" \ - --output-dir "invenio_config_tuw/translations/" + --output-dir "invenio_config_tuw/translations/" \ + "${@}" ;; compile) pybabel compile \ - --directory "invenio_config_tuw/translations/" + --directory "invenio_config_tuw/translations/" \ + "${@}" ;; extract) pybabel extract \ @@ -26,15 +37,20 @@ case "${1}" in --msgid-bugs-address "tudata@tuwien.ac.at" \ --mapping-file "babel.ini" \ --output-file "invenio_config_tuw/translations/messages.pot" \ - --add-comments "NOTE" + --add-comments "NOTE" \ + invenio_config_tuw \ + "${@}" ;; update) pybabel update \ --input-file "invenio_config_tuw/translations/messages.pot" \ - --output-dir "invenio_config_tuw/translations/" + --output-dir "invenio_config_tuw/translations/" \ + "${@}" ;; *) - echo >&2 "unknown command: ${1}" + echo >&2 "error: unknown command: ${command}" + echo >&2 + usage >&2 exit 1 ;; esac diff --git a/invenio_config_tuw/__init__.py b/invenio_config_tuw/__init__.py index 75f9ca052be94c4a3bb6e4475d3b37d845a9ee56..5d702769dd1440be6fb84a14b7305cd0f1672cdb 100644 --- a/invenio_config_tuw/__init__.py +++ b/invenio_config_tuw/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2020-2024 TU Wien. +# Copyright (C) 2020-2025 TU Wien. # # Invenio Config TUW is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. @@ -9,6 +9,6 @@ from .ext import InvenioConfigTUW -__version__ = "2025.1.2" +__version__ = "2025.1.3" __all__ = ("__version__", "InvenioConfigTUW") diff --git a/invenio_config_tuw/startup.py b/invenio_config_tuw/startup.py index 73a1b717d4e3cfd7101d62ed08ca9d8b79b4c02f..09e7b8b61042190103777fc72fbda20cc67620ac 100644 --- a/invenio_config_tuw/startup.py +++ b/invenio_config_tuw/startup.py @@ -141,6 +141,10 @@ def override_flask_config(app): """ app.config = TUWConfig.from_flask_config(app.config) + # we need to override the "config" global, as that might still be the + # old "normal" Flask config, and thus have different content + app.add_template_global(app.config, "config") + def patch_flask_create_url_adapter(app): """Patch Flask's {host,subdomain}_matching with 3.1 behavior. diff --git a/invenio_config_tuw/translations/.gitkeep b/invenio_config_tuw/translations/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/pyproject.toml b/pyproject.toml index dc5cb12ef25c1ca256ed00b950d4ea2ca4960456..0248b0282a490c5221540e6dcf175d46709875bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,9 @@ invenio_config_tuw_curation_request = "invenio_config_tuw.startup:customize_cura invenio_config_tuw_flask_config = "invenio_config_tuw.startup:override_flask_config" invenio_config_tuw_patch_flask = "invenio_config_tuw.startup:patch_flask_create_url_adapter" +[project.entry-points."invenio_i18n.translations"] +messages = "invenio_config_tuw" + [project.entry-points."invenio_celery.tasks"] invenio_config_tuw = "invenio_config_tuw.tasks" invenio_config_tuw_tiss = "invenio_config_tuw.tiss.tasks"