Skip to content

Commit

Permalink
More fixes for the workflow list page, and some general cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Sep 27, 2017
1 parent 03394d4 commit fa4c1b5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
26 changes: 14 additions & 12 deletions client/galaxy/scripts/mvc/workflow/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-

removeWorkflow: function(){
var wfName = this.model.get('name');
if (confirm( "Are you sure you want to delete workflow '" + wfName + "'?" )) {
if (window.confirm( "Are you sure you want to delete workflow '" + wfName + "'?" )) {
this.model.destroy({
success: function() {
mod_toastr.success("Successfully deleted workflow '" + wfName + "'");
}
});
this.remove();
};
}
},

renameWorkflow: function(){
var oldName = this.model.get('name');
var newName = prompt("Enter a new Name for workflow '" + oldName + "'", oldName );
var newName = window.prompt("Enter a new Name for workflow '" + oldName + "'", oldName );
if (newName) {
this.model.save(
{ 'name': newName },
{ success: function() {
mod_toastr.success("Successfully renamed workflow '" + oldName + "' to '" + newName + "'")
mod_toastr.success("Successfully renamed workflow '" + oldName + "' to '" + newName + "'");
}
});
this.render();
}
},

copyWorkflow: function(){
self = this;
var self = this;
var oldName = this.model.get('name');
$.getJSON(this.model.urlRoot + '/' + this.model.id + '/download', function(wfJson) {
var newName = 'Copy of ' + oldName;
Expand All @@ -68,7 +68,7 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-
self.collection.create(wfJson, { at: 0,
wait: true,
success: function() {
mod_toastr.success("Successfully copied workflow '" + oldName + "' to '" + newName + "'")
mod_toastr.success("Successfully copied workflow '" + oldName + "' to '" + newName + "'");
},
error : function(model, resp, options) {
// signature seems to have changed over the course of backbone dev
Expand All @@ -78,7 +78,7 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-
});
}).error(function(jqXHR, textStatus, errorThrown) {
mod_toastr.error(jqXHR.responseJSON.err_msg);
})
});
},

_rowTemplate: function() {
Expand Down Expand Up @@ -125,8 +125,9 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-
'</ul>';
}
else {
console.debug(this.model);
return '<ul class="dropdown-menu action-dpd">' +
'<li><a href="'+ Galaxy.root +'workflow/display_by_username_and_slug?username='+ workflow.owner +'&slug='+ workflow.slug +'">View</a></li>' +
'<li><a href="'+ Galaxy.root +'workflow/display_by_username_and_slug?username='+ this.model.get("owner") +'&slug='+ this.model.get("slug") +'">View</a></li>' +
'<li><a href="'+ Galaxy.root +'workflow/run?id='+ this.model.id +'">Run</a></li>' +
'<li><a id="copy-workflow" style="cursor: pointer;">Copy</a></li>' +
'<li><a class="link-confirm-shared-'+ this.model.id +'" href="'+ Galaxy.root +'workflow/sharing?unshare_me=True&id='+ this.model.id +'">Remove</a></li>' +
Expand All @@ -140,7 +141,7 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-
title: "Workflows",
initialize: function() {
this.setElement( '<div/>' );
_.bindAll(this, 'adjustActiondropdown')
_.bindAll(this, 'adjustActiondropdown');
this.collection = new WORKFLOWS.WorkflowCollection();
this.collection.fetch().done(this.render());
this.collection.bind('add', this.appendItem);
Expand Down Expand Up @@ -177,8 +178,9 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-
var self = this;
var reader = new FileReader();
reader.onload = function(theFile) {
var wf_json;
try {
var wf_json = JSON.parse(reader.result);
wf_json = JSON.parse(reader.result);
} catch(e) {
mod_toastr.error("Could not read file '" + f.name + "'. Verify it is a valid Galaxy workflow");
wf_json = null;
Expand All @@ -188,7 +190,7 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-
at: 0,
wait: true,
success: function() {
mod_toastr.success("Successfully imported workflow '" + wf_json.name + "'")
mod_toastr.success("Successfully imported workflow '" + wf_json.name + "'");
},
error : function(model, resp, options) {
mod_toastr.error(options.errorThrown);
Expand Down Expand Up @@ -242,7 +244,7 @@ define( [ "libs/toastr", "mvc/tag", "mvc/workflow/workflow-model", "utils/query-
confirmDelete: function( workflow ) {
var $el_shared_wf_link = this.$( '.link-confirm-shared-' + workflow.id );
$el_shared_wf_link.click( function() {
return confirm( "Are you sure you want to remove the shared workflow '" + workflow.attributes.name + "'?" );
return window.confirm( "Are you sure you want to remove the shared workflow '" + workflow.attributes.name + "'?" );
});
},

Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/workflow/workflow.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/scripts/bundled/analysis.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit fa4c1b5

Please sign in to comment.