diff options
Diffstat (limited to 'frontend/views/page/page.container.js')
| -rw-r--r-- | frontend/views/page/page.container.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/frontend/views/page/page.container.js b/frontend/views/page/page.container.js index 2de56bb..bbb1f3a 100644 --- a/frontend/views/page/page.container.js +++ b/frontend/views/page/page.container.js @@ -8,8 +8,10 @@ import './page.css' import actions from '../../actions' import { Loader } from '../../common' -// import * as uploadActions from './upload.actions' +import * as graphActions from '../graph/graph.actions' +import * as pageActions from './page.actions' +import PageEdit from '../graph/components/page.edit' import TileNew from './components/tile.new' import TileEdit from './components/tile.edit' @@ -37,9 +39,12 @@ class PageContainer extends Component { } load() { actions.site.setSiteTitle("loading " + this.props.match.params.page_name + "...") - actions.page.show('name/' + this.props.match.params.graph_name + '/' + this.props.match.params.page_name) + this.props.pageActions.showGraphAndPageIfUnloaded(this.props.match.params) .then(data => { actions.site.setSiteTitle(data.res.title) + if (!data.res.tiles.length) { + this.props.pageActions.showAddTileForm() + } }) } render() { @@ -61,6 +66,7 @@ class PageContainer extends Component { <PageHeader /> <div className='body'> <PageEditor /> + {this.props.graph.editor.editingPage && <PageEdit />} {this.props.page.editor.addingTile && <TileNew />} {this.props.page.editor.editingTile && <TileEdit />} </div> @@ -75,7 +81,8 @@ const mapStateToProps = state => ({ }) const mapDispatchToProps = dispatch => ({ - // uploadActions: bindActionCreators({ ...uploadActions }, dispatch), + graphActions: bindActionCreators({ ...graphActions }, dispatch), + pageActions: bindActionCreators({ ...pageActions }, dispatch), }) export default connect(mapStateToProps, mapDispatchToProps)(PageContainer) |
