Allow to define the operation
This commit is contained in:
parent
c12c083eba
commit
7d71535f57
|
@ -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();
|
||||
},
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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}}
|
||||
|
|
Loading…
Reference in New Issue