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

fix: allow / char in name and location #790 #796

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
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