diff --git a/client/src/entry/analysis/AnalysisRouter.js b/client/src/entry/analysis/AnalysisRouter.js index a0c5f917538..3cd82ff0e7d 100644 --- a/client/src/entry/analysis/AnalysisRouter.js +++ b/client/src/entry/analysis/AnalysisRouter.js @@ -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", }) ); }, diff --git a/client/src/mvc/form/form-wrapper.js b/client/src/mvc/form/form-wrapper.js index 0bbf51372d2..79612b2c54a 100644 --- a/client/src/mvc/form/form-wrapper.js +++ b/client/src/mvc/form/form-wrapper.js @@ -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); diff --git a/client/src/mvc/ui/ui-portlet.js b/client/src/mvc/ui/ui-portlet.js index f902117aaac..aae20cd4ab4 100644 --- a/client/src/mvc/ui/ui-portlet.js +++ b/client/src/mvc/ui/ui-portlet.js @@ -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();