Skip to content

Feature #41 | Support date ranges for physical samples. - #219

Open
gabrielakuhn wants to merge 2 commits into
wip-feat-41-igsn-related-resourcesfrom
wip-feat-41-igsn-date-range
Open

Feature #41 | Support date ranges for physical samples.#219
gabrielakuhn wants to merge 2 commits into
wip-feat-41-igsn-related-resourcesfrom
wip-feat-41-igsn-date-range

Conversation

@gabrielakuhn

Copy link
Copy Markdown
Collaborator

Summary

Add the options of Date range in the "Dates" of physical sample.
Now only ranges carry an extra triple date_end. It is read as OPTIONAL
because only ranges dates carry one. This is written like in this way to
keep datetype for dates.

Changes

  • src/djehuty/web/validator.py: Add partial_date_range_value, which returns
      the start and  the end of a range.
  • src/djehuty/web/database.py: Store the end as a separate date_end, so each end
      keeps the datatype.
  • src/djehuty/web/resources/sparql_templates/physical_sample_dates.sparql:
      Read date_end with OPTIONAL, because only ranges carry one.
  • src/djehuty/web/xml_formatter.py: Join dates range with a slash for DataCite.
  • src/djehuty/utils/convenience.py: Add convenience for day_first_date and date_or_range
      to render a date.
  • src/djehuty/web/wsgi.py: Render date range for physical_sample.
  • src/djehuty/web/resources/html_templates/depositor/edit-physical-sample.html:
      Add a Range tab to the date form.
  • src/djehuty/web/resources/static/js/edit-physical-sample.js: Handle range tab.

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 Reference

Part of #41

Screenshots

After
image

Notes
Forked from wip-feat-41-igsn-related-resources

@gabrielakuhn gabrielakuhn changed the title web: Support date ranges for physical samples. Feature #41 | Support date ranges for physical samples. Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 13.11475% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.30%. Comparing base (f695c96) to head (7222b10).

Files with missing lines Patch % Lines
src/djehuty/web/validator.py 8.10% 34 Missing ⚠️
src/djehuty/utils/convenience.py 27.27% 8 Missing ⚠️
src/djehuty/web/database.py 28.57% 5 Missing ⚠️
src/djehuty/web/xml_formatter.py 0.00% 4 Missing ⚠️
src/djehuty/web/wsgi.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           wip-feat-41-igsn-related-resources     #219      +/-   ##
======================================================================
- Coverage                               16.32%   16.30%   -0.03%     
======================================================================
  Files                                      21       21              
  Lines                                   11458    11504      +46     
  Branches                                 2249     2261      +12     
======================================================================
+ Hits                                     1871     1876       +5     
- Misses                                   9396     9437      +41     
  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.

* src/djehuty/web/validator.py: Add partial_date_range_value, which returns
  the start and  the end of a range.
* src/djehuty/web/database.py: Store the end as a separate date_end, so each end
  keeps the datatype.
* src/djehuty/web/resources/sparql_templates/physical_sample_dates.sparql:
  Read date_end with OPTIONAL, because only ranges carry one.
* src/djehuty/web/xml_formatter.py: Join dates range with a slash for DataCite.
* src/djehuty/utils/convenience.py: Add convenience for day_first_date and date_or_range
  to render a date.
* src/djehuty/web/wsgi.py: Render date range for physical_sample.
* src/djehuty/web/resources/html_templates/depositor/edit-physical-sample.html:
  Add a Range tab to the date form.
* src/djehuty/web/resources/static/js/edit-physical-sample.js: Handle range tab.
…mple

* src/djehuty/web/resources/html_templates/depositor/edit-physical-sample.html:
  Start and end of a range on one line.
* src/djehuty/web/resources/static/js/edit-physical-sample.js: Handle every
  format from a single input.
@gabrielakuhn
gabrielakuhn force-pushed the wip-feat-41-igsn-date-range branch from bdc0cbf to 7222b10 Compare July 31, 2026 16:26
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