pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
306 stars 445 forks source link

Improve UX when DOI bulk actions completed #7522

Closed NateWr closed 2 years ago

NateWr commented 2 years ago

Describe the problem you would like to solve In the new DOI management page (#6062), editors can take bulk actions like assigning DOIs and depositing them. When these actions are completed, the list is updated.

However, there's a delay after the bulk actions confirmation prompt (the modal opened via openDialog) closes and before the list updates. During this time, editors may believe their action failed to complete correctly. They may attempt the action again or take other actions on stale data (eg - try to edit a DOI manually when one has already been assigned).

This delay is small when running a local development instance, but may be very long (5-10 seconds) in a slow production environment.

A second issue is that when a bulk action is completed, the current selected items are deselected. The user's selection should remain until they manually deselect the items because an editor may wish to perform two bulk actions on the same set. An example workflow would be:

  1. Select a bunch of items.
  2. Select Bulk Actions > Assign DOIs.
  3. Select Bulk Actions > Export.

Describe the solution you'd like When an editor takes a bulk action, the confirmation prompt should remain visible with its loading spinner until the data in the UI has been synced with the changes from the bulk action. By the time the confirmation prompt closes, the list behind it should be showing the updated data.

When the bulk action is completed, don't clear the array of selected items.

Who is asking for this feature? This is part of #6062.

Additional information cc @ewhanson

ewhanson commented 2 years ago

Hey @NateWr, I've included these PRs here as they mostly deal with DOI actions UX, but there will still be more to address for this issue. There's one commit adding the a DoisEnabled authorization policy. Thanks for having a look!

PRs:

NateWr commented 2 years ago

I've reviewed them all and left a few comments, but it looks good. In addition to the comments, I noticed one small locale key change that I'd recommend. When clicking Deposit All, it says:

You are about to schedule all outstanding DOI metadata records to be deposited with Crossref.

I'd recommend changing this to:

You are about to submit all outstanding DOI metadata records to Crossref.

NateWr commented 2 years ago

Oh, and I noticed that the timing part of this issue is still outstanding:

When an editor takes a bulk action, the confirmation prompt should remain visible with its loading spinner until the data in the UI has been synced with the changes from the bulk action. By the time the confirmation prompt closes, the list behind it should be showing the updated data.

ewhanson commented 2 years ago

Hey @asmecher, I've addressed @NateWr's comments and have the tests passing. Would you be able to have a look? PRs are linked above. Thanks!

asmecher commented 2 years ago

All merged -- thanks, @ewhanson and @NateWr!