Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
fix: allow / char in name and location #790 (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Oct 19, 2020
1 parent 43601f5 commit a760246
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/components/ControlPanel.vue
Expand Up @@ -679,20 +679,10 @@ export default {
val || this.closeDialog()
},
newName (val) {
var match = val
? val.match(/[a-zA-Z\u00C0-\u024F\u1E00-\u1EFF0-9_-]+/g)
: [val]
this.nameError =
match[0] !== val ? 'Only a-zA-Z0-9_- chars are allowed' : null
this.nameError = this.validateTopic(val)
},
newLoc (val) {
var match = val
? val.match(/[a-zA-Z\u00C0-\u024F\u1E00-\u1EFF0-9_-]+/g)
: [val]
this.locError =
match[0] !== val ? 'Only a-zA-Z0-9_- chars are allowed' : null
this.locError = this.validateTopic(val)
},
selectedNode () {
if (this.selectedNode) {
Expand Down Expand Up @@ -903,6 +893,13 @@ export default {
showSnackbar (text) {
this.$emit('showSnackbar', text)
},
validateTopic (name) {
var match = name
? name.match(/[/a-zA-Z\u00C0-\u024F\u1E00-\u1EFF0-9_-]+/g)
: [name]
return match[0] !== name ? 'Only a-zA-Z0-9_- chars are allowed' : null
},
selectNode (item) {
if (!item) return
Expand Down

0 comments on commit a760246

Please sign in to comment.