diff --git a/CHANGES.rst b/CHANGES.rst index 66f1ce2a4f183d989a1795ac45a899e15f624368..2d48d2020ee508accf44c731324d16ad8fecc089 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,12 @@ Changes ======= +Version 2025.1.11 (released 2025-03-11) + +- Omit the default value for "version" on the deposit form +- Automatically set the publication date for new versions of records + + Version 2025.1.10 (released 2025-02-28) - Re-enable `rdm-curation` requests diff --git a/invenio_config_tuw/__init__.py b/invenio_config_tuw/__init__.py index 273f3c9b74e3a5e29cfee05e73041937229f3571..3c5ad867a95e9cb8e6c1147c36fa02659caef371 100644 --- a/invenio_config_tuw/__init__.py +++ b/invenio_config_tuw/__init__.py @@ -9,6 +9,6 @@ from .ext import InvenioConfigTUW -__version__ = "2025.1.10" +__version__ = "2025.1.11" __all__ = ("__version__", "InvenioConfigTUW") diff --git a/invenio_config_tuw/config.py b/invenio_config_tuw/config.py index 2dc98ad50127579973e671d66d555cf2398ec158..b913ac498cf67a652fe3fbe7902e9b7b634fdc41 100644 --- a/invenio_config_tuw/config.py +++ b/invenio_config_tuw/config.py @@ -228,7 +228,6 @@ APP_RDM_DEPOSIT_FORM_DEFAULTS = { "resource_type": { "id": "dataset", }, - "version": "1.0.0", "description": "<h2>A primer on your dataset's description (to be edited)</h2><p>The influence of proper documentation on the reusability for research data should not be underestimated!<br>In order to help others understand how to interpret and reuse your data, we provide you with a few questions to help you structure your dataset's description (though please don't feel obligated to stick to them):</p><h3>Context and methodology</h3><ul><li>What is the research domain or project in which this dataset was created?</li><li>Which purpose does this dataset serve?</li><li>How was this dataset created?</li></ul><h3>Technical details</h3><ul><li>What is the structure of this dataset? Do the folders and files follow a certain naming convention?</li><li>Is any specific software required to open and work with this dataset?</li><li>Are there any additional resources available regarding the dataset, e.g. documentation, source code, etc.?</li></ul><h3>Further details</h3><ul><li>Is there anything else that other people may need to know when they want to reuse the dataset?</li></ul>", # noqa } diff --git a/invenio_config_tuw/services.py b/invenio_config_tuw/services.py index 82fc2ecf8df5cd5a801d0e5549073e899e1876c3..3e0afbc4a253c6a5ca9048663345910aeb31dd91 100644 --- a/invenio_config_tuw/services.py +++ b/invenio_config_tuw/services.py @@ -9,6 +9,8 @@ """Overrides for core services.""" +from datetime import datetime + from invenio_curations.services.components import ( CurationComponent as BaseCurationComponent, ) @@ -84,9 +86,20 @@ class CurationComponent(BaseCurationComponent): return value +class PublicationDateComponent(ServiceComponent): + """Component for populating the "publication_date" metadata field.""" + + def new_version(self, identity, draft=None, record=None): + """Set "publication_date" for new record versions.""" + draft.metadata.setdefault( + "publication_date", datetime.now().strftime("%Y-%m-%d") + ) + + TUWRecordsComponents = [ *DefaultRecordsComponents, ParentAccessSettingsComponent, PublicationNotificationComponent, + PublicationDateComponent, CurationComponent, ]