|
|
|
@ -73,7 +73,7 @@
|
|
|
|
v-chip(
|
|
|
|
v-chip(
|
|
|
|
v-for='tag of tags'
|
|
|
|
v-for='tag of tags'
|
|
|
|
:key='`tag-` + tag'
|
|
|
|
:key='`tag-` + tag'
|
|
|
|
close
|
|
|
|
:close='hasTagsPermission'
|
|
|
|
label
|
|
|
|
label
|
|
|
|
color='teal'
|
|
|
|
color='teal'
|
|
|
|
text-color='teal lighten-5'
|
|
|
|
text-color='teal lighten-5'
|
|
|
|
@ -84,6 +84,7 @@
|
|
|
|
outlined
|
|
|
|
outlined
|
|
|
|
v-model='newTag'
|
|
|
|
v-model='newTag'
|
|
|
|
:hint='$t(`editor:props.tagsHint`)'
|
|
|
|
:hint='$t(`editor:props.tagsHint`)'
|
|
|
|
|
|
|
|
:disabled='!hasTagsPermission'
|
|
|
|
:items='newTagSuggestions'
|
|
|
|
:items='newTagSuggestions'
|
|
|
|
:loading='$apollo.queries.newTagSuggestions.loading'
|
|
|
|
:loading='$apollo.queries.newTagSuggestions.loading'
|
|
|
|
persistent-hint
|
|
|
|
persistent-hint
|
|
|
|
@ -301,6 +302,7 @@ export default {
|
|
|
|
scriptCss: sync('page/scriptCss'),
|
|
|
|
scriptCss: sync('page/scriptCss'),
|
|
|
|
hasScriptPermission: get('page/effectivePermissions@pages.script'),
|
|
|
|
hasScriptPermission: get('page/effectivePermissions@pages.script'),
|
|
|
|
hasStylePermission: get('page/effectivePermissions@pages.style'),
|
|
|
|
hasStylePermission: get('page/effectivePermissions@pages.style'),
|
|
|
|
|
|
|
|
hasTagsPermission: get('page/effectivePermissions@tags.write'),
|
|
|
|
pageSelectorMode () {
|
|
|
|
pageSelectorMode () {
|
|
|
|
return (this.mode === 'create') ? 'create' : 'move'
|
|
|
|
return (this.mode === 'create') ? 'create' : 'move'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -314,6 +316,10 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
newTag (newValue, oldValue) {
|
|
|
|
newTag (newValue, oldValue) {
|
|
|
|
|
|
|
|
if (!this.hasTagsPermission) {
|
|
|
|
|
|
|
|
this.newTag = null
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
const tagClean = _.trim(newValue || '').toLowerCase()
|
|
|
|
const tagClean = _.trim(newValue || '').toLowerCase()
|
|
|
|
if (tagClean && tagClean.length > 0) {
|
|
|
|
if (tagClean && tagClean.length > 0) {
|
|
|
|
if (!_.includes(this.tags, tagClean)) {
|
|
|
|
if (!_.includes(this.tags, tagClean)) {
|
|
|
|
@ -345,6 +351,9 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
removeTag (tag) {
|
|
|
|
removeTag (tag) {
|
|
|
|
|
|
|
|
if (!this.hasTagsPermission) {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
this.tags = _.without(this.tags, tag)
|
|
|
|
this.tags = _.without(this.tags, tag)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
close() {
|
|
|
|
close() {
|
|
|
|
|