[ARVADOS] updated: f8dab15791a8f19839f9db529a820b41f10440ae

git at public.curoverse.com git at public.curoverse.com
Thu Oct 23 09:38:55 EDT 2014


Summary of changes:
 .../app/controllers/projects_controller.rb         | 24 +++++++++++++++++++++-
 .../views/projects/_show_data_collections.html.erb |  1 +
 .../projects/_show_jobs_and_pipelines.html.erb     |  1 +
 .../views/projects/_show_other_objects.html.erb    |  1 +
 .../projects/_show_pipeline_templates.html.erb     |  1 +
 .../app/views/projects/_show_subprojects.html.erb  |  1 +
 .../app/views/projects/_show_tab_contents.html.erb |  2 +-
 7 files changed, 29 insertions(+), 2 deletions(-)

       via  f8dab15791a8f19839f9db529a820b41f10440ae (commit)
      from  c6056f6f1bb99fa10bc2046266accc4a85f66aad (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 f8dab15791a8f19839f9db529a820b41f10440ae
Author: radhika <radhika at curoverse.com>
Date:   Thu Oct 23 09:37:40 2014 -0400

    4091: pass limit parameter from project tabs.

diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index b77a489..56bcd0a 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -205,11 +205,33 @@ class ProjectsController < ApplicationController
       @next_page_filters = @filters.reject do |attr,op,val|
         attr == 'created_at' and op == nextpage_operator
       end
+
+      # We are using created_at time slightly greater/lower than the last object created_at (see next block comment).
+      # This would mean that the server would now return the previous last item(s) with matching created_at again.
+      # Hence, we need to remove the previous last item (last_uuid) from results before displaying the rest of the
+      # results to prevent "infinite" infinite scrolling.
+      if params['last_uuid'] and @objects.any?
+        @objects.each do |obj|
+          @objects.delete obj if obj.uuid.eql?(params['last_uuid'])
+        end
+      end
+
       if @objects.any?
+        last_created_at = @objects.last.created_at
+
+        # In order to prevent losing item(s) that have the same created_at time as the current page last item,
+        # next page should look for objects with created_at time slightly greater/lower than the current last.
+        if nextpage_operator == '<'
+          last_created_at += 1
+        else
+          last_created_at -= 1
+        end
+
         @next_page_filters += [['created_at',
                                 nextpage_operator,
-                                @objects.last.created_at]]
+                                last_created_at]]
         @next_page_href = url_for(partial: :contents_rows,
+                                  last_uuid: @objects.last.uuid,
                                   filters: @next_page_filters.to_json)
       else
         @next_page_href = nil
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 e56321d..f2995c9 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,4 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
+    limit: 200,
     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 df31fec..3007857 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,4 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
+    limit: 100,
     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 af6fbd1..1553915 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,4 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
+    limit: 200,
     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 b875b08..6d8cd75 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,4 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
+    limit: 200,
     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 2c0ba60..556b7bd 100644
--- a/apps/workbench/app/views/projects/_show_subprojects.html.erb
+++ b/apps/workbench/app/views/projects/_show_subprojects.html.erb
@@ -1,3 +1,4 @@
 <%= render_pane 'tab_contents', to_string: true, locals: {
+    limit: 200,
     filters: [['uuid', 'is_a', ["arvados#group"]]]
     }.merge(local_assigns) %>
diff --git a/apps/workbench/app/views/projects/_show_tab_contents.html.erb b/apps/workbench/app/views/projects/_show_tab_contents.html.erb
index 0f9901a..fa0578c 100644
--- a/apps/workbench/app/views/projects/_show_tab_contents.html.erb
+++ b/apps/workbench/app/views/projects/_show_tab_contents.html.erb
@@ -75,7 +75,7 @@
       <col width="60%" style="width: 60%;" />
       <col width="40%" style="width: 40%;" />
     </colgroup>
-    <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows %>" data-infinite-content-params-projecttab="<%= {filters: filters}.to_json %>">
+    <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows %>" data-infinite-content-params-projecttab="<%= {limit: limit, filters: filters}.to_json %>">
     </tbody>
     <thead>
       <tr>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list