[ARVADOS] updated: 588a4505ac005d54b7aad208e038ded0a978425d

git at public.curoverse.com git at public.curoverse.com
Tue Aug 12 12:19:35 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/application_controller.rb   |  4 ++--
 apps/workbench/app/controllers/projects_controller.rb      |  6 ++++--
 .../app/views/projects/_show_data_collections.html.erb     |  2 +-
 .../app/views/projects/_show_jobs_and_pipelines.html.erb   |  2 +-
 .../app/views/projects/_show_other_objects.html.erb        |  2 +-
 .../app/views/projects/_show_pipeline_templates.html.erb   |  2 +-
 .../app/views/projects/_show_subprojects.html.erb          |  2 +-
 apps/workbench/test/functional/projects_controller_test.rb | 14 +++++++++++---
 8 files changed, 22 insertions(+), 12 deletions(-)

       via  588a4505ac005d54b7aad208e038ded0a978425d (commit)
       via  9d76f0c0fc0c35b70f3988695fcb253e1739e36b (commit)
      from  41e77a9116878cd9527d042ce80a987f2c04010e (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 588a4505ac005d54b7aad208e038ded0a978425d
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Aug 12 12:19:06 2014 -0400

    3531: Pass through tab_pane to reused partials, so element IDs are really unique
    across tabs.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index d472422..10a1de8 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -131,8 +131,8 @@ class ApplicationController < ActionController::Base
     respond_to do |f|
       f.json { render json: @objects }
       f.html {
-        if params['tab_pane']
-          render_pane params['tab_pane']
+        if params[:tab_pane]
+          render_pane params[:tab_pane]
         else
           render
         end
diff --git a/apps/workbench/app/views/projects/_show_data_collections.html.erb b/apps/workbench/app/views/projects/_show_data_collections.html.erb
index cd4728e..e56321d 100644
--- a/apps/workbench/app/views/projects/_show_data_collections.html.erb
+++ b/apps/workbench/app/views/projects/_show_data_collections.html.erb
@@ -1,3 +1,3 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
     filters: [['uuid', 'is_a', "arvados#collection"]]
-    } %>
+    }.merge(local_assigns) %>
diff --git a/apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb b/apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb
index 02a84c3..df31fec 100644
--- a/apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb
+++ b/apps/workbench/app/views/projects/_show_jobs_and_pipelines.html.erb
@@ -1,3 +1,3 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
     filters: [['uuid', 'is_a', ["arvados#job", "arvados#pipelineInstance"]]]
-    } %>
+    }.merge(local_assigns) %>
diff --git a/apps/workbench/app/views/projects/_show_other_objects.html.erb b/apps/workbench/app/views/projects/_show_other_objects.html.erb
index f0da35d..af6fbd1 100644
--- a/apps/workbench/app/views/projects/_show_other_objects.html.erb
+++ b/apps/workbench/app/views/projects/_show_other_objects.html.erb
@@ -1,3 +1,3 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
     filters: [['uuid', 'is_a', ["arvados#human", "arvados#specimen", "arvados#trait"]]]
-    } %>
+    }.merge(local_assigns) %>
diff --git a/apps/workbench/app/views/projects/_show_pipeline_templates.html.erb b/apps/workbench/app/views/projects/_show_pipeline_templates.html.erb
index df2d6b6..b875b08 100644
--- a/apps/workbench/app/views/projects/_show_pipeline_templates.html.erb
+++ b/apps/workbench/app/views/projects/_show_pipeline_templates.html.erb
@@ -1,3 +1,3 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
     filters: [['uuid', 'is_a', ["arvados#pipelineTemplate"]]]
-    } %>
+    }.merge(local_assigns) %>
diff --git a/apps/workbench/app/views/projects/_show_subprojects.html.erb b/apps/workbench/app/views/projects/_show_subprojects.html.erb
index 2aa2364..2c0ba60 100644
--- a/apps/workbench/app/views/projects/_show_subprojects.html.erb
+++ b/apps/workbench/app/views/projects/_show_subprojects.html.erb
@@ -1,3 +1,3 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
     filters: [['uuid', 'is_a', ["arvados#group"]]]
-    } %>
+    }.merge(local_assigns) %>

commit 9d76f0c0fc0c35b70f3988695fcb253e1739e36b
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Aug 12 12:15:45 2014 -0400

    3531: Fix ordering of combined results, add test. Anchor "desc" regexp.

diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index 1ab54d2..6287793 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -138,7 +138,7 @@ class ProjectsController < ApplicationController
       # page, and use the last item on this page as a filter for
       # retrieving the next page. Ideally the API would do this for
       # us, but it doesn't (yet).
-      nextpage_operator = /\bdesc/i =~ @order[0] ? '<' : '>'
+      nextpage_operator = /\bdesc$/i =~ @order[0] ? '<' : '>'
       @objects = []
       @name_link_for = {}
       kind_filters.each do |attr,op,val|
@@ -154,7 +154,9 @@ class ProjectsController < ApplicationController
           @objects += objects
         end
       end
-      @objects = @objects.to_a.sort_by(&:created_at).reverse[0.. at limit-1]
+      @objects = @objects.to_a.sort_by(&:created_at)
+      @objects.reverse! if nextpage_operator == '<'
+      @objects = @objects[0.. at limit-1]
       @next_page_filters = @filters.reject do |attr,op,val|
         attr == 'created_at' and op == nextpage_operator
       end
diff --git a/apps/workbench/test/functional/projects_controller_test.rb b/apps/workbench/test/functional/projects_controller_test.rb
index b3e67bc..ae0cad0 100644
--- a/apps/workbench/test/functional/projects_controller_test.rb
+++ b/apps/workbench/test/functional/projects_controller_test.rb
@@ -93,8 +93,15 @@ class ProjectsControllerTest < ActionController::TestCase
                  "Did not get exactly one row")
   end
 
-  test 'projects#show tab infinite scroll partial does not group object types' do
+  ['', ' asc', ' desc'].each do |direction|
+    test "projects#show tab partial orders correctly by #{direction}" do
+      _test_tab_content_order direction
+    end
+  end
+
+  def _test_tab_content_order direction
     get_contents_rows(limit: 100,
+                      order: "created_at#{direction}",
                       filters: [['uuid','is_a',['arvados#job',
                                                 'arvados#pipelineInstance']]])
     assert_response :success
@@ -106,8 +113,9 @@ class ProjectsControllerTest < ActionController::TestCase
       found_timestamps = 0
       tr_tag.scan(/\ data-object-created-at=\"(.*?)\"/).each do |t,|
         if last_timestamp
-          assert_operator(last_timestamp, :>=, t,
-                          "Rows are not sorted by timestamp desc")
+          correct_operator = / desc$/ =~ direction ? :>= : :<=
+          assert_operator(last_timestamp, correct_operator, t,
+                          "Rows are not sorted by created_at#{direction}")
         end
         last_timestamp = t
         found_timestamps += 1

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list