[workbench2] "Open in new tab" shows "cannot serve inline content"
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.
#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
#11 Updated by Lucas Di Pentima about 1 month ago
- At file
src/views-components/details-panel/file-details.tsx:L28we'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
CollectionFileViewerActionso 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
- 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
TrustAllContentis 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?
#13 Updated by Stephen Smith 30 days ago
- 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
#16 Updated by Stephen Smith 29 days ago
- Status changed from In Progress to Resolved
Merged in arvados-workbench2|c2924c3bde785dc609eaff088e96a464426666e6