File tree Expand file tree Collapse file tree
apps/workflowengine/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 v-if =" currentElement"
2424 ref =" checkComponent"
2525 :disabled =" !currentOption"
26- :check =" check"
26+ :operator =" check.operator "
2727 :model-value =" check.value"
2828 class =" option"
2929 @update:model-value =" updateCheck"
@@ -166,7 +166,8 @@ export default {
166166 this .$emit (' validate' , this .valid )
167167 },
168168 updateCheck (event ) {
169- const matchingOperator = this .operators .findIndex ((operator ) => this .check .operator === operator .operator )
169+ const selectedOperator = event ? .operator || this .currentOperator ? .operator || this .check .operator
170+ const matchingOperator = this .operators .findIndex ((operator ) => selectedOperator === operator .operator )
170171 if (this .check .class !== this .currentOption .class || matchingOperator === - 1 ) {
171172 this .currentOperator = this .operators [0 ]
172173 }
Original file line number Diff line number Diff line change 55<template >
66 <div >
77 <NcSelect :value =" currentValue"
8+ v-model =" newValue"
89 :placeholder =" t('workflowengine', 'Select a request URL')"
910 label =" label"
1011 :clearable =" false"
@@ -45,6 +46,9 @@ export default {
4546 mixins: [
4647 valueMixin,
4748 ],
49+
50+ emits: [' update:model-value' ],
51+
4852 data () {
4953 return {
5054 newValue: ' ' ,
@@ -57,12 +61,22 @@ export default {
5761 ],
5862 }
5963 },
64+ props: {
65+ modelValue: {
66+ type: String ,
67+ default: ' ' ,
68+ },
69+ operator: {
70+ type: String ,
71+ default: ' ' ,
72+ },
73+ },
6074 computed: {
6175 options () {
6276 return [... this .predefinedTypes , this .customValue ]
6377 },
6478 placeholder () {
65- if (this .check . operator === ' matches' || this . check .operator === ' !matches' ) {
79+ if (this .operator === ' matches' || this .operator === ' !matches' ) {
6680 return ' /^https\\ :\\ /\\ /localhost\\ /index\\ .php$/i'
6781 }
6882 return ' https://localhost/index.php'
@@ -102,12 +116,12 @@ export default {
102116 // TODO: check if value requires a regex and set the check operator according to that
103117 if (value !== null ) {
104118 this .newValue = value .id
105- this .$emit (' input ' , this .newValue )
119+ this .$emit (' update:model-value ' , this .newValue )
106120 }
107121 },
108122 updateCustom (event ) {
109123 this .newValue = event .target .value
110- this .$emit (' input ' , this .newValue )
124+ this .$emit (' update:model-value ' , this .newValue )
111125 },
112126 },
113127}
Original file line number Diff line number Diff line change 33 * SPDX-License-Identifier: AGPL-3.0-or-later
44 */
55
6+ import { registerCustomElement } from '../../helpers/window.js'
67import RequestUserAgent from './RequestUserAgent.vue'
78import RequestTime from './RequestTime.vue'
89import RequestURL from './RequestURL.vue'
@@ -18,7 +19,7 @@ const RequestChecks = [
1819 { operator : 'matches' , name : t ( 'workflowengine' , 'matches' ) } ,
1920 { operator : '!matches' , name : t ( 'workflowengine' , 'does not match' ) } ,
2021 ] ,
21- component : RequestURL ,
22+ element : registerCustomElement ( RequestURL , 'oca-workflowengine-checks-request_url' ) ,
2223 } ,
2324 {
2425 class : 'OCA\\WorkflowEngine\\Check\\RequestTime' ,
You can’t perform that action at this time.
0 commit comments