Skip to content

Commit

Permalink
fix: allow / char in name and location OpenZWave#790 (OpenZWave#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored and ahochsteger committed Oct 19, 2020
1 parent 9efcf29 commit 3a76645
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -732,20 +732,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 @@ -1021,6 +1011,13 @@ export default {
'lastActive': (value, search, item) => this.filterNodesDateCol(value, search, item, this.headers[7]),
}
},
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 3a76645

Please sign in to comment.