From: Radhika Chippada Date: Sun, 1 Feb 2015 16:30:40 +0000 (-0500) Subject: 2659: Collection show_files shows selection dropdown (which has only create new colle... X-Git-Tag: 1.1.0~1844^2~51 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/c8f0f0c517af5462c68bcadd72e557e390f1ee19 2659: Collection show_files shows selection dropdown (which has only create new collection from selected files option) when user is active. Also, dashboard displays the 'Run a pipeline' selector for active users. Upated anonymous user test to verify dashboard access. --- diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb index 603dc34f4f..d348e8d8be 100644 --- a/apps/workbench/app/views/collections/_show_files.html.erb +++ b/apps/workbench/app/views/collections/_show_files.html.erb @@ -22,6 +22,7 @@ function unselect_all_files() {
<% if !defined? no_checkboxes or !no_checkboxes %>
+ <% if current_user.is_active %>
@@ -45,6 +46,7 @@ function unselect_all_files() {
+ <% end %>

<% end %> diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb index 1fbe5057be..d8045428eb 100644 --- a/apps/workbench/app/views/projects/_show_dashboard.html.erb +++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb @@ -3,8 +3,9 @@

Active pipelines + <% if current_user.is_active %> - <%= link_to( + <%= link_to( choose_pipeline_templates_path( title: 'Choose a pipeline to run:', action_name: 'Next: choose inputs ', @@ -12,9 +13,10 @@ action_method: 'post', action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => current_user.uuid, 'success' => 'redirect-to-created-object'}.to_json), { class: "btn btn-primary btn-xs", remote: true }) do %> - Run a pipeline... - <% end %> - + Run a pipeline... + <% end %> + + <% end %>
<% _running_pipelines = running_pipelines %> diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb index 74d4aec970..b4bd3b571c 100644 --- a/apps/workbench/test/integration/anonymous_access_test.rb +++ b/apps/workbench/test/integration/anonymous_access_test.rb @@ -121,6 +121,18 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest visit "/projects/#{api_fixture('groups')['anonymously_accessible_project']['uuid']}/?public_data=true" end + test "verify dashboard when anonymous user accesses shared project" do + visit_publicly_accessible_project + assert_selector 'a', text: 'You are viewing public data' + + # go to dashboard + click_link 'You are viewing public data' + assert_no_selector 'a', text: 'Run a pipeline' + assert_selector 'a', text: 'All pipelines' + assert_selector 'a', text: 'All jobs' + assert_selector 'a', text: 'All collections' + end + test "anonymous user accesses data collections tab in shared project" do visit_publicly_accessible_project @@ -134,6 +146,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest # in collection page assert_no_selector 'input', text: 'Create sharing link' assert_no_selector 'a', text: 'Upload' + assert_no_selector 'button', 'Selection' within ('#collection_files') do assert_text 'GNU_General_Public_License,_version_3.pdf'