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
<% 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>
<% 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? %>
[
['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'],
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