summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/app/sql/models/graph.py2
-rw-r--r--frontend/views/graph/components/page.form.js9
2 files changed, 5 insertions, 6 deletions
diff --git a/cli/app/sql/models/graph.py b/cli/app/sql/models/graph.py
index 129ce6e..88a15ef 100644
--- a/cli/app/sql/models/graph.py
+++ b/cli/app/sql/models/graph.py
@@ -9,8 +9,6 @@ from app.sql.common import db, Base, Session
from app.settings import app_cfg
-from os.path import join
-
class Graph(Base):
"""Table for storing references to graphs"""
__tablename__ = 'graph'
diff --git a/frontend/views/graph/components/page.form.js b/frontend/views/graph/components/page.form.js
index abaf934..ce14e2e 100644
--- a/frontend/views/graph/components/page.form.js
+++ b/frontend/views/graph/components/page.form.js
@@ -5,11 +5,12 @@ import { session } from '../../../session'
import { TextInput, LabelDescription, TextArea, Checkbox, SubmitButton, Loader } from '../../../common'
-const newPage = () => ({
+const newPage = (data) => ({
path: '',
title: '',
username: session('username'),
description: '',
+ ...data,
})
export default class PageForm extends Component {
@@ -21,7 +22,7 @@ export default class PageForm extends Component {
}
componentDidMount() {
- const { data, isNew } = this.props
+ const { graph, data, isNew } = this.props
const title = isNew ? 'new page' : 'editing ' + data.title
const submitTitle = isNew ? "Create Page" : "Save Changes"
this.setState({
@@ -29,8 +30,8 @@ export default class PageForm extends Component {
submitTitle,
errorFields: new Set([]),
data: {
- ...newPage(),
- ...data
+ ...newPage({ graph_id: graph.id }),
+ ...data,
},
})
}