Merge pull request #6691 from jmchilton/backport_6326

[18.05] Backport #6326
This commit is contained in:
Marius van den Beek
2018-09-12 10:25:03 +02:00
committed by GitHub
3 changed files with 3 additions and 3 deletions
@@ -115,7 +115,7 @@ var View = Backbone.View.extend({
// update
refreshDefinition: function(input_def) {
self.target = input_def.target;
this.target = input_def.target;
// refresh
this._refresh();
},
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define("mvc/ui/ui-rules-edit",["exports","axios","utils/localization","utils/utils","mvc/ui/ui-misc","vue","mvc/collection/list-collection-creator","components/RulesDisplay.vue"],function(e,t,i,n,l,o,s,r){"use strict";function u(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var a=u(t),c=u(i),d=(u(n),u(l)),f=u(o),h=u(s),v=u(r),_=Backbone.View.extend({initialize:function(e){var t=this;this.options=e,this.target=e.target,this.reset=null;var i=this;this.browse_button=new d.default.ButtonIcon({title:(0,c.default)("Edit"),icon:"fa fa-edit",tooltip:(0,c.default)("Edit Rules"),onclick:function(){i.target?i._fetcCollectionAndEdit():i._showRuleEditor(null)}}),this.on("change",function(){e.onchange&&e.onchange(t.value())}),this.setElement(this._template(e)),this.$(".ui-rules-edit-button").append(this.browse_button.$el);var n=f.default.extend(v.default),l=document.createElement("div");this.$(".ui-rules-preview").append(l),this.instance=new n({propsData:{initialRules:{rules:[],mapping:[]}}}),this.instance.$mount(l),this.workflowRuntimeCompatible=!1},_fetcCollectionAndEdit:function(){var e=this,t=this,i=Galaxy.root+"api/dataset_collections/"+t.target.id+"?instance_type=history";a.default.get(i).then(function(t){return e._showCollection(t)}).catch(t._renderFetchError)},_showCollection:function(e){var t=e.data;this._showRuleEditor(t)},_showRuleEditor:function(e){var t=this,i={saveRulesFn:function(e){return t._handleRulesSave(e)},initialRules:this._value};h.default.ruleBasedCollectionCreatorModal(e,"collection_contents","collections",i).done(function(){})},_handleRulesSave:function(e){this._setValue(e)},_renderFetchError:function(e){console.log(e),console.log("problem fetching collection")},_template:function(e){return'\n <div class="ui-rules-edit">\n <span class="ui-rules-preview" />\n <span class="ui-rules-edit-button" />\n </div>\n '},value:function(e){if(void 0===e)return this._getValue();this._setValue(e)},refreshDefinition:function(e){self.target=e.target,this._refresh()},_refresh:function(){},_getValue:function(){return this._value},_setValue:function(e){e&&("string"==typeof e&&(e=JSON.parse(e)),this._value=e,this.trigger("change"),this.instance.inputRules=e,this.reset&&(this.reset(),this.reset=null))},validate:function(e){var t=this._value,i=null;if(t&&0!==t.rules.length)if(0===t.mapping.length)i="No collection identifiers defined, specify at least one collection identifier.";else{var n=!0,l=!1,o=void 0;try{for(var s,r=t.rules[Symbol.iterator]();!(n=(s=r.next()).done);n=!0)if(s.value.error){i="One or more rules in error.";break}}catch(e){l=!0,o=e}finally{try{!n&&r.return&&r.return()}finally{if(l)throw o}}}else i="No rules defined, define at least one rule.";return this.reset=e,{valid:!i,message:i}}});e.default={View:_}});
define("mvc/ui/ui-rules-edit",["exports","axios","utils/localization","utils/utils","mvc/ui/ui-misc","vue","mvc/collection/list-collection-creator","components/RulesDisplay.vue"],function(e,t,i,n,l,o,s,r){"use strict";function u(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var a=u(t),c=u(i),h=(u(n),u(l)),d=u(o),f=u(s),v=u(r),_=Backbone.View.extend({initialize:function(e){var t=this;this.options=e,this.target=e.target,this.reset=null;var i=this;this.browse_button=new h.default.ButtonIcon({title:(0,c.default)("Edit"),icon:"fa fa-edit",tooltip:(0,c.default)("Edit Rules"),onclick:function(){i.target?i._fetcCollectionAndEdit():i._showRuleEditor(null)}}),this.on("change",function(){e.onchange&&e.onchange(t.value())}),this.setElement(this._template(e)),this.$(".ui-rules-edit-button").append(this.browse_button.$el);var n=d.default.extend(v.default),l=document.createElement("div");this.$(".ui-rules-preview").append(l),this.instance=new n({propsData:{initialRules:{rules:[],mapping:[]}}}),this.instance.$mount(l),this.workflowRuntimeCompatible=!1},_fetcCollectionAndEdit:function(){var e=this,t=this,i=Galaxy.root+"api/dataset_collections/"+t.target.id+"?instance_type=history";a.default.get(i).then(function(t){return e._showCollection(t)}).catch(t._renderFetchError)},_showCollection:function(e){var t=e.data;this._showRuleEditor(t)},_showRuleEditor:function(e){var t=this,i={saveRulesFn:function(e){return t._handleRulesSave(e)},initialRules:this._value};f.default.ruleBasedCollectionCreatorModal(e,"collection_contents","collections",i).done(function(){})},_handleRulesSave:function(e){this._setValue(e)},_renderFetchError:function(e){console.log(e),console.log("problem fetching collection")},_template:function(e){return'\n <div class="ui-rules-edit">\n <span class="ui-rules-preview" />\n <span class="ui-rules-edit-button" />\n </div>\n '},value:function(e){if(void 0===e)return this._getValue();this._setValue(e)},refreshDefinition:function(e){this.target=e.target,this._refresh()},_refresh:function(){},_getValue:function(){return this._value},_setValue:function(e){e&&("string"==typeof e&&(e=JSON.parse(e)),this._value=e,this.trigger("change"),this.instance.inputRules=e,this.reset&&(this.reset(),this.reset=null))},validate:function(e){var t=this._value,i=null;if(t&&0!==t.rules.length)if(0===t.mapping.length)i="No collection identifiers defined, specify at least one collection identifier.";else{var n=!0,l=!1,o=void 0;try{for(var s,r=t.rules[Symbol.iterator]();!(n=(s=r.next()).done);n=!0)if(s.value.error){i="One or more rules in error.";break}}catch(e){l=!0,o=e}finally{try{!n&&r.return&&r.return()}finally{if(l)throw o}}}else i="No rules defined, define at least one rule.";return this.reset=e,{valid:!i,message:i}}});e.default={View:_}});
//# sourceMappingURL=../../../maps/mvc/ui/ui-rules-edit.js.map