From 5041cf0623ff3979e7cb2f4a599bf1d9a91311fb Mon Sep 17 00:00:00 2001
From: Maximilian Moser <maximilian.moser@tuwien.ac.at>
Date: Mon, 10 Mar 2025 23:59:45 +0100
Subject: [PATCH 1/3] Omit "version" from deposit form defaults

* missing version fields are handled by the UIJSONSerializer by
  constructing a string of the shape "v{version_index}"
* the "metadata" service component removes both the "version" and
  "publication_date" fields from new versions of records
* experience shows that users rarely put in explicit values for the
  version field, which creates inconsistency
---
 invenio_config_tuw/config.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/invenio_config_tuw/config.py b/invenio_config_tuw/config.py
index 2dc98ad..b913ac4 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
 }
 
-- 
GitLab


From f0b28a3075db0f26b8d22da1e2d25836c36c7d86 Mon Sep 17 00:00:00 2001
From: Maximilian Moser <maximilian.moser@tuwien.ac.at>
Date: Tue, 11 Mar 2025 11:14:15 +0100
Subject: [PATCH 2/3] Add service component for setting the publication date on
 new versions

* the "metadata" service component copies over every field *except for*
  "version" and "publication_date" from the old record
---
 invenio_config_tuw/services.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/invenio_config_tuw/services.py b/invenio_config_tuw/services.py
index 82fc2ec..3e0afbc 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,
 ]
-- 
GitLab


From 32db705f2db97b0118a327d63d28bf75cbb682de Mon Sep 17 00:00:00 2001
From: Maximilian Moser <maximilian.moser@tuwien.ac.at>
Date: Tue, 11 Mar 2025 15:07:59 +0100
Subject: [PATCH 3/3] Bump version to v2025.1.11

---
 CHANGES.rst                    | 6 ++++++
 invenio_config_tuw/__init__.py | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index 66f1ce2..2d48d20 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 273f3c9..3c5ad86 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")
-- 
GitLab