Commit 1abfc073 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix performance issue for "Share project with other groups" page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 0ebfe61b
...@@ -79,6 +79,8 @@ class Dispatcher ...@@ -79,6 +79,8 @@ class Dispatcher
new ProjectFork() new ProjectFork()
when 'users:show' when 'users:show'
new User() new User()
when 'projects:group_links:index'
new GroupsSelect()
switch path.first() switch path.first()
when 'admin' when 'admin'
......
...@@ -4,9 +4,6 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -4,9 +4,6 @@ class Projects::GroupLinksController < Projects::ApplicationController
def index def index
@group_links = project.project_group_links.all @group_links = project.project_group_links.all
@available_groups = Group.all
@available_groups -= project.invited_groups
@available_groups -= [project.group]
end end
def create def create
......
...@@ -20,20 +20,20 @@ ...@@ -20,20 +20,20 @@
%i.icon-remove %i.icon-remove
disable sharing disable sharing
- if @available_groups.present?
.available-groups .available-groups
%h4 %h4
Can be shared with Can be shared with
%div %div
= form_tag project_group_links_path(@project), method: :post, class: 'form-horizontal' do = form_tag project_group_links_path(@project), method: :post, class: 'form-horizontal' do
.form-group .form-group
= label_tag :group_id, 'Group', class: 'control-label' = label_tag :group_id, 'Group', class: 'control-label'
.col-sm-10 .col-sm-10
= select_tag :group_id, options_from_collection_for_select(@available_groups, :id, :name), class: 'select2' = groups_select_tag(:group_id)
.form-group .form-group
= label_tag :group_access, 'Max access level', class: 'control-label' = label_tag :group_access, 'Max access level', class: 'control-label'
.col-sm-10 .col-sm-10
= select_tag :group_access, options_for_select(ProjectGroupLink.access_options, ProjectGroupLink.default_access), class: "form-control" = select_tag :group_access, options_for_select(ProjectGroupLink.access_options, ProjectGroupLink.default_access), class: "form-control"
.form-actions .form-actions
= submit_tag "Share", class: "btn btn-create" = submit_tag "Share", class: "btn btn-create"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment