diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-09-25 18:19:42 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-10-01 17:16:09 +0200 |
commit | b9bc2417e7a8dc81feb0abe20359bedaf864f790 (patch) | |
tree | 61b47fbf37c1d168da8625224debde9e6a985348 /apps/workflowengine/src | |
parent | 7fb651235128dcbca8a6683b5cdafdf835f46300 (diff) | |
download | nextcloud-server-b9bc2417e7a8dc81feb0abe20359bedaf864f790.tar.gz nextcloud-server-b9bc2417e7a8dc81feb0abe20359bedaf864f790.zip |
Comply to eslint
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/workflowengine/src')
13 files changed, 104 insertions, 42 deletions
diff --git a/apps/workflowengine/src/components/Check.vue b/apps/workflowengine/src/components/Check.vue index 06667b1a7ee..4f68e394495 100644 --- a/apps/workflowengine/src/components/Check.vue +++ b/apps/workflowengine/src/components/Check.vue @@ -1,19 +1,36 @@ <template> <div v-click-outside="hideDelete" class="check" @click="showDelete"> - <Multiselect ref="checkSelector" v-model="currentOption" :options="options" - label="name" track-by="class" :allow-empty="false" - :placeholder="t('workflowengine', 'Select a filter')" @input="updateCheck" /> - <Multiselect v-model="currentOperator" :disabled="!currentOption" :options="operators" - label="name" track-by="operator" :allow-empty="false" - :placeholder="t('workflowengine', 'Select a comparator')" @input="updateCheck" /> - <component :is="currentOption.component" v-if="currentOperator && currentComponent" v-model="check.value" - :disabled="!currentOption" :check="check" + <Multiselect ref="checkSelector" + v-model="currentOption" + :options="options" + label="name" + track-by="class" + :allow-empty="false" + :placeholder="t('workflowengine', 'Select a filter')" + @input="updateCheck" /> + <Multiselect v-model="currentOperator" + :disabled="!currentOption" + :options="operators" + label="name" + track-by="operator" + :allow-empty="false" + :placeholder="t('workflowengine', 'Select a comparator')" + @input="updateCheck" /> + <component :is="currentOption.component" + v-if="currentOperator && currentComponent" + v-model="check.value" + :disabled="!currentOption" + :check="check" @input="updateCheck" @valid="(valid=true) && validate()" @invalid="(valid=false) && validate()" /> - <input v-else v-model="check.value" type="text" + <input v-else + v-model="check.value" + type="text" :class="{ invalid: !valid }" - :disabled="!currentOption" :placeholder="valuePlaceholder" @input="updateCheck"> + :disabled="!currentOption" + :placeholder="valuePlaceholder" + @input="updateCheck"> <Actions v-if="deleteVisible || !currentOption"> <ActionButton icon="icon-delete" @click="$emit('remove')" /> </Actions> diff --git a/apps/workflowengine/src/components/Checks/FileMimeType.vue b/apps/workflowengine/src/components/Checks/FileMimeType.vue index e99bf679f00..7e07d89aea2 100644 --- a/apps/workflowengine/src/components/Checks/FileMimeType.vue +++ b/apps/workflowengine/src/components/Checks/FileMimeType.vue @@ -5,7 +5,9 @@ :placeholder="t('workflowengine', 'Select a file type')" label="label" track-by="pattern" - :options="options" :multiple="false" :tagging="false" + :options="options" + :multiple="false" + :tagging="false" @input="setValue"> <template slot="singleLabel" slot-scope="props"> <span class="option__icon" :class="props.option.icon" /> @@ -16,7 +18,9 @@ <span class="option__title">{{ props.option.label }}</span> </template> </Multiselect> - <input v-if="!isPredefined" type="text" :value="currentValue.pattern" + <input v-if="!isPredefined" + type="text" + :value="currentValue.pattern" @input="updateCustom"> </div> </template> diff --git a/apps/workflowengine/src/components/Checks/FileSystemTag.vue b/apps/workflowengine/src/components/Checks/FileSystemTag.vue index e2f66b30a4b..d3fd440f1b1 100644 --- a/apps/workflowengine/src/components/Checks/FileSystemTag.vue +++ b/apps/workflowengine/src/components/Checks/FileSystemTag.vue @@ -21,7 +21,8 @@ --> <template> - <MultiselectTag v-model="newValue" :multiple="false" + <MultiselectTag v-model="newValue" + :multiple="false" label="Select a tag" @input="update" /> </template> diff --git a/apps/workflowengine/src/components/Checks/MultiselectTag/MultiselectTag.vue b/apps/workflowengine/src/components/Checks/MultiselectTag/MultiselectTag.vue index 88b56a1d4e9..020ed958733 100644 --- a/apps/workflowengine/src/components/Checks/MultiselectTag/MultiselectTag.vue +++ b/apps/workflowengine/src/components/Checks/MultiselectTag/MultiselectTag.vue @@ -22,13 +22,17 @@ <template> <Multiselect v-model="inputValObjects" - :options="tags" :options-limit="5" + :options="tags" + :options-limit="5" :placeholder="label" track-by="id" :custom-label="tagLabel" - class="multiselect-vue" :multiple="multiple" - :close-on-select="false" :tag-width="60" - :disabled="disabled" @input="update"> + class="multiselect-vue" + :multiple="multiple" + :close-on-select="false" + :tag-width="60" + :disabled="disabled" + @input="update"> <span slot="noResult">{{ t('core', 'No results') }}</span> <template #option="scope"> {{ tagLabel(scope.option) }} diff --git a/apps/workflowengine/src/components/Checks/RequestTime.vue b/apps/workflowengine/src/components/Checks/RequestTime.vue index ce306c0541e..1d7950f64f8 100644 --- a/apps/workflowengine/src/components/Checks/RequestTime.vue +++ b/apps/workflowengine/src/components/Checks/RequestTime.vue @@ -1,9 +1,14 @@ <template> <div class="timeslot"> <Multiselect v-model="newValue.timezone" :options="timezones" @input="update" /> - <input v-model="newValue.startTime" type="text" class="timeslot--start" - placeholder="08:00" @input="update"> - <input v-model="newValue.endTime" type="text" placeholder="18:00" + <input v-model="newValue.startTime" + type="text" + class="timeslot--start" + placeholder="08:00" + @input="update"> + <input v-model="newValue.endTime" + type="text" + placeholder="18:00" @input="update"> </div> </template> diff --git a/apps/workflowengine/src/components/Checks/RequestURL.vue b/apps/workflowengine/src/components/Checks/RequestURL.vue index 2ddba526d1e..593d6234998 100644 --- a/apps/workflowengine/src/components/Checks/RequestURL.vue +++ b/apps/workflowengine/src/components/Checks/RequestURL.vue @@ -29,7 +29,9 @@ track-by="pattern" group-values="children" group-label="label" - :options="options" :multiple="false" :tagging="false" + :options="options" + :multiple="false" + :tagging="false" @input="setValue"> <template slot="singleLabel" slot-scope="props"> <span class="option__icon" :class="props.option.icon" /> @@ -40,9 +42,11 @@ <span class="option__title">{{ props.option.label }} {{ props.option.$groupLabel }}</span> </template> </Multiselect> - <input v-if="!isPredefined" type="text" + <input v-if="!isPredefined" + type="text" :value="currentValue.pattern" - :placeholder="placeholder" @input="updateCustom"> + :placeholder="placeholder" + @input="updateCustom"> </div> </template> diff --git a/apps/workflowengine/src/components/Checks/RequestUserAgent.vue b/apps/workflowengine/src/components/Checks/RequestUserAgent.vue index e80071ab9fa..9c43ac86326 100644 --- a/apps/workflowengine/src/components/Checks/RequestUserAgent.vue +++ b/apps/workflowengine/src/components/Checks/RequestUserAgent.vue @@ -29,7 +29,9 @@ track-by="pattern" group-values="children" group-label="label" - :options="options" :multiple="false" :tagging="false" + :options="options" + :multiple="false" + :tagging="false" @input="setValue"> <template slot="singleLabel" slot-scope="props"> <span class="option__icon" :class="props.option.icon" /> @@ -40,7 +42,9 @@ <span class="option__title">{{ props.option.label }} {{ props.option.$groupLabel }}</span> </template> </Multiselect> - <input v-if="!isPredefined" type="text" :value="currentValue.pattern" + <input v-if="!isPredefined" + type="text" + :value="currentValue.pattern" @input="updateCustom"> </div> </template> diff --git a/apps/workflowengine/src/components/Checks/RequestUserGroup.vue b/apps/workflowengine/src/components/Checks/RequestUserGroup.vue index 843bbf127e0..ccd556c99c7 100644 --- a/apps/workflowengine/src/components/Checks/RequestUserGroup.vue +++ b/apps/workflowengine/src/components/Checks/RequestUserGroup.vue @@ -23,9 +23,11 @@ <template> <div> <Multiselect v-model="newValue" - :class="{'icon-loading-small': groups.length === 0}" :options="groups" + :class="{'icon-loading-small': groups.length === 0}" + :options="groups" :multiple="false" - label="displayname" track-by="id" + label="displayname" + track-by="id" @input="setValue" /> </div> </template> diff --git a/apps/workflowengine/src/components/Event.vue b/apps/workflowengine/src/components/Event.vue index ea153758c74..a06835f5f82 100644 --- a/apps/workflowengine/src/components/Event.vue +++ b/apps/workflowengine/src/components/Event.vue @@ -4,9 +4,14 @@ <img class="option__icon" :src="entity.icon"> <span class="option__title option__title_single">{{ operation.triggerHint }}</span> </div> - <Multiselect v-else :value="currentEvent" :options="allEvents" - label="eventName" track-by="id" :allow-empty="false" - :disabled="allEvents.length <= 1" @input="updateEvent"> + <Multiselect v-else + :value="currentEvent" + :options="allEvents" + label="eventName" + track-by="id" + :allow-empty="false" + :disabled="allEvents.length <= 1" + @input="updateEvent"> <template slot="singleLabel" slot-scope="props"> <img class="option__icon" :src="props.option.entity.icon"> <span class="option__title option__title_single">{{ props.option.displayName }}</span> diff --git a/apps/workflowengine/src/components/Rule.vue b/apps/workflowengine/src/components/Rule.vue index 76d332ac414..2be9b0fc5e5 100644 --- a/apps/workflowengine/src/components/Rule.vue +++ b/apps/workflowengine/src/components/Rule.vue @@ -7,13 +7,18 @@ </p> <p v-for="(check, index) in rule.checks" :key="index"> <span>{{ t('workflowengine', 'and') }}</span> - <Check :check="check" :rule="rule" @update="updateRule" + <Check :check="check" + :rule="rule" + @update="updateRule" @remove="removeCheck(check)" /> </p> <p> <span /> - <input v-if="lastCheckComplete" type="button" class="check--add" - value="Add a new filter" @click="rule.checks.push({class: null, operator: null, value: null})"> + <input v-if="lastCheckComplete" + type="button" + class="check--add" + value="Add a new filter" + @click="rule.checks.push({class: null, operator: null, value: null})"> </p> </div> <div class="flow-icon icon-confirm" /> @@ -29,10 +34,14 @@ </Actions> </div> <Operation :operation="operation" :colored="false"> - <component :is="operation.options" v-if="operation.options" v-model="rule.operation" + <component :is="operation.options" + v-if="operation.options" + v-model="rule.operation" @input="updateOperation" /> </Operation> - <button v-tooltip="ruleStatus.tooltip" class="status-button icon" :class="ruleStatus.class" + <button v-tooltip="ruleStatus.tooltip" + class="status-button icon" + :class="ruleStatus.class" @click="saveRule"> {{ ruleStatus.title }} </button> diff --git a/apps/workflowengine/src/components/Workflow.vue b/apps/workflowengine/src/components/Workflow.vue index b4fab5a058c..452dbacc5f6 100644 --- a/apps/workflowengine/src/components/Workflow.vue +++ b/apps/workflowengine/src/components/Workflow.vue @@ -4,12 +4,15 @@ <h2>{{ t('workflowengine', 'Workflows') }}</h2> <transition-group name="slide" tag="div" class="actions"> - <Operation v-for="operation in getMainOperations" :key="operation.id" :operation="operation" + <Operation v-for="operation in getMainOperations" + :key="operation.id" + :operation="operation" @click.native="createNewRule(operation)" /> </transition-group> <div v-if="hasMoreOperations" class="actions__more"> - <button class="icon" :class="showMoreOperations ? 'icon-triangle-n' : 'icon-triangle-s'" + <button class="icon" + :class="showMoreOperations ? 'icon-triangle-n' : 'icon-triangle-s'" @click="showMoreOperations=!showMoreOperations"> {{ showMoreOperations ? t('workflowengine', 'Show less') : t('workflowengine', 'Show more') }} </button> diff --git a/apps/workflowengine/src/store.js b/apps/workflowengine/src/store.js index ad1a4d3f1bf..8c55be8126c 100644 --- a/apps/workflowengine/src/store.js +++ b/apps/workflowengine/src/store.js @@ -1,4 +1,4 @@ -/* +/** * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net> * * @author Julius Härtl <jus@bitgrid.net> @@ -144,8 +144,12 @@ const store = new Vuex.Store({ getEventsForOperation(state) { return (operation) => state.events }, + /** * Return all available checker plugins for a given entity class + * @param {Object} state the store state + * @param {Object} entity the entity class + * @returns {Array} the available plugins */ getChecksForEntity(state) { return (entity) => { diff --git a/apps/workflowengine/src/workflowengine.js b/apps/workflowengine/src/workflowengine.js index 2eb8161fc87..e479bbfa4e8 100644 --- a/apps/workflowengine/src/workflowengine.js +++ b/apps/workflowengine/src/workflowengine.js @@ -44,16 +44,16 @@ window.OCA.WorkflowEngine = Object.assign({}, OCA.WorkflowEngine, { /** * - * @param {CheckPlugin} Plugin + * @param {CheckPlugin} Plugin the plugin to register */ - registerCheck: function (Plugin) { + registerCheck: function(Plugin) { store.commit('addPluginCheck', Plugin) }, /** * - * @param {OperatorPlugin} Plugin + * @param {OperatorPlugin} Plugin the plugin to register */ - registerOperator: function (Plugin) { + registerOperator: function(Plugin) { store.commit('addPluginOperator', Plugin) } }) |