[ARVADOS] updated: b7d0b965a9a042190e42e7e06a23d36cac981454

Git user git at public.curoverse.com
Wed Jun 29 19:18:05 EDT 2016


Summary of changes:
 apps/workbench/app/assets/javascripts/infinite_scroll.js  |  3 ++-
 apps/workbench/app/controllers/projects_controller.rb     |  6 +++++-
 .../views/projects/_show_pipelines_and_processes.html.erb |  6 +++---
 .../api/app/controllers/arvados/v1/groups_controller.rb   | 14 ++++++++++++--
 services/api/test/integration/groups_test.rb              | 15 +++++++++++++++
 5 files changed, 37 insertions(+), 7 deletions(-)

       via  b7d0b965a9a042190e42e7e06a23d36cac981454 (commit)
      from  1c06ad05576d48f3474b42bde6c6a7f5c806d07d (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 b7d0b965a9a042190e42e7e06a23d36cac981454
Author: radhika <radhika at curoverse.com>
Date:   Wed Jun 29 19:16:14 2016 -0400

    9498: add support for a filter such as ["table_name.column_name", "=", "some value"] in the groups_controller -> contents method.

diff --git a/apps/workbench/app/assets/javascripts/infinite_scroll.js b/apps/workbench/app/assets/javascripts/infinite_scroll.js
index 4aa95b0..a0c9efc 100644
--- a/apps/workbench/app/assets/javascripts/infinite_scroll.js
+++ b/apps/workbench/app/assets/javascripts/infinite_scroll.js
@@ -151,7 +151,8 @@ function mergeInfiniteContentParams($container) {
     // For example, filterable.js writes filters in
     // infiniteContentParamsFilterable ("search for text foo")
     // without worrying about clobbering the filters set up by the
-    // tab pane ("only show pipelines and processes in this tab").
+    // tab pane ("only show container requests and pipeline instances
+    // in this tab").
     $.each($container.data(), function(datakey, datavalue) {
         // Note: We attach these data to DOM elements using
         // <element data-foo-bar="baz">. We store/retrieve them
diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index 173908c..3674e31 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -213,9 +213,13 @@ class ProjectsController < ApplicationController
       @name_link_for = {}
       kind_filters.each do |attr,op,val|
         (val.is_a?(Array) ? val : [val]).each do |type|
+          filters = @filters - kind_filters + [['uuid', 'is_a', type]]
+          if type == 'arvados#containerRequest'
+            filters = filters + [['container_requests.requesting_container_uuid', '=', nil]]
+          end
           objects = @object.contents(order: @order,
                                      limit: @limit,
-                                     filters: (@filters - kind_filters + [['uuid', 'is_a', type]]),
+                                     filters: filters,
                                     )
           objects.each do |object|
             @name_link_for[object.andand.uuid] = objects.links_for(object, 'name').first
diff --git a/apps/workbench/app/views/projects/_show_pipelines_and_processes.html.erb b/apps/workbench/app/views/projects/_show_pipelines_and_processes.html.erb
index f49e284..1ee3070 100644
--- a/apps/workbench/app/views/projects/_show_pipelines_and_processes.html.erb
+++ b/apps/workbench/app/views/projects/_show_pipelines_and_processes.html.erb
@@ -1,5 +1,5 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
-        limit: 50,
-	    filters: [['uuid', 'is_a', ["arvados#containerRequest", "arvados#pipelineInstance"]]],
-	    sortable_columns: { 'name' => 'container_requests.name, pipeline_instances.name', 'description' => 'container_requests.description, pipeline_instances.description' }
+      limit: 50,
+      filters: [['uuid', 'is_a', ["arvados#containerRequest", "arvados#pipelineInstance"]]],
+      sortable_columns: { 'name' => 'container_requests.name, pipeline_instances.name', 'description' => 'container_requests.description, pipeline_instances.description' }
     }.merge(local_assigns) %>
diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index 8ac40c6..bd2d13b 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -61,6 +61,10 @@ class Arvados::V1::GroupsController < ApplicationController
     request_orders = @orders.clone
     @orders = []
 
+    table_filters = []
+    @filters.each {|f| table_filters << f if f[0].split('.').size == 2}
+    @filters = @filters - table_filters
+
     [Group,
      Job, PipelineInstance, PipelineTemplate, ContainerRequest,
      Collection,
@@ -79,8 +83,14 @@ class Arvados::V1::GroupsController < ApplicationController
         @select = klass.selectable_attributes - ["manifest_text"]
       elsif klass == Group
         where_conds[:group_class] = "project"
-      elsif klass == ContainerRequest
-        where_conds[:requesting_container_uuid] = nil
+      end
+
+      table_filters.each do |f|
+        splits = f[0].split('.')
+        if splits.size == 2
+          tc = splits[0].classify.constantize rescue nil
+          where_conds[f[0].to_s] = f[2] if tc == klass
+        end
       end
 
       @objects = klass.readable_by(*@read_users).
diff --git a/services/api/test/integration/groups_test.rb b/services/api/test/integration/groups_test.rb
index 2afece9..9b2a2f3 100644
--- a/services/api/test/integration/groups_test.rb
+++ b/services/api/test/integration/groups_test.rb
@@ -91,4 +91,19 @@ class GroupsTest < ActionDispatch::IntegrationTest
     }, auth(:active)
     assert_response 422
   end
+
+  [
+    ['modified_by_user_uuid', 200],
+    ['container_requests.requesting_container_uuid', 200],
+    ['no_such_table.uuid', 200],
+    ['container_requests.no_such_column', 422],
+  ].each do |filter, resp|
+    test "get contents with '#{filter}' filter" do
+      get "/arvados/v1/groups/contents", {
+        :filters => [[filter, '=', nil]].to_json
+      }, auth(:active)
+      assert_response resp
+      assert_not_empty json_response['items'] if resp == 200
+    end
+  end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list