]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow to define the operation
authorJoas Schilling <coding@schilljs.com>
Tue, 2 Aug 2016 07:56:19 +0000 (09:56 +0200)
committerJoas Schilling <coding@schilljs.com>
Tue, 2 Aug 2016 08:50:21 +0000 (10:50 +0200)
apps/workflowengine/js/admin.js
apps/workflowengine/js/filesystemtagsplugin.js
apps/workflowengine/templates/admin.php

index 447237c5600f060011d081684820459bc1c18e5c..2c6fa54d87dbaff27339b5d52ca65c78d93386d5 100644 (file)
                                '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',
                                        return;
                                }
 
-                               if (key !== 'name') {
+                               if (key !== 'name' && key !== 'operation') {
                                        console.warn('key "' + key + '" is no valid attribute');
                                        return;
                                }
                                        }, 7000, this.$el.find('.msg.success'));
                                        this.message = '';
                                }
+
+                               return this.$el;
                        }
                });
 
                        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) {
                                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();
                        },
index 684b854f68af03d7b4de07d992e757c370eed858..bca890e3c319dce40a44eefa9c0c30941829f888 100644 (file)
@@ -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) {
index 4eabf783bbae02e52c813db325f150a1939b2e52..935e8c70f17ca0a23ba5fdd840ef3d0c2d7c4d34 100644 (file)
@@ -36,7 +36,7 @@
                        {{#if operation.id}}
                        <span class="button-delete pull-right icon-delete"></span>
                        {{/if}}
-                       <span class="pull-right info">{{operation.class}} - ID: {{operation.id}} - operation: {{operation.operation}}</span>
+                       <input type="text" class="pull-right operation-operation" value="{{operation.operation}}">
 
                        <div class="checks">
                                {{#each operation.checks}}