From 62d009ad09fd6cdc80cc6b4dded42a8826b7a459 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 2 Aug 2016 09:56:19 +0200 Subject: [PATCH] Allow to define the operation --- apps/workflowengine/js/admin.js | 17 +++++++---------- apps/workflowengine/js/filesystemtagsplugin.js | 4 ++-- apps/workflowengine/templates/admin.php | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/apps/workflowengine/js/admin.js b/apps/workflowengine/js/admin.js index 447237c560..2c6fa54d87 100644 --- a/apps/workflowengine/js/admin.js +++ b/apps/workflowengine/js/admin.js @@ -137,6 +137,7 @@ 'change .check-operator': 'checkChanged', 'change .check-value': 'checkChanged', 'change .operation-name': 'operationChanged', + 'change .operation-operation': 'operationChanged', 'click .button-reset': 'reset', 'click .button-save': 'save', 'click .button-add': 'add', @@ -269,7 +270,7 @@ return; } - if (key !== 'name') { + if (key !== 'name' && key !== 'operation') { console.warn('key "' + key + '" is no valid attribute'); return; } @@ -308,6 +309,8 @@ }, 7000, this.$el.find('.msg.success')); this.message = ''; } + + return this.$el; } }); @@ -324,10 +327,7 @@ events: { 'click .button-add-operation': 'add' }, - initialize: function() { - this._initialize('OCA\\WorkflowEngine\\Operation'); - }, - _initialize: function(classname) { + initialize: function(classname) { if (!OCA.WorkflowEngine.availablePlugins.length) { OCA.WorkflowEngine.availablePlugins = OC.Plugins.getPlugins('OCA.WorkflowEngine.CheckPlugins'); _.each(OCA.WorkflowEngine.availablePlugins, function(plugin) { @@ -346,11 +346,8 @@ var operation = this.collection.create(); this.renderOperation(operation); }, - renderOperation: function(operation){ - var subView = new OCA.WorkflowEngine.OperationView({ - model: operation - }), - operationsElement = this.$el.find('.operations'); + renderOperation: function(subView){ + var operationsElement = this.$el.find('.operations'); operationsElement.append(subView.$el); subView.render(); }, diff --git a/apps/workflowengine/js/filesystemtagsplugin.js b/apps/workflowengine/js/filesystemtagsplugin.js index 684b854f68..bca890e3c3 100644 --- a/apps/workflowengine/js/filesystemtagsplugin.js +++ b/apps/workflowengine/js/filesystemtagsplugin.js @@ -49,7 +49,7 @@ placeholder: t('workflowengine', 'Select tag…'), query: _.debounce(function(query) { query.callback({ - results: OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin.collection.filterByName(query.term) + results: OC.SystemTags.collection.filterByName(query.term) }); }, 100, true), id: function(element) { @@ -63,7 +63,7 @@ return OC.SystemTags.getDescriptiveTag(tag); }, formatSelection: function (tagId) { - tag = OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin.collection.get(tagId); + var tag = OC.SystemTags.collection.get(tagId); return OC.SystemTags.getDescriptiveTag(tag); }, escapeMarkup: function(m) { diff --git a/apps/workflowengine/templates/admin.php b/apps/workflowengine/templates/admin.php index 4eabf783bb..935e8c70f1 100644 --- a/apps/workflowengine/templates/admin.php +++ b/apps/workflowengine/templates/admin.php @@ -36,7 +36,7 @@ {{#if operation.id}} {{/if}} - {{operation.class}} - ID: {{operation.id}} - operation: {{operation.operation}} +
{{#each operation.checks}}