Bug #15159

[workbench2] "Open in new tab" shows "cannot serve inline content"

Added by Chrystian Klingenberg over 2 years ago. Updated 26 days ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Start date:
08/16/2021
Due date:
% Done:

100%

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

Description

When Arvados is configured without wildcard dns/ssl for keep-web, the "open in new tab" option in the three-dot menus to the right of file names in a collection shows this error message in a new tab:

cannot serve inline content at this URL (possible configuration error; see https://doc.arvados.org/install/install-keep-web.html#dns)"

In this configuration, Arvados can not do inline previews due to CORS; download of the file remains possible.

If showing the file in a new tab is not possible, just remove the "open in a new tab" option when Arvados is running in this configuration (only!).

Inline content works when one of these are true:

  • There is a wildcard '*' in the WebDAV ExternalURL
  • Collections.TrustAllContent is true

Collections.TrustAllContent configuration needs to be exported.


Subtasks

Arvados - Task #17975: Review 15159-disable-open-in-new-tab-when-cannot-serve-inlineResolvedLucas Di Pentima

Associated revisions

Revision c2924c3b
Added by Stephen Smith 29 days ago

Merge branch '15159-disable-open-in-new-tab-when-cannot-serve-inline' into main. Closes #15159

Arvados-DCO-1.1-Signed-off-by: Stephen Smith <>

Revision e1df29a3
Added by Stephen Smith 29 days ago

Merge branch '15159-export-trustallcontent' into main. Closes #15159

Arvados-DCO-1.1-Signed-off-by: Stephen Smith <>

History

#1 Updated by Chrystian Klingenberg over 2 years ago

  • Target version changed from Backlog Q1, Q2 to Workbench2 Q3, Q4

#2 Updated by Peter Amstutz over 1 year ago

  • Release set to 20
  • Target version deleted (Workbench2 Q3, Q4)

#3 Updated by Ward Vandewege about 2 months ago

  • Target version set to 2021-08-18 sprint
  • Description updated (diff)
  • Subject changed from [Data operations] "Open in new tab" is downloading on c97qk to [workbench2] "Open in new tab" shows "cannot serve inline content"

#4 Updated by Ward Vandewege about 2 months ago

  • Release changed from 20 to 41

#5 Updated by Peter Amstutz about 2 months ago

  • Target version changed from 2021-08-18 sprint to 2021-09-01 sprint

#6 Updated by Peter Amstutz about 2 months ago

  • Target version changed from 2021-09-01 sprint to 2021-08-18 sprint

#7 Updated by Peter Amstutz about 2 months ago

  • Description updated (diff)

#8 Updated by Peter Amstutz about 2 months ago

  • Assigned To set to Stephen Smith

#9 Updated by Stephen Smith about 1 month ago

  • Status changed from New to In Progress

#10 Updated by Stephen Smith about 1 month ago

Changes at arvados-workbench2|1f30af2350ce0ef9b7a0c40d7c931a7ff9c2cc6c branch 15159-disable-open-in-new-tab-when-cannot-serve-inline
and commit:arvados|f41684bd6aef3b1a9683edc64d5d95669a392853 branch 15159-export-trustallcontent

Tests: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/468/

#11 Updated by Lucas Di Pentima about 1 month ago

Some comments:

  • At file src/views-components/details-panel/file-details.tsx:L28 we're showing inline image previews that will need to be skipped when appropriate.
  • Do you think it would be good to do some unit testing on CollectionFileViewerAction so that we can test both ways the 'Open in new tab' menu item (when it should and shouldn't appear)? I believe this could be done by mocking the state as we do for example in src/views-components/data-explorer/renderers.test.tsx
  • The removed assertions on the Cypress test I think should be replaced with some check on the cluster config and a negated assertion: instead of removing the assertions, request the cluster config and assert that TrustAllContent is false and also no '*' char is present on the appropriate config URL, and assert that the menu item isn't there. This way we wouldn't be removing a check but updating it making sure the new changes work as intended (or at least one of the cases, that's why I think unit testing all the cases is convenient). Do you agree?

#12 Updated by Peter Amstutz about 1 month ago

  • Target version changed from 2021-08-18 sprint to 2021-09-01 sprint

#13 Updated by Stephen Smith 30 days ago

Changes at arvados-workbench2|1303689480b4e7df4d9d998a79c9c689453abc35

Tests: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/469/

  • Added a showPreview flag to file-details getDetails, I changed the function signature to take an object to avoid having to match the position of the arguments when TabNr isn't being passed in
  • Added jest test with a mock store testing the insecure case, trustallcontent=true, and wildcard in inline url cases
  • Changed cypress tests to check TrustAllContent, for wildcard in inline url, and make sure open in new tab is not present

#14 Updated by Lucas Di Pentima 30 days ago

This LGTM, thanks!

#15 Updated by Peter Amstutz 29 days ago

  • Release deleted (41)

#16 Updated by Stephen Smith 29 days ago

  • Status changed from In Progress to Resolved

Merged in arvados-workbench2|c2924c3bde785dc609eaff088e96a464426666e6
and commit:arvados|e1df29a3d682b28400ca35e490aa4a95aa564246

#17 Updated by Peter Amstutz 29 days ago

  • Release set to 41

Also available in: Atom PDF