9824: include workflows in project#pipeline_templates tab.
authorradhika <radhika@curoverse.com>
Tue, 30 Aug 2016 02:03:51 +0000 (22:03 -0400)
committerradhika <radhika@curoverse.com>
Tue, 30 Aug 2016 02:03:51 +0000 (22:03 -0400)
apps/workbench/app/controllers/projects_controller.rb
apps/workbench/app/controllers/workflows_controller.rb
apps/workbench/app/views/projects/_show_pipeline_templates.html.erb
apps/workbench/test/integration/anonymous_access_test.rb
services/api/app/controllers/arvados/v1/groups_controller.rb
services/api/test/fixtures/workflows.yml

index 8ec8d5e1ddf33a620ef2f01705c6802f1150f6a4..16212a8d0ad489b381aa3619d69d72443905cfcb 100644 (file)
@@ -69,7 +69,7 @@ class ProjectsController < ApplicationController
     pane_list <<
       {
         :name => 'Pipeline_templates',
-        :filters => [%w(uuid is_a arvados#pipelineTemplate)]
+        :filters => [%w(uuid is_a) + [%w(arvados#pipelineTemplate arvados#workflow)]]
       }
     pane_list <<
       {
index 94ae8a95ea719eb0845d5e53179bee11d050da63..a3ba7d66a551b9e85deb591a62182d6e2079a370 100644 (file)
@@ -1,2 +1,6 @@
 class WorkflowsController < ApplicationController
+  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+    Rails.configuration.anonymous_user_token and
+    'show' == ctrl.action_name
+  }
 end
index 402ce26f5911e59243bab999916fac11be29d008..d51e1a39c74413fe219d6f1d7bf64c2fec022364 100644 (file)
@@ -1,4 +1,5 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
-    filters: [['uuid', 'is_a', ["arvados#pipelineTemplate"]]],
-       sortable_columns: { 'name' => 'pipeline_templates.name', 'description' => 'pipeline_templates.description' }
+    limit: 50,
+    filters: [['uuid', 'is_a', ["arvados#pipelineTemplate", "arvados#workflow"]]],
+       sortable_columns: { 'name' => 'pipeline_templates.name, workflows.name', 'description' => 'pipeline_templates.description, workflows.description' }
     }.merge(local_assigns) %>
index 6e28e4efb4525363fdf3fb1184348b08d3a19647..aae8c418962098c302f9945ab0f7e350607cf03f 100644 (file)
@@ -167,24 +167,40 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
     assert_no_selector 'a', text: 'Re-run options'
   end
 
-  test "anonymous user accesses pipeline templates tab in shared project" do
-    visit PUBLIC_PROJECT
-    click_link 'Data collections'
-    assert_text 'GNU General Public License'
+  [
+    'pipelineTemplate',
+    'workflow'
+  ].each do |type|
+    test "anonymous user accesses pipeline templates tab in shared project and click on #{type}" do
+      visit PUBLIC_PROJECT
+      click_link 'Data collections'
+      assert_text 'GNU General Public License'
 
-    assert_selector 'a', text: 'Pipeline templates'
+      assert_selector 'a', text: 'Pipeline templates'
 
-    click_link 'Pipeline templates'
-    assert_text 'Pipeline template in publicly accessible project'
+      click_link 'Pipeline templates'
+      assert_text 'Pipeline template in publicly accessible project'
+      assert_text 'Workflow with input specifications'
 
-    within first('tr[data-kind="arvados#pipelineTemplate"]') do
-      click_link 'Show'
-    end
+      if type == 'pipelineTemplate'
+        within first('tr[data-kind="arvados#pipelineTemplate"]') do
+          click_link 'Show'
+        end
 
-    # in template page
-    assert_text 'Public Projects Unrestricted public data'
-    assert_text 'script version'
-    assert_no_selector 'a', text: 'Run this pipeline'
+        # in template page
+        assert_text 'Public Projects Unrestricted public data'
+        assert_text 'script version'
+        assert_no_selector 'a', text: 'Run this pipeline'
+      else
+        within first('tr[data-kind="arvados#workflow"]') do
+          click_link 'Show'
+        end
+
+        # in workflow page
+        assert_text 'Public Projects Unrestricted public data'
+        assert_text 'this workflow has inputs specified'
+      end
+    end
   end
 
   test "anonymous user accesses subprojects tab in shared project" do
index a1bfb8bc5ec6620a27d9e8da2cf87a9d885ee049..7a5713a03c59651a3bc0050674ea38171d8f9c34 100644 (file)
@@ -64,7 +64,7 @@ class Arvados::V1::GroupsController < ApplicationController
     request_filters = @filters
 
     klasses = [Group,
-     Job, PipelineInstance, PipelineTemplate, ContainerRequest,
+     Job, PipelineInstance, PipelineTemplate, ContainerRequest, Workflow,
      Collection,
      Human, Specimen, Trait]
 
index 87a343d9ab2a0607d9149661cd83cd024e08513c..e124cf85f0923c6ac21b93fc99addf4034cfdca4 100644 (file)
@@ -21,7 +21,7 @@ workflow_with_no_name_and_desc:
 
 workflow_with_input_specifications:
   uuid: zzzzz-7fd4e-validwithinputs
-  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  owner_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
   name: Workflow with input specifications
   description: this workflow has inputs specified
   created_at: <%= 1.minute.ago.to_s(:db) %>