From 6fee45fbfda52146faec6f89ebb59de068f4541d Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 6 Apr 2015 11:37:47 -0400 Subject: [PATCH] Bugfixes for runtime parameter handling in the workflow run form. The behavior of these forms was modified in PR 433 (https://bitbucket.org/galaxy/galaxy-central/pull-request/433/fix-allow-editing-workflows-on-the-fly-for/diff# - not merged by me :| ) - so that the entire workflow would be submitted as runtime parameters on each submission. In addition to this causing bugs related to unvalidated parameters https://trello.com/c/72WuZ8mu and other problems with select parameters (e.g. http://dev.list.galaxyproject.org/Workflow-bug-when-loc-entries-are-missing-tc4666875.html) - I just discovered it would also cause the modified value to be submitted even if the user opts to undo the selection of a runtime workflow parameter and restore the previous selection (i.e. the form would show the original value but the new value would be submitted). This PR restores the previous behavior of giving the submitted form elements a unique name so every value in the workflow is not replaced as part of the submission - fixing the former problem. The new technique also fixes the other problem as well. --- templates/webapps/galaxy/workflow/run.mako | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/templates/webapps/galaxy/workflow/run.mako b/templates/webapps/galaxy/workflow/run.mako index b70f07142dd..dfcdd9ec189 100644 --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -154,11 +154,11 @@ $(".workflow-edit-button").on("click",function(){ var state = $(this).attr("name"); - var stepToolBox = $(this).parent().find('input:not([class]):not([type="hidden"]), select:not([class])'); - var labels = $(this).parent().find('label'); + var stepToolBox = $(this).parent().parent().find('.editable-param').find('input:not([class]):not([type="hidden"]), select:not([class])'); + var labels = $(this).parent().parent().find('.editable-param').find('label'); var split_name = stepToolBox.attr("name").split("|"); var step_id = split_name[0]; - var step_name = split_name.slice(1, split_name.length).join("|"); + var step_name = split_name.slice(2, split_name.length).join("|"); var hidden_html = ""; var html = ""; if (state === "edit"){ @@ -179,9 +179,9 @@ } else{ $(this).parent().find(".editable").hide(); + $(this).parent().find(".editable").empty(); $(this).parent().parent().find(".uneditable_field").show(); $(this).attr("name", "edit"); - stepToolBox.hide(); readyParameter($(this)); } }).each(function(i, icon) { @@ -281,6 +281,9 @@ .editable { display: none; } + .editable-param { + display: none; + } .workflow-edit-button-editing { color: black; @@ -448,11 +451,17 @@ if wf_parms: - ${param.get_html_field( t, value, other_values).get_html( str(step.id) + "|"+ prefix )} + + + ${param.get_html_field( t, value, other_values).get_html( str(step.id) + "|"+ "editable" + "|" + prefix )} + %endif %endif