Skip to content

Feature #41 | Allow register date for physical sample when only the year or the year and month is known and accept Created and Updated as a date type - #199

Open
gabrielakuhn wants to merge 3 commits into
wip-feat-41-igsn-fix-draftfrom
wip-feat-41-igsn-dates-format
Open

Feature #41 | Allow register date for physical sample when only the year or the year and month is known and accept Created and Updated as a date type#199
gabrielakuhn wants to merge 3 commits into
wip-feat-41-igsn-fix-draftfrom
wip-feat-41-igsn-dates-format

Conversation

@gabrielakuhn

Copy link
Copy Markdown
Collaborator

Summary

We would like to let depositors register a date for physical sample when only the year or the
year and month is known and also accept Created and Updated as a date type.

Changes

  • src/djehuty/web/validator.py: Accept dates in the form YYYY, YYYY-MM or
      YYYY-MM-DD.
  • src/djehuty/web/wsgi.py: Validate physical sample dates with the variable
      format rule.
  • src/djehuty/web/database.py: Store each date with the datatype matching
      its format.
  • src/djehuty/web/resources/sparql_templates/physical_sample_dates.sparql:
      Return the date as a string value regardless of datatype.
  • src/djehuty/web/resources/static/js/edit-physical-sample.js:
      Accept and display dates of any format.
  • src/djehuty/web/resources/static/js/edit-physical-sample.js: Add Created
      and Updated in the date type dropdown.
  • src/djehuty/web/xml_formatter.py: Map the new date types to DataCite.

Approval Checklist

  • I agree to follow Djehuty's code of conduct.
  • I have read and I have follow the code contribution workflow.
  • Code style and conventions were respected.
  • Documentation has been updated where needed (README, docs, or examples).
  • Review approved by at least one maintainer.
  • Merge readiness (PR is squashed into a single commit and follows the commit template).

Issue

Part of #41

Screenshots

After
image

Notes

Forked fom wip-feat-41-igsn-fix-draft

* src/djehuty/web/wsgi.py: Accept the new date types when saving physical
  sample dates.
* src/djehuty/web/resources/static/js/edit-physical-sample.js: Add Created
  and Updated in the date type dropdown.
* src/djehuty/web/xml_formatter.py: Map the new date types to DataCite.
Let depositors register a date for physical sample when only the year or the
year and month is known.

* src/djehuty/web/validator.py: Accept dates in the form YYYY, YYYY-MM or
  YYYY-MM-DD.
* src/djehuty/web/wsgi.py: Validate physical sample dates with the variable
  format rule.
* src/djehuty/web/database.py: Store each date with the datatype matching
  its format.
* src/djehuty/web/resources/sparql_templates/physical_sample_dates.sparql:
  Return the date as a string value regardless of datatype.
* src/djehuty/web/resources/static/js/edit-physical-sample.js:
  Accept and display dates of any format.
* src/djehuty/web/resources/html_templates/depositor/edit-physical-sample.html:
  Replace the free text date field a panel where the user can choose date format.

* src/djehuty/web/resources/static/js/edit-physical-sample.js: Handle the date
  panel entry and show the input accordingly with the selected format.
@gabrielakuhn
gabrielakuhn force-pushed the wip-feat-41-igsn-dates-format branch from 06dbac6 to ebb33d1 Compare July 31, 2026 16:14
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 6.25000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.32%. Comparing base (9803a48) to head (ebb33d1).

Files with missing lines Patch % Lines
src/djehuty/web/validator.py 8.33% 11 Missing ⚠️
src/djehuty/web/database.py 0.00% 2 Missing ⚠️
src/djehuty/web/wsgi.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           wip-feat-41-igsn-fix-draft     #199      +/-   ##
==============================================================
- Coverage                       16.33%   16.32%   -0.01%     
==============================================================
  Files                              21       21              
  Lines                           11447    11460      +13     
  Branches                         2246     2250       +4     
==============================================================
+ Hits                             1870     1871       +1     
- Misses                           9386     9398      +12     
  Partials                          191      191              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant