From e7bd6d3d587fec60a38fc92b088f8b5ec2b6958d Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Wed, 5 Feb 2025 10:33:18 +0100 Subject: [PATCH 1/6] Remove deprecated jinja extensions from babel config * they're now built into the compiler: https://jinja.palletsprojects.com/en/stable/changes/#version-3-0-0 --- babel.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/babel.ini b/babel.ini index 4e3f3b7..23e3b78 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 -- GitLab From 1cafda619a6b4ba72634e6f80d116ee3488f62c4 Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Wed, 5 Feb 2025 10:35:15 +0100 Subject: [PATCH 2/6] Update babel.sh * forward extra arguments to pybabel * add missing fixed argument to "extract" * provide better usage information --- babel.sh | 32 ++++++++++++++++++------ invenio_config_tuw/translations/.gitkeep | 0 2 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 invenio_config_tuw/translations/.gitkeep diff --git a/babel.sh b/babel.sh index a1dec61..71998ad 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/translations/.gitkeep b/invenio_config_tuw/translations/.gitkeep new file mode 100644 index 0000000..e69de29 -- GitLab From cb30bea031d255f98ff8d8455086bbf0f06d2b9c Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Wed, 5 Feb 2025 12:25:49 +0100 Subject: [PATCH 3/6] Add entrypoint for translation messages * this makes sure that our custom translations will be picked up, if we ever go for translations --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index dc5cb12..0248b02 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" -- GitLab From 24d5425d4c3696436d90e0d7e3e7e6af9bbe4b15 Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Thu, 6 Feb 2025 10:49:35 +0100 Subject: [PATCH 4/6] Update README * fix links being formatted in MD rather than reST * mention the new submission review workflow, notification backends, and background tasks --- README.rst | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 453d145..2816141 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 -- GitLab From f8e6ce67c251b599959b197cb4f91963a1845db0 Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Thu, 6 Feb 2025 11:54:44 +0100 Subject: [PATCH 5/6] Override "config" global for Jinja templates * previously, the global was still set to the original Flask config which may not be in sync with the overridden config and thus cause unexpected behavior --- invenio_config_tuw/startup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/invenio_config_tuw/startup.py b/invenio_config_tuw/startup.py index 73a1b71..09e7b8b 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. -- GitLab From dad9b7b9f9be3abd86b8d763bc6cfeb8de65f93a Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Thu, 6 Feb 2025 11:57:11 +0100 Subject: [PATCH 6/6] Bump version to v2025.1.3 --- CHANGES.rst | 6 ++++++ invenio_config_tuw/__init__.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1dcd0c3..d4ee794 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/invenio_config_tuw/__init__.py b/invenio_config_tuw/__init__.py index 75f9ca0..5d70276 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") -- GitLab