mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #10953 from guerler/add_workflow_create_button
Add cancel option to workflow create form
This commit is contained in:
@@ -333,6 +333,9 @@ export const getAnalysisRouter = (Galaxy) =>
|
||||
url: "workflow/create",
|
||||
redirect: "workflow/editor",
|
||||
active_tab: "workflow",
|
||||
submit_title: "Create",
|
||||
submit_icon: "fa-check",
|
||||
cancel_redirect: "workflows/list",
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
@@ -35,6 +35,16 @@ var View = Backbone.View.extend({
|
||||
errors: options.errors,
|
||||
inputs: options.inputs,
|
||||
buttons: {
|
||||
cancel:
|
||||
options.cancel_redirect &&
|
||||
new Ui.Button({
|
||||
tooltip: options.cancel_tooltip,
|
||||
title: options.cancel_title || "Cancel",
|
||||
icon: options.cancel_icon || "fa-times",
|
||||
onclick: function () {
|
||||
window.location = `${getAppRoot()}${options.cancel_redirect}`;
|
||||
},
|
||||
}),
|
||||
submit: new Ui.Button({
|
||||
tooltip: options.submit_tooltip,
|
||||
title: options.submit_title || "Save",
|
||||
@@ -79,7 +89,7 @@ var View = Backbone.View.extend({
|
||||
};
|
||||
}
|
||||
if (self.redirect) {
|
||||
window.location = `${getAppRoot() + self.redirect}?${$.param(params)}`;
|
||||
window.location = `${getAppRoot()}${self.redirect}?${$.param(params)}`;
|
||||
} else {
|
||||
form.data.matchModel(response, (input, input_id) => {
|
||||
form.field_list[input_id].value(input.value);
|
||||
|
||||
@@ -91,8 +91,10 @@ export var View = Backbone.View.extend({
|
||||
if (options.buttons) {
|
||||
this.$buttons.empty().show();
|
||||
$.each(this.model.get("buttons"), (name, item) => {
|
||||
item.$el.prop("id", name);
|
||||
self.$buttons.append(item.$el);
|
||||
if (item) {
|
||||
item.$el.prop("id", name);
|
||||
self.$buttons.append(item.$el);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$buttons.hide();
|
||||
|
||||
Reference in New Issue
Block a user