[ARVADOS] updated: bb1380996abe05337ba86061f5edd921dd3b9193
git at public.curoverse.com
git at public.curoverse.com
Wed Apr 15 14:01:42 EDT 2015
Summary of changes:
apps/workbench/app/helpers/application_helper.rb | 5 ++---
apps/workbench/app/helpers/pipeline_instances_helper.rb | 7 +++++++
.../app/views/pipeline_instances/_show_components.html.erb | 6 +-----
.../app/views/pipeline_instances/_show_inputs.html.erb | 6 +-----
apps/workbench/test/integration/anonymous_access_test.rb | 14 +++++++++++++-
5 files changed, 24 insertions(+), 14 deletions(-)
via bb1380996abe05337ba86061f5edd921dd3b9193 (commit)
from efa119244cd38090933fbd0ba29f3604889e9aa9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit bb1380996abe05337ba86061f5edd921dd3b9193
Author: Radhika Chippada <radhika at curoverse.com>
Date: Wed Apr 15 13:44:17 2015 -0400
5417: add additional test updates to verify Run button status when input is not readable.
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 09adfef..4af7d29 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -186,9 +186,8 @@ module ApplicationHelper
readable = object_readable attrvalue, resource_class
if readable
link_to_if_arvados_object attrvalue, opts
- elsif opts[:required]
- raw('<div><input type="text" style="border:none;width:100%;background:#ffdddd" disabled=true class="required unreadable-input" value="' +
- link_text_if_not_readable + '" ></input></div>')
+ elsif opts[:required] and current_user # no need to show this for anonymous user
+ raw('<div><input type="text" style="border:none;width:100%;background:#ffdddd" disabled=true class="required unreadable-input" value="' + link_text_if_not_readable + '" ></input></div>')
else
link_text_if_not_readable
end
diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb
index b0d5216..3fbd272 100644
--- a/apps/workbench/app/helpers/pipeline_instances_helper.rb
+++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb
@@ -306,4 +306,11 @@ module PipelineInstancesHelper
raw(s)
end
+ def render_unreadable_inputs_present
+ if current_user and controller.class.name.eql?('PipelineInstancesController') and unreadable_inputs_present?
+ raw('<div class="unreadable-inputs-present">' +
+ '<p style="color:#ff6666">One or more inputs provided are not readable by you. ' +
+ 'Please correct these before you can run the pipeline.</p></div>')
+ end
+ end
end
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
index a2dbada..dae57aa 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
@@ -13,11 +13,7 @@
<% else %>
<%# state is either New or Ready %>
- <% if controller.class.name.eql?('PipelineInstancesController') and unreadable_inputs_present? %>
- <div class="unreadable-inputs-present">
- <p style="color:#ff6666"> One or more inputs provided are not readable by you. Please correct these before you can run the pipeline.</p>
- </div>
- <% end %>
+ <%= render_unreadable_inputs_present %>
<p><i>Here are all of the pipeline's components (jobs that will need to run in order to complete the pipeline). If you know what you're doing (or you're experimenting) you can modify these parameters before starting the pipeline. Usually, you only need to edit the settings presented on the "Inputs" tab above.</i></p>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
index 67afba1..567ca72 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
@@ -32,11 +32,7 @@
<% if n_inputs == 0 %>
<p>This pipeline does not need any further inputs specified. You can start it by clicking the "Run" button whenever you're ready. (It's not too late to change existing settings, though.)</p>
<% else %>
- <% if controller.class.name.eql?('PipelineInstancesController') and unreadable_inputs_present? %>
- <div class="unreadable-inputs-present">
- <p style="color:#ff6666"> One or more inputs provided are not readable by you. Please correct these before you can run the pipeline.</p>
- </div>
- <% end %>
+ <%= render_unreadable_inputs_present %>
<p><i>Provide <%= n_inputs > 1 ? 'values' : 'a value' %> for the following <%= n_inputs > 1 ? 'parameters' : 'parameter' %>, then click the "Run" button to start the pipeline.</i></p>
<% if @object.editable? %>
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index e891779..d1782b8 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -243,6 +243,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
[
['new_pipeline_in_publicly_accessible_project', true],
+ ['new_pipeline_in_publicly_accessible_project', true, 'spectator'],
['new_pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false],
['new_pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false, 'spectator'],
['new_pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', true, 'admin'],
@@ -264,13 +265,24 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
if user == 'admin'
assert_text 'input'
assert_selector 'a', text: 'Choose'
+ assert_selector 'a', text: 'Run'
+ assert_no_selector 'a.disabled', text: 'Run'
else
assert_selector 'a', text: object['components']['foo']['script_parameters']['input']['value']
+ user ? (assert_selector 'a', text: 'Run') : (assert_no_selector 'a', text: 'Run')
end
else
assert_no_text 'This pipeline was created from' # template is not readable
- assert_text object['components']['foo']['script_parameters']['input']['value']
assert_no_selector 'a', text: object['components']['foo']['script_parameters']['input']['value']
+ if user
+ assert_text "One or more inputs provided are not readable"
+ assert_selector "input[type=text][value=#{object['components']['foo']['script_parameters']['input']['value']}]"
+ assert_selector 'a.disabled', text: 'Run'
+ else
+ assert_no_text "One or more inputs provided are not readable"
+ assert_text object['components']['foo']['script_parameters']['input']['value']
+ assert_no_selector 'a', text: 'Run'
+ end
end
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list