Workflow vue cleanup

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-09-10 09:44:20 +02:00
parent 9e0078824e
commit 7683208dfa
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
7 changed files with 28 additions and 41 deletions

View file

@ -14,8 +14,8 @@
<input v-else v-model="check.value" type="text"
:class="{ invalid: !valid }"
:disabled="!currentOption" :placeholder="valuePlaceholder" @input="updateCheck">
<Actions>
<ActionButton v-if="deleteVisible || !currentOption" icon="icon-delete" @click="$emit('remove')" />
<Actions v-if="deleteVisible || !currentOption">
<ActionButton icon="icon-delete" @click="$emit('remove')" />
</Actions>
</div>
</template>

View file

@ -42,7 +42,6 @@ export default {
},
data() {
return {
valid: false,
newValue: []
}
},
@ -62,16 +61,8 @@ export default {
this.newValue = null
}
},
validate() {
return true
},
update() {
if (this.validate()) {
this.$emit('input', this.newValue || '')
this.valid = false
} else {
this.valid = false
}
}
}
}

View file

@ -28,8 +28,7 @@
:custom-label="tagLabel"
class="multiselect-vue" :multiple="multiple"
:close-on-select="false" :tag-width="60"
:disabled="disabled" @input="update"
@search-change="asyncFind">
:disabled="disabled" @input="update">
<span slot="noResult">{{ t('core', 'No results') }}</span>
<template #option="scope">
{{ tagLabel(scope.option) }}
@ -88,11 +87,9 @@ export default {
searchTags().then((result) => {
this.tags = result
this.inputValObjects = this.getValueObject()
})
}).catch(console.error.bind(this))
},
methods: {
asyncFind(query) {
},
getValueObject() {
if (this.tags.length === 0) {
return []
@ -118,10 +115,10 @@ export default {
},
tagLabel({ displayName, userVisible, userAssignable }) {
if (userVisible === false) {
return `${displayName} (invisible)`
return t('systemtags', '%s (invisible)').replace('%s', displayName)
}
if (userAssignable === false) {
return `${displayName} (restricted)`
return t('systemtags', '%s (restricted)').replace('%s', displayName)
}
return displayName
}

View file

@ -30,6 +30,7 @@ export default {
},
data() {
return {
timezones: zones,
valid: false,
newValue: {
startTime: null,
@ -38,11 +39,6 @@ export default {
}
}
},
computed: {
timezones() {
return zones
}
},
methods: {
updateInternalValue(value) {
var data = JSON.parse(value)

View file

@ -81,12 +81,14 @@ export default {
}
return 'https://localhost/index.php'
},
matchingPredefined() {
return this.predefinedTypes
.map(groups => groups.children)
.flat()
.find((type) => this.newValue === type.pattern)
},
isPredefined() {
const matchingPredefined = this.predefinedTypes.map(groups => groups.children).flat().find((type) => this.newValue === type.pattern)
if (matchingPredefined) {
return true
}
return false
return !!this.matchingPredefined
},
customValue() {
return {
@ -101,9 +103,8 @@ export default {
}
},
currentValue() {
const matchingPredefined = this.predefinedTypes.map(groups => groups.children).flat().find((type) => this.newValue === type.pattern)
if (matchingPredefined) {
return matchingPredefined
if (this.matchingPredefined) {
return this.matchingPredefined
}
return {
icon: 'icon-settings-dark',

View file

@ -77,12 +77,14 @@ export default {
options() {
return [...this.predefinedTypes, this.customValue]
},
matchingPredefined() {
return this.predefinedTypes
.map(groups => groups.children)
.flat()
.find((type) => this.newValue === type.pattern)
},
isPredefined() {
const matchingPredefined = this.predefinedTypes.map(groups => groups.children).flat().find((type) => this.newValue === type.pattern)
if (matchingPredefined) {
return true
}
return false
return !!this.matchingPredefined
},
customValue() {
return {
@ -97,9 +99,8 @@ export default {
}
},
currentValue() {
const matchingPredefined = this.predefinedTypes.map(groups => groups.children).flat().find((type) => this.newValue === type.pattern)
if (matchingPredefined) {
return matchingPredefined
if (this.matchingPredefined) {
return this.matchingPredefined
}
return {
icon: 'icon-settings-dark',

View file

@ -20,9 +20,10 @@
*
*/
import FileMimeType from './FileMimeType'
import { stringValidator, validateIPv4, validateIPv6 } from './../../helpers/validators'
import FileMimeType from './FileMimeType'
import FileSystemTag from './FileSystemTag'
const FileChecks = [
{
class: 'OCA\\WorkflowEngine\\Check\\FileName',