Skip to content
Snippets Groups Projects

Dropdown loading time preformance fix

Merged Tiago Botelho requested to merge tiagonbotelho/gitlab-ce:dropdown-load-fix into master
3 files
+ 25
21
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 14
2
@@ -90,6 +90,12 @@ class Project < Grape::Entity
end
end
class SimpleProject < Grape::Entity
expose :id
expose :name, :name_with_namespace
expose :http_url_to_repo
end
class ProjectMember < UserBasic
expose :access_level do |user, options|
options[:project].project_members.find_by(user_id: user.id).access_level
@@ -341,12 +347,18 @@ class ProjectService < Grape::Entity
end
end
class SimpleProjectWithAccess < SimpleProject
expose :permissions do
expose :project_access, using: Entities::ProjectAccess do |project, options|
project.project_members.find_by(user_id: options[:user].id)
end
end
end
class ProjectWithAccess < Project
expose :permissions do
expose :project_access, using: Entities::ProjectAccess do |project, options|
project = Project.find_by(project[:id])
project.project_members.find_by(user_id: options[:user].id)
]
end
expose :group_access, using: Entities::GroupAccess do |project, options|
Loading