Feature #16005
closedAllow opening Projects and Collections in new Tab
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
Updated by Peter Amstutz about 4 years ago
- Target version set to 2020-09-23 Sprint
Updated by Peter Amstutz about 4 years ago
- Assigned To deleted (
Daniel Kutyła) - Description updated (diff)
Updated by Peter Amstutz about 4 years ago
- Target version changed from 2020-09-23 Sprint to 2020-10-07 Sprint
Updated by Peter Amstutz about 4 years ago
- Target version changed from 2020-10-07 Sprint to 2020-10-21 Sprint
Updated by Peter Amstutz almost 4 years ago
- Status changed from New to In Progress
Updated by Peter Amstutz almost 4 years ago
- Target version changed from 2020-10-21 Sprint to 2020-11-04 Sprint
Updated by Daniel Kutyła almost 4 years ago
New version first commit: https://dev.arvados.org/projects/arvados-workbench-2/repository/revisions/3e39b2f9179e12766ca1728111b34b2e50cb6ba2
Test run: developer-tests-workbench2: #141
First working impl
Updated by Peter Amstutz almost 4 years ago
- Target version changed from 2020-11-04 Sprint to 2020-11-18
Updated by Peter Amstutz almost 4 years ago
- File project-context-menu.png project-context-menu.png added
- File collection-context-menu.png collection-context-menu.png added
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:
Updated by Daniel Kutyła almost 4 years ago
New version first commit: https://dev.arvados.org/projects/arvados-workbench-2/repository/revisions/e68abc853505067c316d8ae8588a562b385e93e1
Test run: developer-tests-workbench2: #164
First working impl
Updated by Daniel Kutyła almost 4 years ago
New version first commit: https://dev.arvados.org/projects/arvados-workbench-2/repository/revisions/b1a33418fbebefb360278baa97caebcfcbe53f31
Test run: developer-tests-workbench2: #169
Fix for url being copied to the clipboard
Updated by Peter Amstutz almost 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.
Updated by Daniel Kutyła almost 4 years ago
- % Done changed from 0 to 100
- Status changed from In Progress to Resolved
Applied in changeset arvados:arvados-workbench2|d5b2ea063f46c087ddbfb53ccfc066ecba209c7f.