From 3e9de575501fd1945b8341f7a4e3a89b73e3cb03 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 3 Jun 2020 16:47:51 +0200 Subject: getting to the page editor with add tile form --- frontend/views/page/page.container.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'frontend/views/page/page.container.js') 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 {
+ {this.props.graph.editor.editingPage && } {this.props.page.editor.addingTile && } {this.props.page.editor.editingTile && }
@@ -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) -- cgit v1.2.3-70-g09d2