sul-dlss / happy-heron

Self-Deposit for the Stanford Digital Repository (SDR): H2 is a Rails web application enabling users to deposit scholarly content into SDR
Apache License 2.0
10 stars 2 forks source link

Make sure that items are not deposited with "purl_reservation" as the work type. #3570

Closed amyehodge closed 5 months ago

amyehodge commented 5 months ago

Work 7581/druid hw495rk5901 encountered problems when trying to deposit on Jun 28. The issue was that it somehow had "purl_reservation" as the work type, which didn't have a mapping to the required resourceTypeGeneral at DataCite. But no item should ever have this work type when the deposit button is clicked.

Just to review how this should work in the app, to reserve a PURL/DOI:

  1. User clicks on "reserve a PURL" button

  2. Modal opens and requires user to enter a temporary title.

  3. The DOI option can be set one of three ways for the collection that results in one of two different displays in this modal:

    • if set to never or always assign a DOI, the users see no messaging
    • if set to allow the user to choose whether to get a DOI, the user sees a DOI yes/no slider and are asked if they want to get a DOI Screenshot 2024-07-01 at 3 30 39 PM
  4. User clicks Submit to reserve the PURL and DOI if appropriate.

Upon return to provide metadata for the item, the user clicks any of the pencil icons associated with the item and is always first shown the work type modal. They must make a choice here and click Continue before they ever get to the form where there is a button to deposit.

There should technically be no way for a user to get to a deposit button with the work type still set to "purl_reservation."

The task here is to figure out if possible how this happened for this item and make sure it doesn't happen again.

mjgiarlo commented 5 months ago

I can reproduce this by manually going to the /works/{WORK_ID}/edit URL in a browser (though I'm not sure how likely users are to do this). It certainly seems like a thing we could be checking for when rendering the edit page instead of assuming the user came via the work type modal. (The "thing" being that the work's type is no longer the PURL reservation type, and rendering the modal if so?)

Example in QA I just made: https://argo-qa.stanford.edu/view/druid:nk536cp1921