initialize: function(options) { this.options = Utils.merge(options, this.options); // create view for upload/progress button this.ui_button = new UploadButton.View({ onclick: e => { e.preventDefault(); this.show(); }, onunload: () => { var percentage = this.ui_button.model.get("percentage", 0); if (percentage > 0 && percentage < 100) { return "Several uploads are queued."; } } }); // set element to button view this.setElement(this.ui_button.$el); // load extensions UploadUtils.getUploadDatatypes( list_extensions => { this.list_extensions = list_extensions; }, this.options.datatypes_disable_auto, this.options.auto ); // load genomes UploadUtils.getUploadGenomes(list_genomes => { this.list_genomes = list_genomes; }, this.default_genome); },
initialize: function(options) { this.list = {}; this.options = Utils.merge(options, { title: _l("Repeat"), empty_text: "Not available.", max: null, min: null }); this.button_new = new Ui.Button({ icon: "fa-plus", title: `Insert ${this.options.title}`, tooltip: `Add new ${this.options.title} block`, cls: "btn btn-secondary float-none form-repeat-add", onclick: function() { if (options.onnew) { options.onnew(); } } }); this.setElement( $("<div/>") .append((this.$list = $("<div/>"))) .append($("<div/>").append(this.button_new.$el)) ); },
_workflowLoadAjax: function(workflowId, version, options) { $.ajax( Utils.merge(options, { url: this.urls.load_workflow, data: { id: workflowId, _: "true", version: version }, dataType: "json", cache: false }) ); },
addMenu: function(options) { this.collection.add( Utils.merge(options, { title: "", target: "", href: "", onclick: null, divider: false, visible: true, icon: null, cls: "button-menu btn-group" }) ); }
initialize: function(options) { this.options = Utils.merge(options, { content: "No content available.", onchange: null, ondblclick: null, onconfirm: null, cls: "grid", selectable: true }); this.setElement(this._template()); this.$thead = this.$("thead"); this.$tbody = this.$("tbody"); this.$tmessage = this.$("tmessage"); this.row = $("<tr/>"); this.row_count = 0; },
_.each(this.model.get("steps"), (step, i) => { Galaxy.emit.debug("tool-form-composite::initialize()", `${i} : Preparing workflow step.`); var icon = WorkflowIcons[step.step_type]; var title = `${parseInt(i + 1)}: ${step.step_label || step.step_name}`; if (step.annotation) { title += ` - ${step.annotation}`; } if (step.step_version) { title += ` (Galaxy Version ${step.step_version})`; } step = Utils.merge( { index: i, fixed_title: _.escape(title), icon: icon || "", help: null, citations: null, collapsible: true, collapsed: i > 0 && !self._isDataStep(step), sustain_version: true, sustain_repeats: true, sustain_conditionals: true, narrow: true, text_enable: "Edit", text_disable: "Undo", cls_enable: "fa fa-edit", cls_disable: "fa fa-undo", errors: step.messages, initial_errors: true, cls: "ui-portlet-section", hide_operations: true, needs_refresh: false, always_refresh: step.step_type != "tool" }, step ); self.steps[i] = step; self.links[i] = []; self.parms[i] = {}; });
initialize: function(options) { // configure options this.options = Utils.merge(options, this.optionsDefault); // create new element this.setElement(this._template(this.options)); // check if container exists if (!this.options.container) { console.log("ui-select::initialize() : container not specified."); return; } // add to dom this.options.container.append(this.$el); // link selection dictionary this.select_data = this.options.data; // refresh this._refresh(); if (!this.options.multiple) { // initial value if (this.options.value) { this._setValue(this.options.value); } // add change event var self = this; if (this.options.onchange) { this.$el.on("change", () => { self.options.onchange(self.value()); }); } } },
this.deferred.execute(promise => { self.$steps.addClass("ui-steps"); if (step.step_type == "tool") { step.postchange = function(process, form) { var current_state = { tool_id: step.id, tool_version: step.version, inputs: $.extend(true, {}, form.data.create()) }; form.wait(true); Galaxy.emit.debug("tool-form-composite::postchange()", "Sending current state.", current_state); Utils.request({ type: "POST", url: `${getAppRoot()}api/tools/${step.id}/build`, data: current_state, success: function(data) { form.update(data); form.wait(false); Galaxy.emit.debug("tool-form-composite::postchange()", "Received new model.", data); process.resolve(); }, error: function(response) { Galaxy.emit.debug("tool-form-composite::postchange()", "Refresh request failed.", response); process.reject(); } }); }; form = new ToolFormBase(step); if (step.post_job_actions && step.post_job_actions.length) { form.portlet.append( $("<div/>") .addClass("ui-form-element-disabled") .append( $("<div/>") .addClass("ui-form-title") .html("<b>Job Post Actions</b>") ) .append( $("<div/>") .addClass("ui-form-preview") .html( _.reduce( step.post_job_actions, (memo, value) => `${memo} ${value.short_str}`, "" ) ) ) ); } } else { var is_simple_input = ["data_input", "data_collection_input"].indexOf(step.step_type) != -1; _.each(step.inputs, input => { input.flavor = "module"; input.hide_label = is_simple_input; }); form = new Form( Utils.merge( { title: step.fixed_title, onchange: function() { _.each(self.links[step.index], link => { self._refreshStep(link); }); }, inputs: step.inputs && step.inputs.length > 0 ? step.inputs : [ { type: "hidden", name: "No options available.", ignore: null } ] }, step ) ); if (step.step_label) { form.$el.attr("step-label", step.step_label); } } self.forms[step.index] = form; self._append(self.$steps, form.$el); if (step.needs_refresh) { self._refreshStep(step); } form.portlet[!self.show_progress ? "enable" : "disable"](); if (self.show_progress) { self.execute_btn.model.set({ wait: true, wait_text: "Preparing...", percentage: ((step.index + 1) * 100.0) / self.steps.length }); } Galaxy.emit.debug("tool-form-composite::initialize()", `${step.index} : Workflow step state ready.`, step); window.setTimeout(() => { promise.resolve(); }, 0); });
initialize: function(options) { var self = this; this.options = Utils.merge(options, this.options); // create view for upload/progress button this.ui_button = new UploadButton.View({ onclick: function(e) { e.preventDefault(); self.show(); }, onunload: function() { var percentage = self.ui_button.model.get("percentage", 0); if (percentage > 0 && percentage < 100) { return "Several uploads are queued."; } } }); // set element to button view this.setElement(this.ui_button.$el); // load extensions var self = this; Utils.get({ url: `${Galaxy.root}api/datatypes?extension_only=False`, success: function(datatypes) { for (var key in datatypes) { self.list_extensions.push({ id: datatypes[key].extension, text: datatypes[key].extension, description: datatypes[key].description, description_url: datatypes[key].description_url, composite_files: datatypes[key].composite_files }); } self.list_extensions.sort((a, b) => { var a_text = a.text && a.text.toLowerCase(); var b_text = b.text && b.text.toLowerCase(); return a_text > b_text ? 1 : a_text < b_text ? -1 : 0; }); if (!self.options.datatypes_disable_auto) { self.list_extensions.unshift(self.options.auto); } } }); // load genomes Utils.get({ url: `${Galaxy.root}api/genomes`, success: function(genomes) { for (var key in genomes) { self.list_genomes.push({ id: genomes[key][1], text: genomes[key][0] }); } self.list_genomes.sort((a, b) => { if (a.id == self.options.default_genome) { return -1; } if (b.id == self.options.default_genome) { return 1; } return a.text > b.text ? 1 : a.text < b.text ? -1 : 0; }); } }); },