diff options
Diffstat (limited to 'apps/workflowengine/src')
5 files changed, 50 insertions, 52 deletions
diff --git a/apps/workflowengine/src/components/Checks/FileMimeType.vue b/apps/workflowengine/src/components/Checks/FileMimeType.vue index bd0d80f697c..6817b128e27 100644 --- a/apps/workflowengine/src/components/Checks/FileMimeType.vue +++ b/apps/workflowengine/src/components/Checks/FileMimeType.vue @@ -4,8 +4,7 @@ --> <template> <div> - <NcSelect - :model-value="currentValue" + <NcSelect :model-value="currentValue" :placeholder="t('workflowengine', 'Select a file type')" label="label" :options="options" @@ -31,7 +30,7 @@ </template> </NcSelect> <input v-if="!isPredefined" - :value="currentValue.id" + :value="currentValue.id" type="text" :placeholder="t('workflowengine', 'e.g. httpd/unix-directory')" @input="updateCustom"> @@ -49,6 +48,12 @@ export default { NcEllipsisedOption, NcSelect, }, + props: { + modelValue: { + type: String, + default: '', + }, + }, emits: ['update:model-value'], @@ -79,17 +84,6 @@ export default { newValue: '', } }, - props: { - modelValue: { - type: String, - default: '', - }, - }, - watch: { - modelValue() { - this.updateInternalValue() - }, - }, computed: { options() { return [...this.predefinedTypes, this.customValue] @@ -120,6 +114,11 @@ export default { } }, }, + watch: { + modelValue() { + this.updateInternalValue() + }, + }, methods: { validateRegex(string) { diff --git a/apps/workflowengine/src/components/Checks/RequestTime.vue b/apps/workflowengine/src/components/Checks/RequestTime.vue index 8e1b98a8031..5b1a4ef1cfa 100644 --- a/apps/workflowengine/src/components/Checks/RequestTime.vue +++ b/apps/workflowengine/src/components/Checks/RequestTime.vue @@ -34,18 +34,13 @@ export default { components: { NcSelect, }, - emits: ['update:model-value'], props: { modelValue: { type: String, default: '[]', }, }, - watch: { - modelValue() { - this.updateInternalValue() - }, - }, + emits: ['update:model-value'], data() { return { timezones: zones, @@ -55,9 +50,14 @@ export default { endTime: null, timezone: moment.tz.guess(), }, - stringifiedValue : '[]' + stringifiedValue: '[]', } }, + watch: { + modelValue() { + this.updateInternalValue() + }, + }, beforeMount() { // this is necessary to keep so the value is re-applied when a different // check is being removed. diff --git a/apps/workflowengine/src/components/Checks/RequestURL.vue b/apps/workflowengine/src/components/Checks/RequestURL.vue index 8f34da84fec..21b3a9cacbe 100644 --- a/apps/workflowengine/src/components/Checks/RequestURL.vue +++ b/apps/workflowengine/src/components/Checks/RequestURL.vue @@ -4,8 +4,8 @@ --> <template> <div> - <NcSelect :value="currentValue" - v-model="newValue" + <NcSelect v-model="newValue" + :value="currentValue" :placeholder="t('workflowengine', 'Select a request URL')" label="label" :clearable="false" @@ -46,6 +46,16 @@ export default { mixins: [ valueMixin, ], + props: { + modelValue: { + type: String, + default: '', + }, + operator: { + type: String, + default: '', + }, + }, emits: ['update:model-value'], @@ -61,16 +71,6 @@ export default { ], } }, - props: { - modelValue: { - type: String, - default: '', - }, - operator: { - type: String, - default: '', - }, - }, computed: { options() { return [...this.predefinedTypes, this.customValue] diff --git a/apps/workflowengine/src/components/Checks/RequestUserAgent.vue b/apps/workflowengine/src/components/Checks/RequestUserAgent.vue index 8388eed821d..825a112f6fc 100644 --- a/apps/workflowengine/src/components/Checks/RequestUserAgent.vue +++ b/apps/workflowengine/src/components/Checks/RequestUserAgent.vue @@ -24,8 +24,8 @@ </template> </NcSelect> <input v-if="!isPredefined" - type="text" v-model="newValue" + type="text" @input="updateCustom"> </div> </template> @@ -41,7 +41,6 @@ export default { NcEllipsisedOption, NcSelect, }, - emits: ['update:model-value'], mixins: [ valueMixin, ], @@ -49,8 +48,9 @@ export default { modelValue: { type: String, default: '', - } + }, }, + emits: ['update:model-value'], data() { return { newValue: '', @@ -81,7 +81,7 @@ export default { } }, currentValue: { - get: function() { + get() { if (this.matchingPredefined) { return this.matchingPredefined } @@ -91,9 +91,9 @@ export default { id: this.newValue, } }, - set: function(value) { + set(value) { this.newValue = value - } + }, }, }, methods: { diff --git a/apps/workflowengine/src/components/Checks/RequestUserGroup.vue b/apps/workflowengine/src/components/Checks/RequestUserGroup.vue index e53a8309b47..978732aed09 100644 --- a/apps/workflowengine/src/components/Checks/RequestUserGroup.vue +++ b/apps/workflowengine/src/components/Checks/RequestUserGroup.vue @@ -10,11 +10,10 @@ :loading="status.isLoading && groups.length === 0" :placeholder="t('workflowengine', 'Type to search for group …')" :options="groups" - :model-value="currentValue" + :model-value="currentValue" label="displayname" @search="searchAsync" - @input="update" - /> + @input="update" /> </div> </template> @@ -45,6 +44,7 @@ export default { default: () => { return {} }, }, }, + emits: ['update:model-value'], data() { return { groups, @@ -54,12 +54,17 @@ export default { }, computed: { currentValue: { - get: function () { + get() { return this.groups.find(group => group.id === this.newValue) || null }, - set: function (value) { + set(value) { this.newValue = value - } + }, + }, + }, + watch: { + modelValue() { + this.updateInternalValue() }, }, async mounted() { @@ -72,12 +77,6 @@ export default { await this.searchAsync(this.newValue) } }, - emits: ['update:model-value'], - watch: { - modelValue() { - this.updateInternalValue() - }, - }, methods: { t, @@ -111,7 +110,7 @@ export default { update(value) { this.newValue = value.id this.$emit('update:model-value', this.newValue) - } + }, }, } </script> |