diff --git a/build.sh b/build.sh index 2ab49259..348ef28c 100755 --- a/build.sh +++ b/build.sh @@ -5,17 +5,12 @@ echo -e Copying assets $SERVER rsync -avrs src/assets/ mopidy_iris/static/assets/ 2>&1 >/dev/null # create HTML files -echo -e Copying index.html and test.html +echo -e Copying index.html cp src/index.html mopidy_iris/static/index.html -cp src/index.html mopidy_iris/static/test.html # process production html -CACHEBUSTER=$(date | md5sum | cut -f1 -d' ') -echo -e Cachebusting js/css URLs $CACHEBUSTER -sed -i 's/app.js/app.min.js?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/index.html -sed -i 's/app.css/app.min.css?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/index.html -sed -i 's/app.js/app.js?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/test.html -sed -i 's/app.css/app.css?cachebuster='$CACHEBUSTER'/g' mopidy_iris/static/test.html -sed -i 's/<\/head>/\t + + diff --git a/src/js/App.js b/src/js/App.js index bbc9dd08..850b8ecb 100755 --- a/src/js/App.js +++ b/src/js/App.js @@ -50,6 +50,10 @@ class App extends React.Component{ this.props.coreActions.startServices() this.props.coreActions.getBroadcasts() + if (this.props.test_mode){ + this.props.uiActions.createNotification('Welcome to test mode! This provides you with additional debug info by using the non-minified code base. See Wiki for more information.','info','TEST_MODE','Test mode enabled',true) + } + // when we navigate to a new route hashHistory.listen( location => { @@ -269,7 +273,8 @@ const mapStateToProps = (state, ownProps) => { dragger: state.ui.dragger, modal: state.ui.modal, context_menu: state.ui.context_menu, - debug_info: state.ui.debug_info + debug_info: state.ui.debug_info, + test_mode: (state.ui.test_mode ? state.ui.test_mode : false) } } diff --git a/src/js/components/DebugInfo.js b/src/js/components/DebugInfo.js index daab3e99..c4d737e4 100755 --- a/src/js/components/DebugInfo.js +++ b/src/js/components/DebugInfo.js @@ -85,7 +85,7 @@ class DebugInfo extends React.Component{ Slim mode: {this.props.ui.slim_mode ? 'on' : 'off'}
- _testMode: {window._testMode ? 'on' : 'off'} + Test mode: {this.props.ui.test_mode ? 'on' : 'off'}
Touch: {helpers.isTouchDevice() ? 'on' : 'off'} diff --git a/src/js/views/Debug.js b/src/js/views/Debug.js index 2bf84b55..33fd09c4 100755 --- a/src/js/views/Debug.js +++ b/src/js/views/Debug.js @@ -62,13 +62,21 @@ class Debug extends React.Component{
Debug
+
@@ -211,6 +219,7 @@ const mapStateToProps = (state, ownProps) => { log_actions: (state.ui.log_actions ? state.ui.log_actions : false), log_pusher: (state.ui.log_pusher ? state.ui.log_pusher : false), log_mopidy: (state.ui.log_mopidy ? state.ui.log_mopidy : false), + test_mode: (state.ui.test_mode ? state.ui.test_mode : false), debug_info: (state.ui.debug_info ? state.ui.debug_info : false), debug_response: state.ui.debug_response }