Project

General

Profile

Actions

Feature #16005

closed

Allow opening Projects and Collections in new Tab

Added by Moritz Gilsdorf almost 5 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Target version:
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.


Files

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 1 (0 open1 closed)

Arvados - Task #16822: Review 16005-allow-opening-projects-and-collections-in-new-tabResolvedDaniel Kutyła10/30/2020Actions
Actions #1

Updated by Moritz Gilsdorf almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by Peter Amstutz about 4 years ago

  • Release changed from 20 to 31
Actions #3

Updated by Peter Amstutz about 4 years ago

  • Target version set to 2020-09-23 Sprint
Actions #4

Updated by Peter Amstutz about 4 years ago

  • Assigned To set to Daniel Kutyła
Actions #5

Updated by Peter Amstutz about 4 years ago

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

Updated by Peter Amstutz about 4 years ago

  • Assigned To set to Daniel Kutyła
Actions #7

Updated by Peter Amstutz about 4 years ago

  • Description updated (diff)
Actions #8

Updated by Peter Amstutz about 4 years ago

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

Updated by Peter Amstutz about 4 years ago

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

Updated by Peter Amstutz about 4 years ago

  • Description updated (diff)
Actions #11

Updated by Peter Amstutz about 4 years ago

  • Status changed from New to In Progress
Actions #12

Updated by Peter Amstutz about 4 years ago

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

Updated by Peter Amstutz about 4 years ago

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

Updated by Peter Amstutz about 4 years 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:

 

Actions #18

Updated by Peter Amstutz about 4 years 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.

Actions #19

Updated by Daniel Kutyła about 4 years ago

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

Updated by Peter Amstutz about 4 years ago

  • Release changed from 31 to 36
Actions

Also available in: Atom PDF