2659: Collection show_files shows selection dropdown (which has only create new colle...
authorRadhika Chippada <radhika@curoverse.com>
Sun, 1 Feb 2015 16:30:40 +0000 (11:30 -0500)
committerRadhika Chippada <radhika@curoverse.com>
Sun, 1 Feb 2015 16:30:40 +0000 (11:30 -0500)
Also, dashboard displays the 'Run a pipeline' selector for active users. Upated anonymous user test to verify dashboard access.

apps/workbench/app/views/collections/_show_files.html.erb
apps/workbench/app/views/projects/_show_dashboard.html.erb
apps/workbench/test/integration/anonymous_access_test.rb

index 603dc34f4fc6ab038ad727b95688ee8e9a6831fe..d348e8d8be053fbe559bfa8c50c536f5229ca1ea 100644 (file)
@@ -22,6 +22,7 @@ function unselect_all_files() {
 <div class="selection-action-container" style="padding-left: <%=padding_left%>">
   <% if !defined? no_checkboxes or !no_checkboxes %>
   <div class="row">
+    <% if current_user.is_active %>
     <div class="pull-left">
       <div class="btn-group btn-group-sm">
         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
@@ -45,6 +46,7 @@ function unselect_all_files() {
     <div class="pull-right">
       <input class="form-control filterable-control" data-filterable-target="ul#collection_files" id="file_regex" name="file_regex" placeholder="filename regex" type="text"/>
     </div>
+    <% end %>
   </div>
   <p/>
   <% end %>
index 1fbe5057be0a9cf528553eda276297770d437010..d8045428eb7a079543e0fb05514671c76cdfbbe5 100644 (file)
@@ -3,8 +3,9 @@
     <div class="col-md-6">
       <div class="panel panel-default" style="min-height: 10.5em">
         <div class="panel-heading"><span class="panel-title">Active pipelines</span>
+          <% if current_user.is_active %>
           <span class="pull-right">
-    <%= link_to(
+          <%= link_to(
           choose_pipeline_templates_path(
             title: 'Choose a pipeline to run:',
             action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
             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 %>
-      <i class="fa fa-fw fa-gear"></i> Run a pipeline...
-    <% end %>
-    </span>
+            <i class="fa fa-fw fa-gear"></i> Run a pipeline...
+          <% end %>
+          </span>
+          <% end %>
         </div>
 
         <% _running_pipelines = running_pipelines %>
index 74d4aec970ef95f84f3cd6dc3d24dbdc1e6ac636..b4bd3b571cb8088fbdc3e65e026eec9b5bda858a 100644 (file)
@@ -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'