summaryrefslogtreecommitdiff
path: root/frontend/views/index/components/graph.form.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/views/index/components/graph.form.js')
-rw-r--r--frontend/views/index/components/graph.form.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend/views/index/components/graph.form.js b/frontend/views/index/components/graph.form.js
index 50f9773..d90b663 100644
--- a/frontend/views/index/components/graph.form.js
+++ b/frontend/views/index/components/graph.form.js
@@ -41,11 +41,15 @@ export default class GraphForm extends Component {
if (errorFields.has(name)) {
errorFields.delete(name)
}
+ let sanitizedValue = value
+ if (name === 'path') {
+ sanitizedValue = sanitizedValue.toLowerCase().replace(/ /, '-').replace(/[!@#$%^&*()[\]{}]/, '-').replace(/-+/, '-')
+ }
this.setState({
errorFields,
data: {
...this.state.data,
- [name]: value,
+ [name]: sanitizedValue,
}
})
}