projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '17415-Mountainduck-Bookmark-files'
[arvados.git]
/
src
/
views-components
/
context-menu
/
actions
/
collection-file-viewer-action.tsx
diff --git
a/src/views-components/context-menu/actions/collection-file-viewer-action.tsx
b/src/views-components/context-menu/actions/collection-file-viewer-action.tsx
index f75da23869666e248fe1f04d91cd0e500f0e1a21..aba355346bdbdf5fa9398a08d3faa53cd963818c 100644
(file)
--- a/
src/views-components/context-menu/actions/collection-file-viewer-action.tsx
+++ b/
src/views-components/context-menu/actions/collection-file-viewer-action.tsx
@@
-7,23
+7,28
@@
import { RootState } from "../../../store/store";
import { FileViewerAction } from '~/views-components/context-menu/actions/file-viewer-action';
import { getNodeValue } from "~/models/tree";
import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
import { FileViewerAction } from '~/views-components/context-menu/actions/file-viewer-action';
import { getNodeValue } from "~/models/tree";
import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
+import { getInlineFileUrl, sanitizeToken } from "./helpers";
const mapStateToProps = (state: RootState) => {
const { resource } = state.contextMenu;
const currentCollectionUuid = state.collectionPanel.item ? state.collectionPanel.item.uuid : '';
const mapStateToProps = (state: RootState) => {
const { resource } = state.contextMenu;
const currentCollectionUuid = state.collectionPanel.item ? state.collectionPanel.item.uuid : '';
- if (resource && resource.menuKind === ContextMenuKind.COLLECTION_FILES_ITEM) {
+ if (resource && (
+ resource.menuKind === ContextMenuKind.COLLECTION_FILES_ITEM ||
+ resource.menuKind === ContextMenuKind.READONLY_COLLECTION_FILES_ITEM)) {
const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
if (file) {
const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
if (file) {
+ const fileUrl = sanitizeToken(getInlineFileUrl(
+ file.url,
+ state.auth.config.keepWebServiceUrl,
+ state.auth.config.keepWebInlineServiceUrl), true);
return {
return {
- href: file
.url.replace(state.auth.config.keepWebServiceUrl, state.auth.config.keepWebInlineServiceUrl)
,
+ href: file
Url
,
kind: 'file',
currentCollectionUuid
};
}
kind: 'file',
currentCollectionUuid
};
}
- } else {
- return;
}
}
- return;
+ return
{}
;
};
export const CollectionFileViewerAction = connect(mapStateToProps)(FileViewerAction);
};
export const CollectionFileViewerAction = connect(mapStateToProps)(FileViewerAction);