box / box/box-ui-elements

Box Content Preview - Cannot override the staticHost in contentPreviewProps

Open
#806 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
551
Forks
351
Avg merge
5d 9h
Merged PRs (30d)
31

Description

**Environment:**
- Elements version:
-- Content Preview: 1.60.0

**Desktop (please complete the following information):**
- OS: macOS 10.12.6
- Browser Chrome 71

**Steps to reproduce the problem:**
1. Instantiate a new Box.Preview() instance.
2. Modify the `staticHost`, `staticPath`, and `previewLibraryVersion` params
3. Verify that that the Content Preview element is retrieving the preview.js from the new staticHost and not https://cdn01.boxcdn.net

**What is the expected behavior?**
The Content Preview UI Element concatenates a new path leveraging the overridden staticHost, staticPath, and previewLibraryVersion props.

**What went wrong?**
The Content Preview UI Element ignores the overridden staticHost and uses `https://cdn01.boxcdn.net`

**Sample Code**
```
this.boxContentExplorer = explorer.show(rootFolderId, downscopedToken, {
container: explorerContainer,
autoFocus: true,
canPreview: true,
canDownload: true,
canUpload: true,
canCreateNewFolder: true,
canDelete: true,
canRename: true,
canShare: true,
canSetShareAccess: true,
contentPreviewProps: {
staticHost: 'https://www.myfakecdn.com',
staticPath: 'super/awesome/path/preview',
previewLibraryVersion: '1.60.0'
}
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.