From 8bf6fa59c142e7682c7ea673261f5d758dd99a38 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Mon, 25 Mar 2019 16:01:44 -0400 Subject: [PATCH 1/4] include href attribute with menu items, this allows proper styling --- client/galaxy/scripts/ui/popupmenu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/galaxy/scripts/ui/popupmenu.js b/client/galaxy/scripts/ui/popupmenu.js index 68b68d51c29..4b03bef1d67 100644 --- a/client/galaxy/scripts/ui/popupmenu.js +++ b/client/galaxy/scripts/ui/popupmenu.js @@ -37,11 +37,12 @@ export function make_popupmenu(button_element, initial_options) { $.each(options, (k, v) => { if (v) { // Action can be either an anonymous function and a mapped dict. - var action = v.action || v; + let action = v.action || v; + let url = v.url || "javascript:void(0);"; menu_element.append( $("
  • ").append( $("") - .attr("href", v.url) + .attr("href", url) .html(k) .click(action) ) From cb54fd7e9fd87ed53d1054c8580f9ab2c0e2f39b Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Mon, 25 Mar 2019 16:02:08 -0400 Subject: [PATCH 2/4] move 'run' and 'save' out of the hidden cog menu also add titles and aria labels --- .../galaxy/scripts/mvc/workflow/workflow-view.js | 10 ++++++---- templates/webapps/galaxy/workflow/editor.mako | 14 +++++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view.js b/client/galaxy/scripts/mvc/workflow/workflow-view.js index 7c166b83eae..3d5c1029a67 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view.js @@ -378,12 +378,14 @@ export default Backbone.View.extend({ // Load workflow definition this.load_workflow(self.options.id, self.options.version); if (make_popupmenu) { + document.getElementById('workflow-run-button').onclick=function(){ + window.location = `${getAppRoot()}workflows/run?id=${self.options.id}`; + } + document.getElementById('workflow-save-button').onclick=function(){ + save_current_workflow(); + } make_popupmenu($("#workflow-options-button"), { - Save: save_current_workflow, "Save As": workflow_save_as, - Run: function() { - window.location = `${getAppRoot()}workflows/run?id=${self.options.id}`; - }, "Edit Attributes": function() { self.workflow.clear_active_node(); }, diff --git a/templates/webapps/galaxy/workflow/editor.mako b/templates/webapps/galaxy/workflow/editor.mako index aa55bfbd47b..9a2f1b0cda5 100644 --- a/templates/webapps/galaxy/workflow/editor.mako +++ b/templates/webapps/galaxy/workflow/editor.mako @@ -225,10 +225,18 @@ <%def name="center_panel()">
    -
    - -
    + ${h.to_unicode( stored.name ) | h}
    From 9852c2d5ac084c819c4301e928e5b4b49122577e Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Tue, 26 Mar 2019 15:41:16 -0400 Subject: [PATCH 3/4] adjust selenium tests for the new button --- test/galaxy_selenium/navigates_galaxy.py | 6 ++++++ test/selenium_tests/test_workflow_editor.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/galaxy_selenium/navigates_galaxy.py b/test/galaxy_selenium/navigates_galaxy.py index 10ab5a61429..b2c7bbcbbaf 100644 --- a/test/galaxy_selenium/navigates_galaxy.py +++ b/test/galaxy_selenium/navigates_galaxy.py @@ -800,6 +800,12 @@ class NavigatesGalaxy(HasDriver): def workflow_editor_options_menu_element(self): return self.wait_for_selector_visible("#workflow-options-button-menu") + def workflow_editor_click_run(self): + return self.wait_for_and_click_selector("#workflow-run-button") + + def workflow_editor_click_save(self): + return self.wait_for_and_click_selector("#workflow-save-button") + def admin_open(self): self.components.masthead.admin.wait_for_and_click() diff --git a/test/selenium_tests/test_workflow_editor.py b/test/selenium_tests/test_workflow_editor.py index 0b124e696e5..8dd51dda85b 100644 --- a/test/selenium_tests/test_workflow_editor.py +++ b/test/selenium_tests/test_workflow_editor.py @@ -335,7 +335,7 @@ steps: self.screenshot("workflow_editor_missing_tool") def workflow_editor_save_and_close(self): - self.workflow_editor_click_option("Save") + self.workflow_editor_click_save() self.workflow_editor_click_option("Close") def workflow_editor_maximize_center_pane(self, collapse_left=True, collapse_right=True): From b9c6a1e77b2d781a475a3b852622806039a80f4a Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Tue, 23 Apr 2019 11:34:03 -0400 Subject: [PATCH 4/4] convert to using jquery without it there is some sort of race condition with the element render --- client/galaxy/scripts/mvc/workflow/workflow-view.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view.js b/client/galaxy/scripts/mvc/workflow/workflow-view.js index 3d5c1029a67..ff77da391e4 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view.js @@ -378,12 +378,8 @@ export default Backbone.View.extend({ // Load workflow definition this.load_workflow(self.options.id, self.options.version); if (make_popupmenu) { - document.getElementById('workflow-run-button').onclick=function(){ - window.location = `${getAppRoot()}workflows/run?id=${self.options.id}`; - } - document.getElementById('workflow-save-button').onclick=function(){ - save_current_workflow(); - } + $("#workflow-run-button").click(() => window.location = `${getAppRoot()}workflows/run?id=${self.options.id}`); + $("#workflow-save-button").click(() => save_current_workflow()); make_popupmenu($("#workflow-options-button"), { "Save As": workflow_save_as, "Edit Attributes": function() {