Skip to content

Commit 15fb5b7

Browse files
committed
Fix remaining comments from #16706
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent c4dfa3e commit 15fb5b7

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

apps/workflowengine/src/components/Check.vue

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,16 @@ export default {
7373
}
7474
},
7575
computed: {
76-
Checks() {
76+
checks() {
7777
return this.$store.getters.getChecksForEntity(this.rule.entity)
7878
},
7979
operators() {
8080
if (!this.currentOption) { return [] }
81-
return this.Checks[this.currentOption.class].operators
81+
return this.checks[this.currentOption.class].operators
8282
},
8383
currentComponent() {
8484
if (!this.currentOption) { return [] }
85-
const currentComponent = this.Checks[this.currentOption.class].component
86-
return currentComponent
85+
return this.checks[this.currentOption.class].component
8786
},
8887
valuePlaceholder() {
8988
if (this.currentOption && this.currentOption.placeholder) {
@@ -98,8 +97,8 @@ export default {
9897
}
9998
},
10099
mounted() {
101-
this.options = Object.values(this.Checks)
102-
this.currentOption = this.Checks[this.check.class]
100+
this.options = Object.values(this.checks)
101+
this.currentOption = this.checks[this.check.class]
103102
this.currentOperator = this.operators.find((operator) => operator.operator === this.check.operator)
104103
},
105104
methods: {
@@ -111,11 +110,7 @@ export default {
111110
},
112111
validate() {
113112
if (this.currentOption && this.currentOption.validate) {
114-
if (this.currentOption.validate(this.check)) {
115-
this.valid = true
116-
} else {
117-
this.valid = false
118-
}
113+
this.valid = !!this.currentOption.validate(this.check);
119114
}
120115
this.$store.dispatch('setValid', { rule: this.rule, valid: this.rule.valid && this.valid })
121116
return this.valid

apps/workflowengine/src/components/Checks/FileSystemTag.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<template>
2424
<MultiselectTag v-model="newValue"
2525
:multiple="false"
26-
label="Select a tag"
26+
label="{{ t('workflowengine', 'Select a tag') }}"
2727
@input="update" />
2828
</template>
2929

apps/workflowengine/src/helpers/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*
2121
*/
22+
const scopeValue = OCP.InitialState.loadState('workflowengine', 'scope') === 0 ? 'global' : 'user'
2223

2324
const getApiUrl = (url) => {
24-
const scopeValue = OCP.InitialState.loadState('workflowengine', 'scope') === 0 ? 'global' : 'user'
2525
return OC.linkToOCS('apps/workflowengine/api/v1/workflows', 2) + scopeValue + url + '?format=json'
2626
}
2727

apps/workflowengine/src/helpers/validators.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*
2121
*/
22+
const regexRegex = /^\/(.*)\/([gui]{0,3})$/
23+
const regexIPv4 = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/
24+
const regexIPv6 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/
2225

2326
const validateRegex = function(string) {
24-
var regexRegex = /^\/(.*)\/([gui]{0,3})$/
25-
var result = regexRegex.exec(string)
27+
const result = regexRegex.exec(string)
2628
return result !== null
2729
}
2830

2931
const validateIPv4 = function(string) {
30-
var regexRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/
31-
var result = regexRegex.exec(string)
32+
const result = regexIPv4.exec(string)
3233
return result !== null
3334
}
3435

3536
const validateIPv6 = function(string) {
36-
var regexRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/
37-
var result = regexRegex.exec(string)
37+
const result = regexIPv6.exec(string)
3838
return result !== null
3939
}
4040

0 commit comments

Comments
 (0)