OH requests go in modal dialog #3193
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had to locally add "keep form submits in modal behavior", that used to be in Blacklight but got removed some time ago. We patched it back into Blacklight instead of just adding our own independent thing, and contributed it upstream, but Blacklight may not want it upstream. There is some risk of future Blacklight breaking our patch, if that ever happens we should probably just extract it completely.
The OH request workflow still works not in a modal too, if you access a request URL directly, or say click on requet button with "open in new tab". The Blacklight modal stuff is meant to support that, and I like it as a failsafe.
It does mean we have a lot more conditional logic in our already hacky conditional-heavy oral history requests controller. Tried to keep it clean with a helper method, but it is a bit confusing. We need slightly different status messages in the modal case for instance, because we need a link to Your Requests in some cases, when in the non-modal case we are redirecting there!
There were existing capybara specs -- which actually just kept working (and not false positive!) -- cause they were checking for text on screen after submitting request, and whether that text is in a modal or a flash notice at top of screen, either way test passed! I did add a bit to tests to actually ensure modal is on screen though!
.