[ARVADOS] updated: 6b98fad744480d42fe084d70429bf3d658a06caa
git at public.curoverse.com
git at public.curoverse.com
Fri Feb 12 20:57:55 EST 2016
Summary of changes:
apps/workbench/app/controllers/application_controller.rb | 9 ++++++++-
.../workbench/app/views/application/_projects_tree_menu.html.erb | 4 ++--
2 files changed, 10 insertions(+), 3 deletions(-)
via 6b98fad744480d42fe084d70429bf3d658a06caa (commit)
from 42db5188e104e94ce73d743edaafb1c2053e3c0c (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 6b98fad744480d42fe084d70429bf3d658a06caa
Author: radhika <radhika at curoverse.com>
Date: Fri Feb 12 20:57:25 2016 -0500
8183: retrieve only 3 levels of projects while building projects dropdown.
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 9d38723..cc64cfd 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -841,6 +841,8 @@ class ApplicationController < ActionController::Base
from_top = []
uuids = [user.uuid]
+ depth = 0
+ @too_many_levels = false
while from_top.size <= page_size*2
current_level = Group.filter([['group_class','=','project'],
['owner_uuid', 'in', uuids]])
@@ -848,6 +850,11 @@ class ApplicationController < ActionController::Base
break if current_level.results.size == 0
from_top.concat current_level.results
uuids = current_level.results.collect { |x| x.uuid }
+ depth += 1
+ if depth >= 3
+ @too_many_levels = true
+ break
+ end
end
@my_wanted_projects = from_top
end
@@ -855,7 +862,7 @@ class ApplicationController < ActionController::Base
helper_method :my_wanted_projects_tree
def my_wanted_projects_tree user, page_size=100
build_my_wanted_projects_tree user, page_size
- [@my_wanted_projects_tree, @total_projects]
+ [@my_wanted_projects_tree, @too_many_levels]
end
def build_my_wanted_projects_tree user, page_size=100
diff --git a/apps/workbench/app/views/application/_projects_tree_menu.html.erb b/apps/workbench/app/views/application/_projects_tree_menu.html.erb
index 03cc9fe..f8918e6 100644
--- a/apps/workbench/app/views/application/_projects_tree_menu.html.erb
+++ b/apps/workbench/app/views/application/_projects_tree_menu.html.erb
@@ -15,8 +15,8 @@
<% end %>
</li>
<% end %>
-<% if my_tree[1] and my_tree[1] > my_tree[0].size %>
+<% if my_tree[1] or my_tree[0].size > 200 %>
<li role="presentation" class="dropdown-header">
- Showing your top projects, some projects have been omitted.
+ Not all projects may have been listed.
</li>
<% end %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list