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

Disable files panel when selecting no #3532

Closed lwrubel closed 1 month ago

lwrubel commented 1 month ago

Why was this change made? 🤔

Resolves #3505. HOLD for testing in deployed env and by PO. Please squash when merging!

Screenshot 2024-05-21 at 4 16 06 PM

How was this change tested? 🤨

Locally, deployed to QA for PO testing

Does your change introduce accessibility violations? 🩺

No new ones

lwrubel commented 1 month ago

Bug 1: @amyehodge has found a problem with attached files that I think is related to initially saving a draft with neither Yes/No select.

1) Edit a deposited work 2) Don't select Yes or No. Save the draft 3) Edit it again and select Yes. Add a file. 4) HB error: https://app.honeybadger.io/projects/55564/faults/100610329

I am not sure yet of the source of the error, but I think it has to do with the use_previous_attached_files method in the base_work_form.rb and it attaching (empty?) files that are empty when checksummed later.

I am not sure why we removed logic to require users to select Yes/No even when creating a draft. It seems like that would be good to do anyway, to avoid having a nil new_user_version param saving nil user_version numbers into the work_version.

Bug 2 If you don't select Yes/No, save the draft, and then re-open the draft, the previous version's version description is getting displayed:

Screenshot 2024-05-22 at 4 29 15 PM

lwrubel commented 1 month ago

I made a change in the last commit to require users to select Yes/No for a new version even in draft mode. Forcing a selection seems to prevent the bugs above, pending further testing in QA. The styling could use a tweak (see below) to be bolder.

If this does not match with the desired UX, we will need to find a different solution.

Screenshot 2024-05-22 at 5 50 00 PM