From 241a1049be1eb101723a3714125eef8baa3c33dc Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 25 Aug 2016 11:25:03 -0400 Subject: [PATCH] 9043: Remove non-existent "Graph" tab. Fix "false" selection dropdown. Use helper function instead of duplicating regex. --- .../container_requests_controller.rb | 40 ++++++++++--------- .../app/helpers/application_helper.rb | 4 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/apps/workbench/app/controllers/container_requests_controller.rb b/apps/workbench/app/controllers/container_requests_controller.rb index 34f892a836..54e59144e7 100644 --- a/apps/workbench/app/controllers/container_requests_controller.rb +++ b/apps/workbench/app/controllers/container_requests_controller.rb @@ -5,8 +5,8 @@ class ContainerRequestsController < ApplicationController } def show_pane_list - panes = %w(Status Log Graph Advanced) - if @object and @object.state == 'Uncommitted' + panes = %w(Status Log Advanced) + if @object.andand.state == 'Uncommitted' panes = %w(Inputs) + panes - %w(Log) end panes @@ -27,23 +27,25 @@ class ContainerRequestsController < ApplicationController if input_obj workflow = @object.mounts[:"/var/lib/cwl/workflow.json"][:content] workflow[:inputs].each do |input_schema| - if input_obj.include? input_schema[:id] - required, primary_type, param_id = cwl_input_info(input_schema) - if input_obj[param_id] == "" - input_obj[param_id] = nil - elsif primary_type == "boolean" - input_obj[param_id] = input_obj[param_id] == "true" - elsif ["int", "long"].include? primary_type - input_obj[param_id] = input_obj[param_id].to_i - elsif ["float", "double"].include? primary_type - input_obj[param_id] = input_obj[param_id].to_f - elsif ["File", "Directory"].include? primary_type - input_obj[param_id].match /^([0-9a-z]{5}-([0-9a-z]{5})-[0-9a-z]{15})(\/.*)?$/ do |re| - c = display_value = Collection.find(re[1]) - input_obj[param_id] = {"class" => primary_type, - "location" => "keep:#{c.portable_data_hash}#{re[3]}", - "arv:collection" => input_obj[param_id]} - end + if not input_obj.include? input_schema[:id] + next + end + required, primary_type, param_id = cwl_input_info(input_schema) + if input_obj[param_id] == "" + input_obj[param_id] = nil + elsif primary_type == "boolean" + input_obj[param_id] = input_obj[param_id] == "true" + elsif ["int", "long"].include? primary_type + input_obj[param_id] = input_obj[param_id].to_i + elsif ["float", "double"].include? primary_type + input_obj[param_id] = input_obj[param_id].to_f + elsif ["File", "Directory"].include? primary_type + re = CollectionsHelper.match_uuid_with_optional_filepath(input_obj[param_id]) + if re + c = Collection.find(re[1]) + input_obj[param_id] = {"class" => primary_type, + "location" => "keep:#{c.portable_data_hash}#{re[4]}", + "arv:collection" => input_obj[param_id]} end end end diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index 27c7504ebb..ec2e93fc16 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -503,7 +503,7 @@ module ApplicationHelper end end elsif "boolean" == primary_type - return link_to attrvalue, '#', { + return link_to attrvalue.to_s, '#', { "data-emptytext" => "none", "data-placement" => "bottom", "data-type" => "select", @@ -512,7 +512,7 @@ module ApplicationHelper "data-title" => "Set value for #{input_schema[:id]}", "data-name" => dn, "data-pk" => "{id: \"#{object.uuid}\", key: \"#{object.class.to_s.underscore}\"}", - "data-value" => attrvalue, + "data-value" => attrvalue.to_s, # "clear" button interferes with form-control's up/down arrows "data-clear" => false, :class => "editable #{'required' if required} form-control", -- 2.30.2