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";
+import { getInlineFileUrl, sanitizeToken, isInlineFileUrlSafe } from "./helpers";
const mapStateToProps = (state: RootState) => {
const { resource } = state.contextMenu;
ContextMenuKind.COLLECTION_DIRECTORY_ITEM,
ContextMenuKind.READONLY_COLLECTION_DIRECTORY_ITEM ].indexOf(resource.menuKind as ContextMenuKind) > -1) {
const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
- if (file) {
+ const shouldShowInlineUrl = isInlineFileUrlSafe(
+ file ? file.url : "",
+ state.auth.config.keepWebServiceUrl,
+ state.auth.config.keepWebInlineServiceUrl
+ ) || state.auth.config.clusterConfig.Collections.TrustAllContent;
+ if (file && shouldShowInlineUrl) {
const fileUrl = sanitizeToken(getInlineFileUrl(
file.url,
state.auth.config.keepWebServiceUrl,