Skip to content

Commit

Permalink
Merge Galaxyproject Dev, Remove Modifications on Unrelated Files
Browse files Browse the repository at this point in the history
  • Loading branch information
tizzir committed Mar 14, 2018
2 parents 5120ec6 + c6993ca commit 729714f
Show file tree
Hide file tree
Showing 139 changed files with 7,184 additions and 5,333 deletions.
92 changes: 39 additions & 53 deletions client/galaxy/scripts/apps/panels/tool-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Tools from "mvc/tool/tools";
import Upload from "mvc/upload/upload-view";
import _l from "utils/localization";
import ToolForm from "mvc/tool/tool-form-composite";
import _ from "libs/underscore";

var ToolPanel = Backbone.View.extend({
initialize: function(page, options) {
Expand All @@ -28,7 +29,8 @@ var ToolPanel = Backbone.View.extend({

// add upload modal
this.upload_button = new Upload({
nginx_upload_path: config.nginx_upload_path,
upload_path: config.nginx_upload_path || `${Galaxy.root}api/tools`,
chunk_upload_size: config.chunk_upload_size,
ftp_upload_site: config.ftp_upload_site,
default_genome: config.default_genome,
default_extension: config.default_extension
Expand Down Expand Up @@ -74,70 +76,54 @@ var ToolPanel = Backbone.View.extend({

/** build a link to one tool */
_templateTool: function(tool) {
return [
'<div class="toolTitle">',
'<a href="',
this.root,
tool.href,
'" target="galaxy_main">',
tool.title,
"</a>",
"</div>"
].join("");
return `<div class="toolTitle">
<a href="${Galaxy.root}${tool.href}" target="galaxy_main">
${tool.title}
</a>
</div>`;
},

/** build a link to 'All Workflows' */
_templateAllWorkflow: function(tool) {
return [
'<div class="toolTitle">',
// global
'<a href="',
Galaxy.root,
tool.href,
'">',
tool.title,
"</a>",
"</div>"
].join("");
return `<div class="toolTitle">
<a href="${Galaxy.root}${tool.href}">
${tool.title}
</a>
</div>`;
},

/** build links to workflows in toolpanel */
_templateWorkflowLink: function(wf) {
return [
'<div class="toolTitle">',
`<a class="${wf.cls} " href="`,
Galaxy.root,
wf.href,
'">',
wf.title,
"</a>",
"</div>"
].join("");
return `<div class="toolTitle">
<a class="${wf.cls}" href="${Galaxy.root}${wf.href}">
${_.escape(wf.title)}
</a>
</div>`;
},

/** override to include inital menu dom and workflow section */
_template: function() {
return [
'<div class="toolMenuContainer">',
'<div class="toolMenu" style="display: none">',
'<div id="search-no-results" style="display: none; padding-top: 5px">',
"<em><strong>",
_l("Search did not match any tools."),
"</strong></em>",
"</div>",
"</div>",
'<div class="toolSectionPad"/>',
'<div class="toolSectionPad"/>',
'<div class="toolSectionTitle" id="title_XXinternalXXworkflow">',
"<span>",
_l("Workflows"),
"</span>",
"</div>",
'<div id="internal-workflows" class="toolSectionBody">',
'<div class="toolSectionBg"/>',
"</div>",
"</div>"
].join("");
return `<div class="toolMenuContainer">
<div class="toolMenu" style="display: none">
<div id="search-no-results" style="display: none; padding-top: 5px">
<em>
<strong>
${_l("Search did not match any tools.")}
</strong>
</em>
</div>
</div>
<div class="toolSectionPad"/>
<div class="toolSectionPad"/>
<div class="toolSectionTitle" id="title_XXinternalXXworkflow">
<span>
${_l("Workflows")}
</span>
</div>
<div id="internal-workflows" class="toolSectionBody">
<div class="toolSectionBg"/>
</div>
</div>`;
},

toString: function() {
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/form/form-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export var matchCase = (input, value) => {
* @param{dict} callback - Called with the mapped dictionary object and corresponding model node
*/
export var visitInputs = (inputs, callback, prefix, context) => {
context = $.extend(true, {}, context);
context = $.extend({}, context);
_.each(inputs, input => {
if (input && input.type && input.name) {
context[input.name] = input;
Expand Down
5 changes: 2 additions & 3 deletions client/galaxy/scripts/mvc/form/form-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ var View = Backbone.View.extend({
},

/** Add a new input element */
add: function(input) {
var input_def = jQuery.extend(true, {}, input);
input_def.id = input.id = Utils.uid();
add: function(input_def) {
input_def.id = Utils.uid();
this.app.input_list[input_def.id] = input_def;
switch (input_def.type) {
case "conditional":
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/form/form-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default Backbone.View.extend({
.first();
$panel.animate(
{
scrollTop: $panel.scrollTop() + input_element.$el.offset().top - 120
scrollTop: $panel.scrollTop() + input_element.$el.offset().top - $panel.position().top - 120
},
500
);
Expand Down
4 changes: 3 additions & 1 deletion client/galaxy/scripts/mvc/grid/grid-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export default {
if (column.visible) {
tmpl += `<th id="${column.key}-header">`;
if (column.sortable) {
tmpl += `<a href="javascript:void(0)" class="sort-link" sort_key="${column.key}">${column.label}</a>`;
tmpl += `<a href="javascript:void(0)" class="sort-link" sort_key="${column.key}">${
column.label
}</a>`;
} else {
tmpl += column.label;
}
Expand Down
28 changes: 0 additions & 28 deletions client/galaxy/scripts/mvc/tool/tool-form-composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ var View = Backbone.View.extend({
$("body").append(this.$el);
this._configure();
this.render();
$(window).resize(() => {
self._refresh();
});
},

/** Refresh height of scrollable div below header, handle scrolling by lazy loading steps */
_refresh: function(step_index) {
var margin =
_.reduce(this.$el.children(), (memo, child) => memo + $(child).outerHeight(), 0) -
this.$steps.height() +
90;
this.$steps.css("height", $(window).height() - margin);
},

/** Configures form/step options for each workflow step */
Expand Down Expand Up @@ -201,7 +189,6 @@ var View = Backbone.View.extend({
this._renderParameters();
this._renderHistory();
this._renderUseCachedJob();
this._renderResourceParameters();
_.each(this.steps, step => {
self._renderStep(step);
});
Expand Down Expand Up @@ -312,19 +299,6 @@ var View = Backbone.View.extend({
});
this._append(this.$steps, this.history_form.$el);
},

/** Render Workflow Options */
_renderResourceParameters: function() {
this.workflow_resource_parameters_form = null;
if(!_.isEmpty(this.model.get('workflow_resource_parameters'))){
this.workflow_resource_parameters_form = new Form({
cls : 'ui-portlet-narrow',
title : '<b>Workflow Resource Options</b>',
inputs : this.model.get('workflow_resource_parameters')
});
this._append( this.$steps, this.workflow_resource_parameters_form.$el );
}
},

/** Render job caching option */
_renderUseCachedJob: function() {
Expand Down Expand Up @@ -446,7 +420,6 @@ var View = Backbone.View.extend({
}
self.forms[step.index] = form;
self._append(self.$steps, form.$el);
self._refresh();
step.needs_refresh && self._refreshStep(step);
form.portlet[!self.show_progress ? "enable" : "disable"]();
self.show_progress &&
Expand Down Expand Up @@ -548,7 +521,6 @@ var View = Backbone.View.extend({
var job_def = {
new_history_name: history_form_data["new_history|name"] ? history_form_data["new_history|name"] : null,
history_id: !history_form_data["new_history|name"] ? this.model.get("history_id") : null,
resource_params: this.workflow_resource_parameters_form ? this.workflow_resource_parameters_form.data.create() : {},
replacement_params: this.wp_form ? this.wp_form.data.create() : {},
parameters: {},
// Tool form will submit flat maps for each parameter
Expand Down
20 changes: 4 additions & 16 deletions client/galaxy/scripts/mvc/ui/ui-select-genomespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,18 @@ var View = Backbone.View.extend({
// create genomespace filepath textbox
this.filename_textbox = new Ui.Input();

// create genomespace token textbox
this.token_textbox = new Ui.Input({
type: "password"
});

// create elements
this.setElement(this._template(options));
this.$(".ui-gs-browse-button").append(this.browse_button.$el);
this.$(".ui-gs-filename-textbox").append(this.filename_textbox.$el);
this.$(".ui-gs-token-textbox").append(this.token_textbox.$el);
},

/** Browse GenomeSpace */
browseGenomeSpace: function(options) {
var self = this;
GenomespaceBrowser.openFileBrowser({
successCallback: function(data) {
self.value(`${data.destination}^${data.token}`);
self.value(data.destination);
}
});
},
Expand All @@ -56,15 +50,11 @@ var View = Backbone.View.extend({
'<span class="ui-gs-browse-button" />' +
'<span class="ui-gs-filename-textbox" />' +
"</div>" +
'<div class="ui-gs-token-field">' +
'<span class=ui-gs-label"><div class="ui-gs-token-label">Token</div></span>' +
'<span class="ui-gs-token-textbox" />' +
"</div>" +
"</div>"
);
},

/** Return/Set currently selected genomespace filename/token */
/** Return/Set currently selected genomespace filename */
value: function(new_value) {
// check if new_value is defined
if (new_value !== undefined) {
Expand All @@ -76,15 +66,13 @@ var View = Backbone.View.extend({

// get value
_getValue: function() {
return `${this.filename_textbox.value()}^${this.token_textbox.value()}`;
return this.filename_textbox.value();
},

// set value
_setValue: function(new_value) {
if (new_value) {
var values = new_value.split("^");
this.filename_textbox.value(values[0]);
this.token_textbox.value(values[1]);
this.filename_textbox.value(new_value);
}
this.options.onchange && this.options.onchange(new_value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default Backbone.View.extend({

// file upload
this.uploadbox = this.$(".upload-box").uploadbox({
url: this.app.options.nginx_upload_path,
url: this.app.options.upload_path,
announce: function(index, file) {
self._eventAnnounce(index, file);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default Backbone.View.extend({
});
});
$.uploadpost({
url: this.app.options.nginx_upload_path,
url: this.app.options.upload_path,
data: this.app.toData(this.collection.filter()),
success: function(message) {
self._eventSuccess(message);
Expand Down
11 changes: 8 additions & 3 deletions client/galaxy/scripts/mvc/upload/default/default-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default Backbone.View.extend({
init: "upload-icon-button fa fa-trash-o",
queued: "upload-icon fa fa-spinner fa-spin",
running: "upload-icon fa fa-spinner fa-spin",
warning: "upload-icon fa fa-spinner fa-spin",
success: "upload-icon-button fa fa-check",
error: "upload-icon-button fa fa-exclamation-triangle"
},
Expand Down Expand Up @@ -183,7 +184,7 @@ export default Backbone.View.extend({
_refreshInfo: function() {
var info = this.model.get("info");
if (info) {
this.$info_text.html(`<strong>Failed: </strong>${info}`).show();
this.$info_text.html(`<strong>Warning: </strong>${info}`).show();
} else {
this.$info_text.hide();
}
Expand Down Expand Up @@ -213,13 +214,17 @@ export default Backbone.View.extend({
this.select_genome.disable();
this.select_extension.disable();
}
this.$info_progress.show();
this.$el.removeClass().addClass("upload-row");
if (status == "success") {
this.$el.addClass("success");
this.$percentage.html("100%");
}
if (status == "error") {
} else if (status == "error") {
this.$el.addClass("danger");
this.$info_progress.hide();
} else if (status == "warning") {
this.$el.addClass("warning");
this.$info_progress.hide();
}
},

Expand Down

0 comments on commit 729714f

Please sign in to comment.