8183: show only toplevel projects in the Projects dropdown in breadcrumbs.
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index db00be390a7e6846c2c8983efb90c2f213fd4336..ace9276e37fb222823d52217379c5615df96ac16 100644 (file)
@@ -707,6 +707,7 @@ class ApplicationController < ActionController::Base
   @@notification_tests = []
 
   @@notification_tests.push lambda { |controller, current_user|
+    return nil if Rails.configuration.shell_in_a_box_url
     AuthorizedKey.limit(1).where(authorized_user_uuid: current_user.uuid).each do
       return nil
     end
@@ -832,6 +833,12 @@ class ApplicationController < ActionController::Base
     {collections: c, owners: own}
   end
 
+  helper_method :my_toplevel_projects
+  def my_toplevel_projects
+    @my_toplevel_projects ||= Group.
+      filter([['group_class','=','project'], ['owner_uuid', '=', current_user.uuid]]).order('name')
+  end
+
   helper_method :my_project_tree
   def my_project_tree
     build_project_trees