mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix(workflowengine): adapt check operator RequestUserAgent to use web component
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
f88ea21ddc
commit
22cdc6da81
2 changed files with 27 additions and 15 deletions
|
|
@ -4,7 +4,7 @@
|
|||
-->
|
||||
<template>
|
||||
<div>
|
||||
<NcSelect :value="currentValue"
|
||||
<NcSelect v-model="currentValue"
|
||||
:placeholder="t('workflowengine', 'Select a user agent')"
|
||||
label="label"
|
||||
:options="options"
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
</NcSelect>
|
||||
<input v-if="!isPredefined"
|
||||
type="text"
|
||||
:value="currentValue.id"
|
||||
v-model="newValue"
|
||||
@input="updateCustom">
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -41,9 +41,16 @@ export default {
|
|||
NcEllipsisedOption,
|
||||
NcSelect,
|
||||
},
|
||||
emits: ['update:model-value'],
|
||||
mixins: [
|
||||
valueMixin,
|
||||
],
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
newValue: '',
|
||||
|
|
@ -73,14 +80,19 @@ export default {
|
|||
id: '',
|
||||
}
|
||||
},
|
||||
currentValue() {
|
||||
if (this.matchingPredefined) {
|
||||
return this.matchingPredefined
|
||||
}
|
||||
return {
|
||||
icon: 'icon-settings-dark',
|
||||
label: t('workflowengine', 'Custom user agent'),
|
||||
id: this.newValue,
|
||||
currentValue: {
|
||||
get: function() {
|
||||
if (this.matchingPredefined) {
|
||||
return this.matchingPredefined
|
||||
}
|
||||
return {
|
||||
icon: 'icon-settings-dark',
|
||||
label: t('workflowengine', 'Custom user agent'),
|
||||
id: this.newValue,
|
||||
}
|
||||
},
|
||||
set: function(value) {
|
||||
this.newValue = value
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -94,12 +106,12 @@ export default {
|
|||
// TODO: check if value requires a regex and set the check operator according to that
|
||||
if (value !== null) {
|
||||
this.newValue = value.id
|
||||
this.$emit('input', this.newValue)
|
||||
this.$emit('update:model-value', this.newValue)
|
||||
}
|
||||
},
|
||||
updateCustom(event) {
|
||||
this.newValue = event.target.value
|
||||
this.$emit('input', this.newValue)
|
||||
updateCustom() {
|
||||
this.newValue = this.currentValue.id
|
||||
this.$emit('update:model-value', this.newValue)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const RequestChecks = [
|
|||
{ operator: 'matches', name: t('workflowengine', 'matches') },
|
||||
{ operator: '!matches', name: t('workflowengine', 'does not match') },
|
||||
],
|
||||
component: RequestUserAgent,
|
||||
element: registerCustomElement(RequestUserAgent, 'oca-workflowengine-checks-request_user_agent'),
|
||||
},
|
||||
{
|
||||
class: 'OCA\\WorkflowEngine\\Check\\UserGroupMembership',
|
||||
|
|
|
|||
Loading…
Reference in a new issue