Commit d5384123 authored by Ray Schamp's avatar Ray Schamp

WIP: configure GUI for staging

parent a19fb29f
...@@ -18,11 +18,21 @@ env: ...@@ -18,11 +18,21 @@ env:
- API_HOST_VAR=API_HOST_$TRAVIS_BRANCH - API_HOST_VAR=API_HOST_$TRAVIS_BRANCH
- API_HOST=${!API_HOST_VAR} - API_HOST=${!API_HOST_VAR}
- API_HOST=${API_HOST:-$API_HOST_STAGING} - API_HOST=${API_HOST:-$API_HOST_STAGING}
- ASSET_HOST_master=https://assets.scratch.mit.edu
- ASSET_HOST_STAGING=https://assets.scratch.ly
- ASSET_HOST_VAR=ASSET_HOST_$TRAVIS_BRANCH
- ASSET_HOST=${!ASSET_HOST_VAR}
- ASSET_HOST=${ASSET_HOST:-$ASSET_HOST_STAGING}
- ROOT_URL_master=https://scratch.mit.edu - ROOT_URL_master=https://scratch.mit.edu
- ROOT_URL_STAGING=https://scratch.ly - ROOT_URL_STAGING=https://scratch.ly
- ROOT_URL_VAR=ROOT_URL_$TRAVIS_BRANCH - ROOT_URL_VAR=ROOT_URL_$TRAVIS_BRANCH
- ROOT_URL=${!ROOT_URL_VAR} - ROOT_URL=${!ROOT_URL_VAR}
- ROOT_URL=${ROOT_URL:-$ROOT_URL_STAGING} - ROOT_URL=${ROOT_URL:-$ROOT_URL_STAGING}
- PROJECT_HOST_master=https://projects.scratch.mit.edu
- PROJECT_HOST_STAGING=https://projects.scratch.ly
- PROJECT_HOST_VAR=PROJECT_HOST_$TRAVIS_BRANCH
- PROJECT_HOST=${!PROJECT_HOST_VAR}
- PROJECT_HOST=${PROJECT_HOST:-$PROJECT_HOST_STAGING}
- PATH=$PATH:$PWD/test/integration/node_modules/chromedriver/bin - PATH=$PATH:$PWD/test/integration/node_modules/chromedriver/bin
- AWS_ACCESS_KEY_ID=$EB_AWS_ACCESS_KEY_ID - AWS_ACCESS_KEY_ID=$EB_AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$EB_AWS_SECRET_ACCESS_KEY - AWS_SECRET_ACCESS_KEY=$EB_AWS_SECRET_ACCESS_KEY
......
...@@ -28,6 +28,7 @@ const projectShape = require('./projectshape.jsx').projectShape; ...@@ -28,6 +28,7 @@ const projectShape = require('./projectshape.jsx').projectShape;
require('./preview.scss'); require('./preview.scss');
const PreviewPresentation = ({ const PreviewPresentation = ({
assetHost,
backpackOptions, backpackOptions,
comments, comments,
editable, editable,
...@@ -41,6 +42,7 @@ const PreviewPresentation = ({ ...@@ -41,6 +42,7 @@ const PreviewPresentation = ({
loveCount, loveCount,
originalInfo, originalInfo,
parentInfo, parentInfo,
projectHost,
projectId, projectId,
projectInfo, projectInfo,
remixes, remixes,
...@@ -125,11 +127,13 @@ const PreviewPresentation = ({ ...@@ -125,11 +127,13 @@ const PreviewPresentation = ({
<div className="guiPlayer"> <div className="guiPlayer">
<IntlGUI <IntlGUI
isPlayerOnly isPlayerOnly
assetHost={assetHost}
backpackOptions={backpackOptions} backpackOptions={backpackOptions}
basePath="/" basePath="/"
className="guiPlayer" className="guiPlayer"
isFullScreen={isFullScreen} isFullScreen={isFullScreen}
previewInfoVisible="false" previewInfoVisible="false"
projectHost={projectHost}
projectId={projectId} projectId={projectId}
/> />
</div> </div>
...@@ -351,6 +355,7 @@ const PreviewPresentation = ({ ...@@ -351,6 +355,7 @@ const PreviewPresentation = ({
PreviewPresentation.propTypes = { PreviewPresentation.propTypes = {
addToStudioOpen: PropTypes.bool, addToStudioOpen: PropTypes.bool,
assetHost: PropTypes.string,
backpackOptions: PropTypes.shape({ backpackOptions: PropTypes.shape({
host: PropTypes.string, host: PropTypes.string,
visible: PropTypes.bool visible: PropTypes.bool
...@@ -378,6 +383,7 @@ PreviewPresentation.propTypes = { ...@@ -378,6 +383,7 @@ PreviewPresentation.propTypes = {
onUpdate: PropTypes.func, onUpdate: PropTypes.func,
originalInfo: projectShape, originalInfo: projectShape,
parentInfo: projectShape, parentInfo: projectShape,
projectHost: PropTypes.string,
projectId: PropTypes.string, projectId: PropTypes.string,
projectInfo: projectShape, projectInfo: projectShape,
projectStudios: PropTypes.arrayOf(PropTypes.object), projectStudios: PropTypes.arrayOf(PropTypes.object),
......
...@@ -297,6 +297,7 @@ class Preview extends React.Component { ...@@ -297,6 +297,7 @@ class Preview extends React.Component {
<Page> <Page>
<PreviewPresentation <PreviewPresentation
addToStudioOpen={this.state.addToStudioOpen} addToStudioOpen={this.state.addToStudioOpen}
assetHost={this.props.assetHost}
backpackOptions={backpackOptions} backpackOptions={backpackOptions}
comments={this.props.comments} comments={this.props.comments}
editable={this.state.editable} editable={this.state.editable}
...@@ -310,6 +311,7 @@ class Preview extends React.Component { ...@@ -310,6 +311,7 @@ class Preview extends React.Component {
loved={this.props.loved} loved={this.props.loved}
originalInfo={this.props.original} originalInfo={this.props.original}
parentInfo={this.props.parent} parentInfo={this.props.parent}
projectHost={this.props.projectHost}
projectId={this.state.projectId} projectId={this.state.projectId}
projectInfo={this.props.projectInfo} projectInfo={this.props.projectInfo}
projectStudios={this.props.projectStudios} projectStudios={this.props.projectStudios}
...@@ -335,9 +337,11 @@ class Preview extends React.Component { ...@@ -335,9 +337,11 @@ class Preview extends React.Component {
<IntlGUI <IntlGUI
enableCommunity enableCommunity
hideIntro hideIntro
assetHost={this.props.assetHost}
backpackOptions={backpackOptions} backpackOptions={backpackOptions}
basePath="/" basePath="/"
className="gui" className="gui"
projectHost={this.props.projectHost}
projectId={this.state.projectId} projectId={this.state.projectId}
/> />
); );
...@@ -345,6 +349,7 @@ class Preview extends React.Component { ...@@ -345,6 +349,7 @@ class Preview extends React.Component {
} }
Preview.propTypes = { Preview.propTypes = {
assetHost: PropTypes.string.isRequired,
comments: PropTypes.arrayOf(PropTypes.object), comments: PropTypes.arrayOf(PropTypes.object),
faved: PropTypes.bool, faved: PropTypes.bool,
fullScreen: PropTypes.bool, fullScreen: PropTypes.bool,
...@@ -362,6 +367,7 @@ Preview.propTypes = { ...@@ -362,6 +367,7 @@ Preview.propTypes = {
parent: projectShape, parent: projectShape,
playerMode: PropTypes.bool, playerMode: PropTypes.bool,
projectInfo: projectShape, projectInfo: projectShape,
projectHost: PropTypes.string.isRequired,
projectStudios: PropTypes.arrayOf(PropTypes.object), projectStudios: PropTypes.arrayOf(PropTypes.object),
remixes: PropTypes.arrayOf(PropTypes.object), remixes: PropTypes.arrayOf(PropTypes.object),
replies: PropTypes.objectOf(PropTypes.array), replies: PropTypes.objectOf(PropTypes.array),
...@@ -387,6 +393,8 @@ Preview.propTypes = { ...@@ -387,6 +393,8 @@ Preview.propTypes = {
}; };
Preview.defaultProps = { Preview.defaultProps = {
assetHost: process.env.ASSET_HOST,
projectHost: process.env.PROJECT_HOST,
sessionStatus: sessionActions.Status.NOT_FETCHED, sessionStatus: sessionActions.Status.NOT_FETCHED,
user: {} user: {}
}; };
......
...@@ -165,7 +165,9 @@ module.exports = { ...@@ -165,7 +165,9 @@ module.exports = {
'process.env.NODE_ENV': '"' + (process.env.NODE_ENV || 'development') + '"', 'process.env.NODE_ENV': '"' + (process.env.NODE_ENV || 'development') + '"',
'process.env.SENTRY_DSN': '"' + (process.env.SENTRY_DSN || '') + '"', 'process.env.SENTRY_DSN': '"' + (process.env.SENTRY_DSN || '') + '"',
'process.env.API_HOST': '"' + (process.env.API_HOST || 'https://api.scratch.mit.edu') + '"', 'process.env.API_HOST': '"' + (process.env.API_HOST || 'https://api.scratch.mit.edu') + '"',
'process.env.ASSET_HOST': '"' + (process.env.ASSET_HOST || 'https://assets.scratch.mit.edu') + '"',
'process.env.BACKPACK_HOST': '"' + (process.env.BACKPACK_HOST || 'https://backpack.scratch.mit.edu') + '"', 'process.env.BACKPACK_HOST': '"' + (process.env.BACKPACK_HOST || 'https://backpack.scratch.mit.edu') + '"',
'process.env.PROJECT_HOST': '"' + (process.env.PROJECT_HOST || 'https://projects.scratch.mit.edu') + '"',
'process.env.SCRATCH_ENV': '"' + (process.env.SCRATCH_ENV || 'development') + '"' 'process.env.SCRATCH_ENV': '"' + (process.env.SCRATCH_ENV || 'development') + '"'
}), }),
new webpack.optimize.CommonsChunkPlugin({ new webpack.optimize.CommonsChunkPlugin({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment