diff --git a/apps/workflowengine/src/components/Check.vue b/apps/workflowengine/src/components/Check.vue
index 8f7fbca286..905c2c989b 100644
--- a/apps/workflowengine/src/components/Check.vue
+++ b/apps/workflowengine/src/components/Check.vue
@@ -3,12 +3,17 @@
-
-
-
+
+
@@ -47,7 +52,7 @@ export default {
currentOption: null,
currentOperator: null,
options: [],
- valid: true,
+ valid: true
}
},
computed: {
@@ -67,6 +72,12 @@ export default {
if (this.currentOption && this.currentOption.placeholder) {
return this.currentOption.placeholder(this.check)
}
+ return ''
+ }
+ },
+ watch: {
+ 'check.operator': function() {
+ this.validate()
}
},
mounted() {
@@ -74,11 +85,6 @@ export default {
this.currentOption = this.Checks[this.check.class]
this.currentOperator = this.operators.find((operator) => operator.operator === this.check.operator)
},
- watch: {
- 'check.operator': function () {
- this.validate()
- }
- },
methods: {
showDelete() {
this.deleteVisible = true
@@ -88,7 +94,7 @@ export default {
},
validate() {
if (this.currentOption && this.currentOption.validate) {
- if(this.currentOption.validate(this.check)) {
+ if (this.currentOption.validate(this.check)) {
this.valid = true
} else {
this.valid = false
diff --git a/apps/workflowengine/src/components/Checks/FileMimeType.vue b/apps/workflowengine/src/components/Checks/FileMimeType.vue
index 02e68db178..a3e3798304 100644
--- a/apps/workflowengine/src/components/Checks/FileMimeType.vue
+++ b/apps/workflowengine/src/components/Checks/FileMimeType.vue
@@ -1,35 +1,39 @@
-
+ :options="options" :multiple="false" :tagging="false"
+ @input="setValue">
-
+
{{ props.option.label }}
-
+
{{ props.option.label }}
-
-
+
+
-
+
diff --git a/apps/workflowengine/src/components/Checks/FileSystemTag.vue b/apps/workflowengine/src/components/Checks/FileSystemTag.vue
deleted file mode 100644
index b8c24bf118..0000000000
--- a/apps/workflowengine/src/components/Checks/FileSystemTag.vue
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/apps/workflowengine/src/components/Checks/RequestTime.vue b/apps/workflowengine/src/components/Checks/RequestTime.vue
index 9ea211874f..b150e67b00 100644
--- a/apps/workflowengine/src/components/Checks/RequestTime.vue
+++ b/apps/workflowengine/src/components/Checks/RequestTime.vue
@@ -1,14 +1,17 @@
-
-
-
+
+
+
-
+
diff --git a/apps/workflowengine/src/components/Checks/file.js b/apps/workflowengine/src/components/Checks/file.js
index 146ac045ce..816aaa73a6 100644
--- a/apps/workflowengine/src/components/Checks/file.js
+++ b/apps/workflowengine/src/components/Checks/file.js
@@ -20,8 +20,8 @@
*
*/
-import FileMimeType from './FileMimeType';
-import { stringValidator, validateIPv4, validateIPv6} from './../../helpers/validators'
+import FileMimeType from './FileMimeType'
+import { stringValidator, validateIPv4, validateIPv6 } from './../../helpers/validators'
const FileChecks = [
{
class: 'OCA\\WorkflowEngine\\Check\\FileName',
@@ -77,7 +77,7 @@ const FileChecks = [
],
placeholder: (check) => {
if (check.operator === 'matchesIPv6' || check.operator === '!matchesIPv6') {
- return '::1/128';
+ return '::1/128'
}
return '127.0.0.1/32'
},
diff --git a/apps/workflowengine/src/components/Checks/request.js b/apps/workflowengine/src/components/Checks/request.js
index 8b36b89a9e..5550555cf0 100644
--- a/apps/workflowengine/src/components/Checks/request.js
+++ b/apps/workflowengine/src/components/Checks/request.js
@@ -20,8 +20,8 @@
*
*/
-import RequestUserAgent from './RequestUserAgent';
-import RequestTime from './RequestTime';
+import RequestUserAgent from './RequestUserAgent'
+import RequestTime from './RequestTime'
const RequestChecks = [
{
@@ -32,7 +32,7 @@ const RequestChecks = [
{ operator: '!is', name: t('workflowengine', 'is not') },
{ operator: 'matches', name: t('workflowengine', 'matches') },
{ operator: '!matches', name: t('workflowengine', 'does not match') }
- ],
+ ]
// TODO: implement component
},
{
@@ -53,8 +53,7 @@ const RequestChecks = [
{ operator: 'matches', name: t('workflowengine', 'matches') },
{ operator: '!matches', name: t('workflowengine', 'does not match') }
],
- // TODO: implement component
- // component: RequestUserAgent
+ component: RequestUserAgent
},
{
class: 'OCA\\WorkflowEngine\\Check\\UserGroupMembership',
@@ -62,7 +61,7 @@ const RequestChecks = [
operators: [
{ operator: 'is', name: t('workflowengine', 'is member of') },
{ operator: '!is', name: t('workflowengine', 'is not member of') }
- ],
+ ]
// TODO: implement component
}
]
diff --git a/apps/workflowengine/src/components/Operation.vue b/apps/workflowengine/src/components/Operation.vue
index 3cd7378f0d..ad44d37693 100644
--- a/apps/workflowengine/src/components/Operation.vue
+++ b/apps/workflowengine/src/components/Operation.vue
@@ -2,8 +2,8 @@
-
{{ operation.name }}
- {{ operation.description }}
+ {{ operation.name }}
+ {{ operation.description }}
diff --git a/apps/workflowengine/src/components/Rule.vue b/apps/workflowengine/src/components/Rule.vue
index c5c6094879..76d332ac41 100644
--- a/apps/workflowengine/src/components/Rule.vue
+++ b/apps/workflowengine/src/components/Rule.vue
@@ -5,9 +5,10 @@
{{ t('workflowengine', 'When') }}
-
+
{{ t('workflowengine', 'and') }}
-
+
@@ -15,7 +16,7 @@
value="Add a new filter" @click="rule.checks.push({class: null, operator: null, value: null})">
-
+
@@ -245,5 +246,4 @@ export default {
}
}
-
diff --git a/apps/workflowengine/src/helpers/validators.js b/apps/workflowengine/src/helpers/validators.js
index 033ce2ec7f..5fb94f66ec 100644
--- a/apps/workflowengine/src/helpers/validators.js
+++ b/apps/workflowengine/src/helpers/validators.js
@@ -20,7 +20,6 @@
*
*/
-
const validateRegex = function(string) {
var regexRegex = /^\/(.*)\/([gui]{0,3})$/
var result = regexRegex.exec(string)
diff --git a/apps/workflowengine/src/legacy/filesystemtagsplugin.js b/apps/workflowengine/src/legacy/filesystemtagsplugin.js
deleted file mode 100644
index e945c79195..0000000000
--- a/apps/workflowengine/src/legacy/filesystemtagsplugin.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @copyright Copyright (c) 2016 Joas Schilling
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- */
-
-(function() {
-
- OCA.WorkflowEngine = OCA.WorkflowEngine || {}
- OCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {}
-
- OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin = {
- getCheck: function() {
- this.collection = OC.SystemTags.collection
-
- return {
- class: 'OCA\\WorkflowEngine\\Check\\FileSystemTags',
- name: t('workflowengine', 'File system tag'),
- operators: [
- { operator: 'is', name: t('workflowengine', 'is tagged with') },
- { operator: '!is', name: t('workflowengine', 'is not tagged with') }
- ]
- }
- },
- render: function(element, check) {
- if (check.class !== 'OCA\\WorkflowEngine\\Check\\FileSystemTags') {
- return
- }
-
- $(element).css('width', '400px')
-
- $(element).select2({
- allowClear: false,
- multiple: false,
- placeholder: t('workflowengine', 'Select tag…'),
- query: _.debounce(function(query) {
- query.callback({
- results: OC.SystemTags.collection.filterByName(query.term)
- })
- }, 100, true),
- id: function(element) {
- return element.get('id')
- },
- initSelection: function(element, callback) {
- callback($(element).val())
- },
- formatResult: function(tag) {
- return OC.SystemTags.getDescriptiveTag(tag)
- },
- formatSelection: function(tagId) {
- var tag = OC.SystemTags.collection.get(tagId)
- if (!_.isUndefined(tag)) {
- return OC.SystemTags.getDescriptiveTag(tag)
- }
- },
- escapeMarkup: function(m) {
- return m
- }
- })
- }
- }
-})()
-
-OC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin)
diff --git a/apps/workflowengine/src/legacy/requesttimeplugin.js b/apps/workflowengine/src/legacy/requesttimeplugin.js
deleted file mode 100644
index eaeae287da..0000000000
--- a/apps/workflowengine/src/legacy/requesttimeplugin.js
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * @copyright Copyright (c) 2016 Joas Schilling
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- */
-
-(function() {
-
- OCA.WorkflowEngine = OCA.WorkflowEngine || {}
- OCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {}
-
- OCA.WorkflowEngine.Plugins.RequestTimePlugin = {
- timezones: [
- 'Europe/Berlin',
- 'Europe/London'
- ],
- _$element: null,
- getCheck: function() {
- return {
- class: 'OCA\\WorkflowEngine\\Check\\RequestTime',
- name: t('workflowengine', 'Request time'),
- operators: [
- { operator: 'in', name: t('workflowengine', 'between') },
- { operator: '!in', name: t('workflowengine', 'not between') }
- ]
- }
- },
- render: function(element, check) {
- if (check.class !== 'OCA\\WorkflowEngine\\Check\\RequestTime') {
- return
- }
-
- var startTime = '09:00'
- var endTime = '18:00'
- var timezone = jstz.determine().name()
- var $element = $(element)
-
- if (_.isString(check.value) && check.value !== '') {
- var value = JSON.parse(check.value)
- var splittedStart = value[0].split(' ', 2)
- var splittedEnd = value[1].split(' ', 2)
-
- startTime = splittedStart[0]
- endTime = splittedEnd[0]
- timezone = splittedStart[1]
- }
-
- var valueJSON = JSON.stringify([startTime + ' ' + timezone, endTime + ' ' + timezone])
- if (check.value !== valueJSON) {
- check.value = valueJSON
- $element.val(valueJSON)
- }
-
- $element.css('display', 'none')
-
- $('')
- .attr('type', 'text')
- .attr('placeholder', t('workflowengine', 'Start'))
- .attr('title', t('workflowengine', 'Example: {placeholder}', { placeholder: '16:00' }))
- .addClass('has-tooltip')
- .tooltip({
- placement: 'bottom'
- })
- .addClass('start')
- .val(startTime)
- .insertBefore($element)
- $('')
- .attr('type', 'text')
- .attr('placeholder', t('workflowengine', 'End'))
- .attr('title', t('workflowengine', 'Example: {placeholder}', { placeholder: '16:00' }))
- .addClass('has-tooltip')
- .tooltip({
- placement: 'bottom'
- })
- .addClass('end')
- .val(endTime)
- .insertBefore($element)
-
- var timezoneInput = $('')
- .attr('type', 'hidden')
- .css('width', '250px')
- .insertBefore($element)
- .val(timezone)
-
- timezoneInput.select2({
- allowClear: false,
- multiple: false,
- placeholder: t('workflowengine', 'Select timezone…'),
- ajax: {
- url: OC.generateUrl('apps/workflowengine/timezones'),
- dataType: 'json',
- quietMillis: 100,
- data: function(term) {
- if (term === '') {
- // Default search in the same continent...
- term = jstz.determine().name().split('/')
- term = term[0]
- }
- return {
- search: term
- }
- },
- results: function(response) {
- var results = []
- $.each(response, function(timezone) {
- results.push({ id: timezone })
- })
-
- return {
- results: results,
- more: false
- }
- }
- },
- initSelection: function(element, callback) {
- callback(element.val())
- },
- formatResult: function(element) {
- return '' + element.id + ''
- },
- formatSelection: function(element) {
- if (!_.isUndefined(element.id)) {
- element = element.id
- }
- return '' + element + ''
- }
- })
-
- // Has to be added after select2 for `event.target.classList`
- timezoneInput.addClass('timezone')
-
- $element.parent()
- .on('change', '.start', _.bind(this.update, this))
- .on('change', '.end', _.bind(this.update, this))
- .on('change', '.timezone', _.bind(this.update, this))
-
- this._$element = $element
- },
- update: function(event) {
- var value = event.target.value
- var key = null
-
- for (var i = 0; i < event.target.classList.length; i++) {
- key = event.target.classList[i]
- }
-
- if (key === null) {
- console.warn('update triggered but element doesn\'t have any class')
- return
- }
-
- var data = JSON.parse(this._$element.val())
- var startTime = moment(data[0].split(' ', 2)[0], 'H:m Z')
- var endTime = moment(data[1].split(' ', 2)[0], 'H:m Z')
- var timezone = data[0].split(' ', 2)[1]
-
- if (key === 'start' || key === 'end') {
- var parsedDate = moment(value, ['H:m', 'h:m a'], true).format('HH:mm')
-
- if (parsedDate === 'Invalid date') {
- return
- }
-
- var indexValue = 0
- if (key === 'end') {
- indexValue = 1
- }
- data[indexValue] = parsedDate + ' ' + timezone
- }
-
- if (key === 'timezone') {
- data[0] = startTime.format('HH:mm') + ' ' + value
- data[1] = endTime.format('HH:mm') + ' ' + value
- }
-
- this._$element.val(JSON.stringify(data))
- this._$element.trigger('change')
- }
- }
-})()
-
-OC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.RequestTimePlugin)
diff --git a/apps/workflowengine/src/legacy/requesturlplugin.js b/apps/workflowengine/src/legacy/requesturlplugin.js
deleted file mode 100644
index 7e13422387..0000000000
--- a/apps/workflowengine/src/legacy/requesturlplugin.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * @copyright Copyright (c) 2016 Joas Schilling
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- */
-
-(function() {
-
- OCA.WorkflowEngine = OCA.WorkflowEngine || {}
- OCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {}
-
- OCA.WorkflowEngine.Plugins.RequestURLPlugin = {
- predefinedValues: ['webdav'],
- getCheck: function() {
- return {
- class: 'OCA\\WorkflowEngine\\Check\\RequestURL',
- name: t('workflowengine', 'Request URL'),
- operators: [
- { operator: 'is', name: t('workflowengine', 'is') },
- { operator: '!is', name: t('workflowengine', 'is not') },
- { operator: 'matches', name: t('workflowengine', 'matches') },
- { operator: '!matches', name: t('workflowengine', 'does not match') }
- ]
- }
- },
- render: function(element, check) {
- if (check.class !== 'OCA\\WorkflowEngine\\Check\\RequestURL') {
- return
- }
-
- var placeholder = 'https://localhost/index.php'
-
- if (check.operator === 'matches' || check.operator === '!matches') {
- placeholder = '/^https\\:\\/\\/localhost\\/index\\.php$/i'
- }
-
- $(element).css('width', '250px')
- .attr('placeholder', placeholder)
- .attr('title', t('workflowengine', 'Example: {placeholder}', { placeholder: placeholder }))
- .addClass('has-tooltip')
- .tooltip({
- placement: 'bottom'
- })
-
- if (check.operator === 'matches' || check.operator === '!matches') {
- if (this._validateRegex(check.value)) {
- $(element).removeClass('invalid-input')
- } else {
- $(element).addClass('invalid-input')
- }
- } else {
- var self = this
- var data = [
- {
- text: t('workflowengine', 'Predefined URLs'),
- children: [
- { id: 'webdav', text: t('workflowengine', 'Files WebDAV') }
- ]
- }
- ]
- if (this.predefinedValues.indexOf(check.value) === -1) {
- data.unshift({
- id: check.value,
- text: check.value
- })
- }
-
- $(element).select2({
- data: data,
- createSearchChoice: function(term) {
- if (self.predefinedValues.indexOf(check.value) === -1) {
- return {
- id: term,
- text: term
- }
- }
- },
- id: function(element) {
- return element.id
- },
- formatResult: function(tag) {
- return tag.text
- },
- formatSelection: function(tag) {
- return tag.text
- },
- escapeMarkup: function(m) {
- return m
- }
- })
- }
- },
-
- _validateRegex: function(string) {
- var regexRegex = /^\/(.*)\/([gui]{0,3})$/
- var result = regexRegex.exec(string)
- return result !== null
- }
- }
-})()
-
-OC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.RequestURLPlugin)
diff --git a/apps/workflowengine/src/legacy/requestuseragentplugin.js b/apps/workflowengine/src/legacy/requestuseragentplugin.js
deleted file mode 100644
index 5480e4ccc8..0000000000
--- a/apps/workflowengine/src/legacy/requestuseragentplugin.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * @copyright Copyright (c) 2016 Joas Schilling
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- */
-
-(function() {
-
- OCA.WorkflowEngine = OCA.WorkflowEngine || {}
- OCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {}
-
- OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin = {
- predefinedValues: ['android', 'ios', 'desktop'],
- getCheck: function() {
- return {
- class: 'OCA\\WorkflowEngine\\Check\\RequestUserAgent',
- name: t('workflowengine', 'Request user agent'),
- operators: [
- { operator: 'is', name: t('workflowengine', 'is') },
- { operator: '!is', name: t('workflowengine', 'is not') },
- { operator: 'matches', name: t('workflowengine', 'matches') },
- { operator: '!matches', name: t('workflowengine', 'does not match') }
- ]
- }
- },
- render: function(element, check) {
- if (check.class !== 'OCA\\WorkflowEngine\\Check\\RequestUserAgent') {
- return
- }
-
- var placeholder = 'Mozilla/5.0 User Agent'
-
- if (check.operator === 'matches' || check.operator === '!matches') {
- placeholder = '/^Mozilla\\/5\\.0 (.*)$/i'
- }
-
- $(element).css('width', '250px')
- .attr('placeholder', placeholder)
- .attr('title', t('workflowengine', 'Example: {placeholder}', { placeholder: placeholder }))
- .addClass('has-tooltip')
- .tooltip({
- placement: 'bottom'
- })
-
- if (check.operator === 'matches' || check.operator === '!matches') {
- if (this._validateRegex(check.value)) {
- $(element).removeClass('invalid-input')
- } else {
- $(element).addClass('invalid-input')
- }
- } else {
- var self = this
- var data = [
- {
- text: t('workflowengine', 'Sync clients'),
- children: [
- { id: 'android', text: t('workflowengine', 'Android client') },
- { id: 'ios', text: t('workflowengine', 'iOS client') },
- { id: 'desktop', text: t('workflowengine', 'Desktop client') },
- { id: 'mail', text: t('workflowengine', 'Thunderbird & Outlook addons') }
- ]
- }
- ]
- if (this.predefinedValues.indexOf(check.value) === -1) {
- data.unshift({
- id: check.value,
- text: check.value
- })
- }
-
- $(element).select2({
- data: data,
- createSearchChoice: function(term) {
- if (self.predefinedValues.indexOf(check.value) === -1) {
- return {
- id: term,
- text: term
- }
- }
- },
- id: function(element) {
- return element.id
- },
- formatResult: function(tag) {
- return tag.text
- },
- formatSelection: function(tag) {
- return tag.text
- },
- escapeMarkup: function(m) {
- return m
- }
- })
- }
- },
-
- _validateRegex: function(string) {
- var regexRegex = /^\/(.*)\/([gui]{0,3})$/
- var result = regexRegex.exec(string)
- return result !== null
- }
- }
-})()
-
-OC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin)
diff --git a/apps/workflowengine/src/legacy/usergroupmembershipplugin.js b/apps/workflowengine/src/legacy/usergroupmembershipplugin.js
deleted file mode 100644
index 6d60e9e4d6..0000000000
--- a/apps/workflowengine/src/legacy/usergroupmembershipplugin.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @copyright Copyright (c) 2016 Morris Jobke
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- */
-
-(function() {
-
- OCA.WorkflowEngine = OCA.WorkflowEngine || {}
- OCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {}
-
- OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin = {
- getCheck: function() {
- return {
- class: 'OCA\\WorkflowEngine\\Check\\UserGroupMembership',
- name: t('workflowengine', 'User group membership'),
- operators: [
- { operator: 'is', name: t('workflowengine', 'is member of') },
- { operator: '!is', name: t('workflowengine', 'is not member of') }
- ]
- }
- },
- render: function(element, check, groups) {
- if (check.class !== 'OCA\\WorkflowEngine\\Check\\UserGroupMembership') {
- return
- }
-
- $(element).css('width', '400px')
-
- $(element).select2({
- data: { results: groups, text: 'displayname' },
- initSelection: function(element, callback) {
- var groupId = element.val()
- if (groupId && groups.length > 0) {
- callback({
- id: groupId,
- displayname: groups.find(function(group) {
- return group.id === groupId
- }).displayname
- })
- } else if (groupId) {
- callback({
- id: groupId,
- displayname: groupId
- })
- } else {
- callback()
- }
- },
- formatResult: function(element) {
- return '' + escapeHTML(element.displayname) + ''
- },
- formatSelection: function(element) {
- return '' + escapeHTML(element.displayname) + ''
- }
- })
- }
- }
-})()
-
-OC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin)
diff --git a/apps/workflowengine/src/store.js b/apps/workflowengine/src/store.js
index 75e53149ea..a322c7fb3e 100644
--- a/apps/workflowengine/src/store.js
+++ b/apps/workflowengine/src/store.js
@@ -85,7 +85,7 @@ const store = new Vuex.Store({
let events = []
if (rule.isComplex === false && rule.fixedEntity === '') {
entity = context.state.entities.find((item) => rule.entities && rule.entities[0] === item.id)
- entity = entity ? entity : Object.values(context.state.entities)[0]
+ entity = entity || Object.values(context.state.entities)[0]
events = [entity.events[0].eventName]
}
@@ -124,7 +124,7 @@ const store = new Vuex.Store({
await axios.delete(getApiUrl(`/${rule.id}`))
context.commit('removeRule', rule)
},
- setValid (context, { rule, valid }) {
+ setValid(context, { rule, valid }) {
rule.valid = valid
context.commit('updateRule', rule)
}