Bug #17098

Collection "restore from previous version" button

Added by Peter Amstutz 5 months ago. Updated 2 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Target version:
Start date:
11/25/2020
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release relationship:
Auto

Subtasks

Task #17140: Review 17098-old-version-as-headResolvedPeter Amstutz


Related issues

Related to Arvados - Story #13494: Browse previous versions of a collectionResolved02/19/2020

Associated revisions

Revision ebaede5a
Added by Lucas Di Pentima 5 months ago

Merge branch '17098-old-version-as-head'
Closes #17098

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <>

History

#1 Updated by Peter Amstutz 5 months ago

  • Status changed from New to In Progress

#2 Updated by Lucas Di Pentima 5 months ago

  • Related to Story #13494: Browse previous versions of a collection added

#3 Updated by Lucas Di Pentima 5 months ago

  • Target version set to 2020-11-18
  • Assigned To set to Lucas Di Pentima

#4 Updated by Lucas Di Pentima 5 months ago

  • Target version changed from 2020-11-18 to 2020-12-02 Sprint

#5 Updated by Lucas Di Pentima 5 months ago

As commented on https://dev.arvados.org/issues/13494#note-59, We'll be avoiding offering the "add to favorites" action on past versions as it isn't supported by the API server.

#6 Updated by Lucas Di Pentima 5 months ago

Updates at arvados-workbench2|673bf2ac - branch 17098-old-version-as-head
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/193/

  • Refactored a function that is used to decide which kind of context menu to show. Its was being called differently from several places, sometimes returning inconsistent values.
  • Added 'Recover version' action for old collection versions.
  • Avoid offering the 'Add to favorites' action on old collection versions.
  • Updated tests.

#7 Updated by Lucas Di Pentima 5 months ago

Updates at arvados-workbench2|adc0008e
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/196/

  • Merged latest master
  • Adjusted latest's master code on the refactored function.

#8 Updated by Peter Amstutz 5 months ago

How hard would it be to add a confirmation dialog? Someone might select the action not knowing what it does. The confirmation dialog could also explain that this command makes it the new "head" version, but if they want a copy to work on without modifying "head", they should use "make a copy".

#9 Updated by Peter Amstutz 5 months ago

Also, I don't want to get sidetracked on this, but the menu item ordering is odd.

I know that Danny changed it so the menu items are sorted alphabetically. This isn't optimal but at least it is consistent. However, the actions on the "current" version "Advanced"..."Share" sorted and then starts over with "Add to favorites"..."View details".

The whole thing should be sorted together.

Although, a better way to do this would be to create a master ordered list of actions (with similar actions grouped together intentionally) and adjust the ordering the items in each specific action menu from the position in the master list. Then we would get both consistent ordering and the ability to manually specify ordering to reflect categories or frequency of use.

#10 Updated by Lucas Di Pentima 5 months ago

Peter Amstutz wrote:

How hard would it be to add a confirmation dialog? Someone might select the action not knowing what it does. The confirmation dialog could also explain that this command makes it the new "head" version, but if they want a copy to work on without modifying "head", they should use "make a copy".

Confirmation dialog added at arvados-workbench2|b115fc74
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/198/

#11 Updated by Lucas Di Pentima 5 months ago

Peter Amstutz wrote:

Also, I don't want to get sidetracked on this, but the menu item ordering is odd.

I know that Danny changed it so the menu items are sorted alphabetically. This isn't optimal but at least it is consistent. However, the actions on the "current" version "Advanced"..."Share" sorted and then starts over with "Add to favorites"..."View details".

The whole thing should be sorted together.

Although, a better way to do this would be to create a master ordered list of actions (with similar actions grouped together intentionally) and adjust the ordering the items in each specific action menu from the position in the master list. Then we would get both consistent ordering and the ability to manually specify ordering to reflect categories or frequency of use.

I've checked the code that does the sorting and it's correct in the sense that the sorting is done by action's names. Usually action's names are the same as the text being displayed on the context menu, but sometimes (on "toggle" type actions) the displayed text changes (example: Add/Remove to/from favorites) so in those cases the action's name is usually "ToggleActionType" and gets ordered by that.

#12 Updated by Peter Amstutz 5 months ago

Lucas Di Pentima wrote:

Peter Amstutz wrote:

How hard would it be to add a confirmation dialog? Someone might select the action not knowing what it does. The confirmation dialog could also explain that this command makes it the new "head" version, but if they want a copy to work on without modifying "head", they should use "make a copy".

Confirmation dialog added at arvados-workbench2|b115fc74
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/198/

  1. I prefer the word "Restore" (which means to put something back) instead of "Recover" (which means to get something that was lost). So the menu item would be "Restore version".
  2. Change the dialog text a little bit:
    "This will copy the content of the selected version to the head. To make a new collection with the content of the selected version, use 'Make a copy' instead."

#13 Updated by Lucas Di Pentima 5 months ago

Updates at arvados-workbench2|936570fa
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/199/

  • Renamed "recover version" to "restore version".
  • Changed the dialog's text.
  • Updated the integration test.

#14 Updated by Peter Amstutz 5 months ago

Lucas Di Pentima wrote:

Updates at arvados-workbench2|936570fa
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/199/

  • Renamed "recover version" to "restore version".
  • Changed the dialog's text.
  • Updated the integration test.

Seem to be having a tough run of failing tests on jenkins, but otherwise this LGTM.

#16 Updated by Anonymous 5 months ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Resolved

#17 Updated by Peter Amstutz 2 months ago

  • Release changed from 31 to 37

Also available in: Atom PDF