performant-software / Annotation-Studio

An online annotation platform for teaching and learning in the humanities.
http://www.annotationstudio.org
GNU General Public License v2.0
5 stars 1 forks source link

Redirect to correct search page after adding a document #418

Closed camdendotlol closed 2 years ago

camdendotlol commented 2 years ago

What this PR does

This PR closes #415 by redirecting users to the same page they were on after adding an anthology.

Since I came in quite a bit under the budget, I also went ahead and applied this redirect feature to document removals, too.

Note: There is a small change in the lockfile where the bundler insisted that I change git:// to https:// and refused to run COVE otherwise. Not sure what happened there, but it doesn't seem to break anything and is more secure.

Videos

Adding a document

https://user-images.githubusercontent.com/64725469/176935795-7d522e18-cfb0-4aac-a972-6589a95c4f8d.mov

Removing a document

https://user-images.githubusercontent.com/64725469/176935903-71673706-ceef-400f-91bd-0008530c96ab.mov

How to test

  1. Log into the staging site and go to one of your anthologies (the one you created for the invite system testing should still exist).
  2. Search documents for a title of "wilde" or some other common term that will provide multiple pages of results.
  3. Go to any page after page 1.
  4. Click to add a document. The page should refresh, with a notice that you've added the document, but you should still be on the same page of search results (see my video above for reference).
  5. The document you just added will now have a "Remove from anthology" button. Click on that, and you should be once again redirected to the correct page of the search results.
  6. Add several documents, it doesn't matter which ones.
  7. Click on the "All" tab on the righthand side of the table to display all the documents you've added: Screen Shot 2022-07-01 at 12 46 10 PM
  8. Remove a document. The page should refresh, and you should still be on the "All" tab, the only difference being that the document you removed is gone from the list.