Browse Source

Workflow vue cleanup

Signed-off-by: Julius Härtl <jus@bitgrid.net>
tags/v18.0.0beta1
Julius Härtl 4 years ago
parent
commit
7683208dfa
No account linked to committer's email address

+ 2
- 2
apps/workflowengine/src/components/Check.vue 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>

+ 1
- 10
apps/workflowengine/src/components/Checks/FileSystemTag.vue 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
}
this.$emit('input', this.newValue || '')
}
}
}

+ 4
- 7
apps/workflowengine/src/components/Checks/MultiselectTag/MultiselectTag.vue 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
}

+ 1
- 5
apps/workflowengine/src/components/Checks/RequestTime.vue 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)

+ 9
- 8
apps/workflowengine/src/components/Checks/RequestURL.vue 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',

+ 9
- 8
apps/workflowengine/src/components/Checks/RequestUserAgent.vue 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',

+ 2
- 1
apps/workflowengine/src/components/Checks/file.js 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',

Loading…
Cancel
Save