Skip to content

Commit

Permalink
Fix #2778 Embedded doesn't work (#2779)
Browse files Browse the repository at this point in the history
* Added embedded mode in standard app

* Removed map layout reducers/epics
  • Loading branch information
allyoucanmap authored and mbarto committed Mar 28, 2018
1 parent a238a80 commit 10ee325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/client/components/app/StandardApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class StandardApp extends React.Component {
initialActions: PropTypes.array,
appComponent: PropTypes.func,
printingEnabled: PropTypes.bool,
onStoreInit: PropTypes.func
onStoreInit: PropTypes.func,
mode: PropTypes.string
};

static defaultProps = {
Expand Down Expand Up @@ -80,7 +81,7 @@ class StandardApp extends React.Component {
onPersist: onInit.bind(null, config)
}, {
initialState: this.parseInitialState(config.initialState, {
mode: ConfigUtils.getBrowserProperties().mobile ? 'mobile' : 'desktop'
mode: this.props.mode || ConfigUtils.getBrowserProperties().mobile ? 'mobile' : 'desktop'
}) || {defaultState: {}, mobile: {}}
});
this.store = this.props.appStore(this.props.pluginsDef.plugins, opts);
Expand All @@ -98,7 +99,7 @@ class StandardApp extends React.Component {

render() {
const {plugins, requires} = this.props.pluginsDef;
const {pluginsDef, appStore, initialActions, appComponent, ...other} = this.props;
const {pluginsDef, appStore, initialActions, appComponent, mode, ...other} = this.props;
const App = this.props.appComponent;
return this.state.store ?
<Provider store={this.state.store}>
Expand Down
1 change: 1 addition & 0 deletions web/client/product/embedded.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const startApp = () => {
}, {});

const appConfig = {
mode: 'embedded',
storeOpts,
appStore,
pluginsDef,
Expand Down

0 comments on commit 10ee325

Please sign in to comment.