Skip to content

Feature #41 | Creating physical samples config support and edit form - #118

Merged
gabrielakuhn merged 2 commits into
feat-41/igsnfrom
wip-feat-41-igsn
Jul 3, 2026
Merged

Feature #41 | Creating physical samples config support and edit form #118
gabrielakuhn merged 2 commits into
feat-41/igsnfrom
wip-feat-41-igsn

Conversation

@gabrielakuhn

@gabrielakuhn gabrielakuhn commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Attention

This branch is in wip. I am currently removing all the all physical-sample class and property
insertions from this branch to add later in the migrations.

Summary

Add physical samples to djehuty

This adds a new type of output you can deposit in the repository, physical samples.
Depositors get a new "Physical samples" area in their dashboard where they can create, edit, and delete sample drafts. This also creates a the edit form which lets you fill in all the
physical-samples metadata

Also adds a config for the IGSN to later integrate with Datacite.

Nothing here changes the existing dataset or collection flows; it all sits side by side.

Changes
web: Implement physical samples with metadata editing and IGSN config

  • src/djehuty/web/database.py: Add physical_samples getter and
    insert/update/delete procedures, plus creators, dates and related
    resource sub-record getters and add helpers.
  • src/djehuty/web/wsgi.py: Add UI endpoints to list, create, edit and
    delete physical samples, and API endpoints for creators, dates,
    related resources, tags, categories and reordering.
  • src/djehuty/web/formatter.py: Add record formatters for physical
    samples, dates and related resources.
  • src/djehuty/web/ui.py: Parse the IGSN API configuration from the
    configuration file.
  • src/djehuty/web/config/runtime.py: Add IGSN settings and expose
    supports_igsn as a property derived from the prefix.
  • src/Makefile.am: Register the new physical sample templates, SPARQL
    queries and edit-physical-sample.js in the resource list.
  • src/djehuty/web/resources/html_templates/depositor/physical-samples.html:
    Add the page listing a depositor's physical samples.
  • src/djehuty/web/resources/html_templates/depositor/edit-physical-sample.html:
    Add the physical sample metadata edit form.
  • src/djehuty/web/resources/html_templates/depositor/dashboard.html: Add
    a physical samples entry to the dashboard.
  • src/djehuty/web/resources/html_templates/depositor/my-data.html: Add a
    link to the physical samples page.
  • src/djehuty/web/resources/html_templates/depositor/my-collections.html:
    Add a link to the physical samples page.
  • src/djehuty/web/resources/static/js/edit-physical-sample.js: Add the
    client-side logic for editing physical samples, including creators,
    dates, related resources, keywords and categories.
  • src/djehuty/web/resources/static/css/form.css: Adjust form styling.
  • src/djehuty/web/resources/sparql_templates/physical-samples.sparql:
    Add query to retrieve physical samples.
  • src/djehuty/web/resources/sparql_templates/physical_sample_creators.sparql:
    Add query to retrieve physical sample creators.
  • src/djehuty/web/resources/sparql_templates/physical_sample_dates.sparql:
    Add query to retrieve physical sample dates.
  • src/djehuty/web/resources/sparql_templates/physical_sample_related_resources.sparql:
    Add query to retrieve physical sample related resources.
  • src/djehuty/web/resources/sparql_templates/initiate_creator_for_physical_sample.sparql:
    Add query to create a creator for a physical sample.
  • src/djehuty/web/resources/sparql_templates/initiate_date_for_physical_sample.sparql:
    Add query to create a date for a physical sample.
  • src/djehuty/web/resources/sparql_templates/initiate_related_resource_for_physical_sample.sparql:
    Add query to create a related resource for a physical sample.
  • src/djehuty/web/resources/sparql_templates/update_physical_sample_draft.sparql:
    Add query to update a physical sample draft.
  • src/djehuty/web/resources/sparql_templates/delete_physical_sample_draft.sparql:
    Add query to delete a physical sample draft.
  • src/djehuty/web/resources/sparql_templates/update_authors_order.sparql:
    Generalise the author reorder query to accept a predicate.

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

Is part of issue #41

Screenshots (optional)

User dashboard:
image

Physical Samples dashboard:
image

Physical Samples registration form
image

Note

  • This is a very big PR (sorry) it should be better spitted from the beginning.
  • It was forked from a previous wip.
  • There is still more work coming that are splinted in other branches including tests.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 9.53545% with 370 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.83%. Comparing base (dee251c) to head (bcbca9f).

Files with missing lines Patch % Lines
src/djehuty/web/wsgi.py 5.73% 263 Missing ⚠️
src/djehuty/web/database.py 10.09% 98 Missing ⚠️
src/djehuty/web/ui.py 37.50% 4 Missing and 1 partial ⚠️
src/djehuty/web/formatter.py 50.00% 3 Missing ⚠️
src/djehuty/web/config/runtime.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           feat-41/igsn     #118      +/-   ##
================================================
- Coverage         17.13%   16.83%   -0.31%     
================================================
  Files                21       21              
  Lines             10212    10617     +405     
  Branches           1977     2064      +87     
================================================
+ Hits               1750     1787      +37     
- Misses             8279     8646     +367     
- Partials            183      184       +1     

☔ 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.

@gabrielakuhn gabrielakuhn changed the title Feat - 41 | Creating physical samples support and form Feature #41 | Creating physical samples support and form Jun 23, 2026
@gabrielakuhn gabrielakuhn changed the title Feature #41 | Creating physical samples support and form Feature #41 | Creating physical samples config support and edit form Jun 23, 2026
@gabrielakuhn gabrielakuhn self-assigned this Jun 23, 2026
@gabrielakuhn gabrielakuhn added the 🚀 new feature New feature or request label Jun 23, 2026
@gabrielakuhn
gabrielakuhn marked this pull request as ready for review June 25, 2026 11:29

@kairoaraujo kairoaraujo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gabrielakuhn I'm leaving few comments on this round.
I'm planning do a second round in the database and sparql

Comment thread src/djehuty/web/wsgi.py
Comment thread src/djehuty/web/wsgi.py
Comment thread src/djehuty/web/wsgi.py
Comment thread src/djehuty/web/database.py Outdated
Comment thread src/djehuty/web/wsgi.py Outdated
Comment thread src/djehuty/web/wsgi.py Outdated
Comment thread src/djehuty/web/wsgi.py Outdated
Comment thread src/djehuty/web/wsgi.py Outdated
Comment thread src/djehuty/web/database.py Outdated
Comment thread src/djehuty/web/config.py Outdated

@kairoaraujo kairoaraujo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I have some small comments :)

Comment thread src/djehuty/web/database.py Outdated
Comment thread src/djehuty/web/database.py Outdated
Comment thread src/djehuty/web/database.py Outdated
@gabrielakuhn
gabrielakuhn force-pushed the wip-feat-41-igsn branch 3 times, most recently from a423c28 to 40ffe14 Compare July 2, 2026 14:48
@gabrielakuhn
gabrielakuhn requested a review from kairoaraujo July 2, 2026 14:55

@kairoaraujo kairoaraujo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I assume you will rebase the others after merged

@gabrielakuhn

Copy link
Copy Markdown
Collaborator Author

LGTM, I assume you will rebase the others after merged

Thanks! Yes, will do that.

roelj and others added 2 commits July 3, 2026 10:59
* src/djehuty/web/database.py: Add physical_objects getter and
  insert/update/delete procedures, plus creators, events and related
  identifier sub-record getters and helpers.
* src/djehuty/web/wsgi.py: Add UI endpoints to list, create, edit and
  delete physical objects, and API endpoints for creators, events and
  related identifiers.
* src/Makefile.am: Register the new physical object templates, SPARQL
  queries and edit-physical-object.js in the resource list.
* src/djehuty/web/resources/html_templates/depositor/physical-objects.html:
  Add the page listing physical objects.
* src/djehuty/web/resources/html_templates/depositor/edit-physical-object.html:
  Add the physical object metadata edit form.
* src/djehuty/web/resources/html_templates/depositor/dashboard.html: Add
  a physical objects entry to the dashboard.
* src/djehuty/web/resources/html_templates/depositor/my-data.html: Add a
  link to the physical objects page.
* src/djehuty/web/resources/html_templates/depositor/my-collections.html:
  Add a link to the physical objects page.
* src/djehuty/web/resources/static/js/edit-physical-object.js: Add the
  client-side logic for editing physical objects.
* src/djehuty/web/resources/sparql_templates/physical-objects.sparql:
  Add query to retrieve physical objects.
* src/djehuty/web/resources/sparql_templates/physical_object_creators.sparql:
  Add query to retrieve physical object creators.
* src/djehuty/web/resources/sparql_templates/physical_object_events.sparql:
  Add query to retrieve physical object events.
* src/djehuty/web/resources/sparql_templates/physical_object_related_identifiers.sparql:
  Add query to retrieve physical object related identifiers.
* src/djehuty/web/resources/sparql_templates/initiate_creator_for_physical_object.sparql:
  Add query to create a creator for a physical object.
* src/djehuty/web/resources/sparql_templates/initiate_event_for_physical_object.sparql:
  Add query to create an event for a physical object.
* src/djehuty/web/resources/sparql_templates/initiate_related_identifier_for_physical_object.sparql:
  Add query to create a related identifier for a physical object.
* src/djehuty/web/resources/sparql_templates/update_physical_object_draft.sparql:
  Add query to update a physical object draft.
* src/djehuty/web/resources/sparql_templates/delete_physical_object_draft.sparql:
  Add query to delete a physical object draft.
…SN config

* src/djehuty/web/database.py: Rename physical objects to physical
  samples, add dates and related resource handling, fix the cache and
  remove a duplicate query run.
* src/djehuty/web/wsgi.py: Rename endpoints to physical samples, add API
  endpoints for dates, related resources, tags, categories and
  reordering, add the auth guard return and correct 404/405 handling.
* src/djehuty/web/formatter.py: Add record formatters for physical
  samples, dates and related resources.
* src/djehuty/web/ui.py: Parse the IGSN API configuration from the
  configuration file.
* src/djehuty/web/config/runtime.py: Add IGSN settings and expose
  supports_igsn.
* src/Makefile.am: Update the resource list for physical sample templates,
  SPARQL queries and edit-physical-sample.js.
* src/djehuty/web/resources/html_templates/depositor/physical-samples.html:
  Rename the file.
* src/djehuty/web/resources/html_templates/depositor/edit-physical-sample.html:
  Rename and expand the metadata edit form with keywords, categories,
  dates, related resources, geolocation and owner contact fields.
* src/djehuty/web/resources/html_templates/depositor/dashboard.html:
  Update the dashboard entry for physical samples.
* src/djehuty/web/resources/html_templates/depositor/my-data.html:
  Update the link to the physical samples page.
* src/djehuty/web/resources/html_templates/depositor/my-collections.html:
  Update the link to the physical samples page and remove a duplicate
  button.
* src/djehuty/web/resources/static/js/edit-physical-sample.js: Rename
  and extend the client-side logic for editing physical samples.
* src/djehuty/web/resources/static/css/form.css: Adjust form styling.
* src/djehuty/web/resources/sparql_templates/physical-samples.sparql:
  Rename the query to retrieve physical samples.
* src/djehuty/web/resources/sparql_templates/physical_sample_creators.sparql:
  Rename the query to retrieve physical sample creators.
* src/djehuty/web/resources/sparql_templates/physical_sample_dates.sparql:
  Add query to retrieve physical sample dates.
* src/djehuty/web/resources/sparql_templates/physical_sample_related_resources.sparql:
  Rename the query to retrieve physical sample related resources.
* src/djehuty/web/resources/sparql_templates/initiate_creator_for_physical_sample.sparql:
  Rename the query to create a creator for a physical sample.
* src/djehuty/web/resources/sparql_templates/initiate_date_for_physical_sample.sparql:
  Rename the query to create a date for a physical sample.
* src/djehuty/web/resources/sparql_templates/initiate_related_resource_for_physical_sample.sparql:
  Rename the query to create a related resource for a physical sample.
* src/djehuty/web/resources/sparql_templates/update_physical_sample_draft.sparql:
  Rename and extend the query to update a physical sample draft.
* src/djehuty/web/resources/sparql_templates/delete_physical_sample_draft.sparql:
  Rename the query to delete a physical sample draft.
* src/djehuty/web/resources/sparql_templates/update_authors_order.sparql:
  Make the author reorder query accept a predicate.
@gabrielakuhn
gabrielakuhn merged commit 3ded2fc into feat-41/igsn Jul 3, 2026
19 of 21 checks passed
@gabrielakuhn
gabrielakuhn deleted the wip-feat-41-igsn branch July 3, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants