Feature #16005

Allow opening Projects and Collections in new Tab

Added by Moritz Gilsdorf over 1 year ago. Updated 5 months ago.

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

100%

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

Description

In the left tree view and in the project view, when right-clicking to get a context menu for a project or collection, the menu should include "open in new tab" and "copy link to clipboard" options.

Use a storage event to communicate the session to the new tab https://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/

When opening a new tab, it should pass the current API token to the new tab (this is important when using session storage for the token to avoid having to log in again).

When copying link to clipboard, it should include an API token.

Original description

The Workbench2 UI overrides the browser context menus when right clicking a project or collection in the tree or table view. This makes it complicated to open a project or collection in a new tab or window.

Maybe we can add the same mechanism as in the collections file listing to open files with customisable actions also to the projects/collections context menu. This could allow e.g. to open them in new tabs/windows or maybe copy urls to the clipboard.

collection-context-menu.png (30.3 KB) collection-context-menu.png Peter Amstutz, 11/04/2020 10:16 PM
project-context-menu.png (33 KB) project-context-menu.png Peter Amstutz, 11/04/2020 10:16 PM

Subtasks

Arvados - Task #16822: Review 16005-allow-opening-projects-and-collections-in-new-tabResolvedDaniel Kutyła

Associated revisions

Revision d5b2ea06
Added by Daniel Kutyła 5 months ago

Merge branch '16005-collections-projects-open-in-new-tab'
closes #16005

Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <>

History

#1 Updated by Moritz Gilsdorf over 1 year ago

  • Description updated (diff)

#2 Updated by Peter Amstutz 7 months ago

  • Release changed from 20 to 31

#3 Updated by Peter Amstutz 7 months ago

  • Target version set to 2020-09-23 Sprint

#4 Updated by Peter Amstutz 7 months ago

  • Assigned To set to Daniel Kutyła

#5 Updated by Peter Amstutz 7 months ago

  • Assigned To deleted (Daniel Kutyła)
  • Description updated (diff)

#6 Updated by Peter Amstutz 7 months ago

  • Assigned To set to Daniel Kutyła

#7 Updated by Peter Amstutz 7 months ago

  • Description updated (diff)

#8 Updated by Peter Amstutz 7 months ago

  • Target version changed from 2020-09-23 Sprint to 2020-10-07 Sprint

#9 Updated by Peter Amstutz 6 months ago

  • Target version changed from 2020-10-07 Sprint to 2020-10-21 Sprint

#10 Updated by Peter Amstutz 6 months ago

  • Description updated (diff)

#11 Updated by Peter Amstutz 6 months ago

  • Status changed from New to In Progress

#12 Updated by Peter Amstutz 6 months ago

  • Target version changed from 2020-10-21 Sprint to 2020-11-04 Sprint

#14 Updated by Peter Amstutz 6 months ago

  • Target version changed from 2020-11-04 Sprint to 2020-11-18

#15 Updated by Peter Amstutz 6 months ago

Reviewing 16005-allow-opening-projects-and-collections-in-new-tab @ arvados-workbench2|85a89af1e635a1f791eaf5ee68cb31552f23bd1a

The basic "open in new tab" functionality seems to work for projects and collections.

The story description included a "copy link to clipboard" feature which is missing from this branch.(1

The current approach feels awkward. When I tried it, the new tab loads, flickers, shows a spinner, flickers, and then finally shows the correct panel, and this all takes 5 or more seconds. It isn't a good user experience

In openInNewTabAction() I don't understand why it needs to do

storeRedirects(url);
window.open(window.location.origin, '_blank');

Why can't it just do something like:

window.open(url, '_blank');

I also don't understand the benefit of saving the redux state to local store. If it allowed the new tab to use cached data from the original state object that might make sense but it doesn't seem like it is happening here.

If I open a new tab, it should already be able to get the token from local storage (there's an apiToken entry), so it doesn't need the whole redux state.

However, if we are using session storage to hold the token more securely (so it does not persist after the tab is closed) then we need to be able to hand it off to the new tab. This was actually one of the motivations for this story. An easy thing would be to do this:

url = `/collections/${uuid}?api_token=${token}`;

This would require checking for and removing the "api_token" parameter from the URL bar, but I think we had already talked about doing this.

I had also put a link in the description to another strategy that uses a 'storage' event to communicate between tabs, which avoids flickering the token on screen: https://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/

The last thing I noticed, the order of the items in the project and collection context menus is inconsistent, which is pretty confusing:

 

#18 Updated by Peter Amstutz 5 months ago

Reviewing 16005-collections-projects-open-in-new-tab @ arvados-workbench2|b1a33418fbebefb360278baa97caebcfcbe53f31

Is src/common/copy-store.ts being used for anything? If not, can it be deleted?

It seems like the code related to REDIRECT_TO_APPLY_TO_PATH isn't being used any more. Can that be deleted?

The rest LGTM.

#19 Updated by Daniel Kutyła 5 months ago

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

#20 Updated by Peter Amstutz 5 months ago

  • Release changed from 31 to 36

Also available in: Atom PDF