Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f86f4507
Commit
f86f4507
authored
Oct 30, 2020
by
Nikola Milojevic
Committed by
Igor Drozdov
Oct 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cached queries for group_members
Add changelog of performance improvement
parent
e13e13c0
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
20 deletions
+71
-20
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+8
-2
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+14
-3
app/views/groups/group_members/index.html.haml
app/views/groups/group_members/index.html.haml
+16
-3
app/views/projects/project_members/_team.html.haml
app/views/projects/project_members/_team.html.haml
+7
-1
app/views/projects/project_members/index.html.haml
app/views/projects/project_members/index.html.haml
+3
-2
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+9
-7
app/views/shared/members/_requests.html.haml
app/views/shared/members/_requests.html.haml
+8
-1
ee/app/views/shared/members/ee/_license_badge.html.haml
ee/app/views/shared/members/ee/_license_badge.html.haml
+1
-1
ee/changelogs/unreleased/231468-fix-cached-queries-for-group-mebmers-controller.yml
...31468-fix-cached-queries-for-group-mebmers-controller.yml
+5
-0
No files found.
app/views/admin/groups/show.html.haml
View file @
f86f4507
-
add_to_breadcrumbs
_
(
"Groups"
),
admin_groups_path
-
breadcrumb_title
@group
.
name
-
page_title
@group
.
name
,
_
(
"Groups"
)
-
current_user_is_group_owner
=
@group
&&
@group
.
has_owner?
(
current_user
)
.js-remove-member-modal
%h3
.page-title
...
...
@@ -116,7 +117,7 @@
=
select_tag
:access_level
,
options_for_select
(
@group
.
access_level_roles
),
class:
"project-access-select select2"
%hr
=
button_tag
_
(
'Add users to group'
),
class:
"gl-button btn btn-success"
=
render
'shared/members/requests'
,
membership_source:
@group
,
requesters:
@requesters
,
force_mobile_view:
true
=
render
'shared/members/requests'
,
membership_source:
@group
,
group:
@group
,
requesters:
@requesters
,
force_mobile_view:
true
.card
.card-header
...
...
@@ -127,6 +128,11 @@
=
sprite_icon
(
'pencil-square'
,
css_class:
'gl-icon'
)
=
_
(
'Manage access'
)
%ul
.content-list.group-users-list.content-list.members-list
=
render
partial:
'shared/members/member'
,
collection:
@members
,
as: :member
,
locals:
{
show_controls:
false
}
=
render
partial:
'shared/members/member'
,
collection:
@members
,
as: :member
,
locals:
{
membership_source:
@group
,
group:
@group
,
show_controls:
false
,
current_user_is_group_owner:
current_user_is_group_owner
}
.card-footer
=
paginate
@members
,
param_name:
'members_page'
,
theme:
'gitlab'
app/views/admin/projects/show.html.haml
View file @
f86f4507
...
...
@@ -2,6 +2,7 @@
-
breadcrumb_title
@project
.
full_name
-
page_title
@project
.
full_name
,
_
(
"Projects"
)
-
@content_class
=
"admin-projects"
-
current_user_is_group_owner
=
@group
&&
@group
.
has_owner?
(
current_user
)
.js-remove-member-modal
%h3
.page-title
...
...
@@ -183,11 +184,16 @@
=
sprite_icon
(
'pencil-square'
,
css_class:
'gl-icon'
)
=
_
(
'Manage access'
)
%ul
.content-list.members-list
=
render
partial:
'shared/members/member'
,
collection:
@group_members
,
as: :member
,
locals:
{
show_controls:
false
}
=
render
partial:
'shared/members/member'
,
collection:
@group_members
,
as: :member
,
locals:
{
membership_source:
@project
,
group:
@group
,
show_controls:
false
,
current_user_is_group_owner:
current_user_is_group_owner
}
.card-footer
=
paginate
@group_members
,
param_name:
'group_members_page'
,
theme:
'gitlab'
=
render
'shared/members/requests'
,
membership_source:
@project
,
requesters:
@requesters
,
force_mobile_view:
true
=
render
'shared/members/requests'
,
membership_source:
@project
,
group:
@group
,
requesters:
@requesters
,
force_mobile_view:
true
.card
.card-header
...
...
@@ -199,6 +205,11 @@
=
sprite_icon
(
'pencil-square'
,
css_class:
'gl-icon'
)
=
_
(
'Manage access'
)
%ul
.content-list.project_members.members-list
=
render
partial:
'shared/members/member'
,
collection:
@project_members
,
as: :member
,
locals:
{
show_controls:
false
}
=
render
partial:
'shared/members/member'
,
collection:
@project_members
,
as: :member
,
locals:
{
membership_source:
@project
,
group:
@group
,
show_controls:
false
,
current_user_is_group_owner:
current_user_is_group_owner
}
.card-footer
=
paginate
@project_members
,
param_name:
'project_members_page'
,
theme:
'gitlab'
app/views/groups/group_members/index.html.haml
View file @
f86f4507
...
...
@@ -4,6 +4,7 @@
-
show_access_requests
=
can_manage_members
&&
@requesters
.
exists?
-
invited_active
=
params
[
:search_invited
].
present?
||
params
[
:invited_members_page
].
present?
-
vue_members_list_enabled
=
Feature
.
enabled?
(
:vue_group_members_list
,
@group
)
-
current_user_is_group_owner
=
@group
&&
@group
.
has_owner?
(
current_user
)
-
form_item_label_css_class
=
'label-bold gl-mr-2 gl-mb-0 gl-py-2 align-self-md-center'
...
...
@@ -71,7 +72,11 @@
.js-group-members-list
{
data:
group_members_list_data_attributes
(
@group
,
@members
)
}
-
else
%ul
.content-list.members-list
{
data:
{
qa_selector:
'members_list'
}
}
=
render
partial:
'shared/members/member'
,
collection:
@members
,
as: :member
=
render
partial:
'shared/members/member'
,
collection:
@members
,
as: :member
,
locals:
{
membership_source:
@group
,
group:
@group
,
current_user_is_group_owner:
current_user_is_group_owner
}
=
paginate
@members
,
theme:
'gitlab'
,
params:
{
invited_members_page:
nil
,
search_invited:
nil
}
-
if
@group
.
shared_with_group_links
.
any?
#tab-groups
.tab-pane
...
...
@@ -97,7 +102,11 @@
.js-group-invited-members-list
{
data:
group_members_list_data_attributes
(
@group
,
@invited_members
)
}
-
else
%ul
.content-list.members-list
=
render
partial:
'shared/members/member'
,
collection:
@invited_members
,
as: :member
=
render
partial:
'shared/members/member'
,
collection:
@invited_members
,
as: :member
,
locals:
{
membership_source:
@group
,
group:
@group
,
current_user_is_group_owner:
current_user_is_group_owner
}
=
paginate
@invited_members
,
param_name:
'invited_members_page'
,
theme:
'gitlab'
,
params:
{
page:
nil
}
-
if
show_access_requests
#tab-access-requests
.tab-pane
...
...
@@ -109,4 +118,8 @@
.js-group-access-requests-list
{
data:
group_members_list_data_attributes
(
@group
,
@requesters
)
}
-
else
%ul
.content-list.members-list
=
render
partial:
'shared/members/member'
,
collection:
@requesters
,
as: :member
=
render
partial:
'shared/members/member'
,
collection:
@requesters
,
as: :member
,
locals:
{
membership_source:
@group
,
group:
@group
,
current_user_is_group_owner:
current_user_is_group_owner
}
app/views/projects/project_members/_team.html.haml
View file @
f86f4507
-
project
=
local_assigns
.
fetch
(
:project
)
-
members
=
local_assigns
.
fetch
(
:members
)
-
group
=
local_assigns
.
fetch
(
:group
)
-
current_user_is_group_owner
=
group
&&
group
.
has_owner?
(
current_user
)
.card
.card-header.flex-project-members-panel
...
...
@@ -15,4 +17,8 @@
=
label_tag
:sort_by
,
_
(
'Sort by'
),
class:
'col-form-label label-bold px-2'
=
render
'shared/members/sort_dropdown'
%ul
.content-list.members-list
{
data:
{
qa_selector:
'members_list'
}
}
=
render
partial:
'shared/members/member'
,
collection:
members
,
as: :member
=
render
partial:
'shared/members/member'
,
collection:
members
,
as: :member
,
locals:
{
membership_source:
project
,
group:
group
,
current_user_is_group_owner:
current_user_is_group_owner
}
app/views/projects/project_members/index.html.haml
View file @
f86f4507
-
page_title
_
(
"Members"
)
-
can_admin_project_members
=
can?
(
current_user
,
:admin_project_member
,
@project
)
-
group
=
@project
.
group
.js-remove-member-modal
.row.gl-mt-3
...
...
@@ -32,12 +33,12 @@
-
elsif
@project
.
allowed_to_share_with_group?
.invite-group
=
render
'shared/members/invite_group'
,
access_levels:
ProjectGroupLink
.
access_options
,
default_access_level:
ProjectGroupLink
.
default_access
,
submit_url:
project_group_links_path
(
@project
),
group_link_field:
'link_group_id'
,
group_access_field:
'link_group_access'
=
render
'shared/members/requests'
,
membership_source:
@project
,
requesters:
@requesters
=
render
'shared/members/requests'
,
membership_source:
@project
,
group:
group
,
requesters:
@requesters
.clearfix
%h5
.member.existing-title
=
_
(
"Existing members and groups"
)
-
if
@group_links
.
any?
=
render
'projects/project_members/groups'
,
group_links:
@group_links
=
render
'projects/project_members/team'
,
project:
@project
,
members:
@project_members
=
render
'projects/project_members/team'
,
project:
@project
,
group:
group
,
members:
@project_members
=
paginate
@project_members
,
theme:
"gitlab"
app/views/shared/members/_member.html.haml
View file @
f86f4507
...
...
@@ -2,6 +2,9 @@
-
show_controls
=
local_assigns
.
fetch
(
:show_controls
,
true
)
-
force_mobile_view
=
local_assigns
.
fetch
(
:force_mobile_view
,
false
)
-
member
=
local_assigns
.
fetch
(
:member
)
-
current_user_is_group_owner
=
local_assigns
.
fetch
(
:current_user_is_group_owner
,
false
)
-
membership_source
=
local_assigns
.
fetch
(
:membership_source
)
-
group
=
local_assigns
.
fetch
(
:group
)
-
user
=
local_assigns
.
fetch
(
:user
,
member
.
user
)
-
source
=
member
.
source
-
override
=
member
.
try
(
:override
)
...
...
@@ -25,13 +28,13 @@
=
render
'shared/members/its_you_badge'
,
user:
user
,
current_user:
current_user
=
render_if_exists
'shared/members/ee/license_badge'
,
user:
user
,
group:
@group
=
render_if_exists
'shared/members/ee/license_badge'
,
user:
user
,
group:
group
,
current_user_is_group_owner:
current_user_is_group_owner
=
render
'shared/members/blocked_badge'
,
user:
user
=
render
'shared/members/two_factor_auth_badge'
,
user:
user
-
if
source
.
instance_of?
(
Group
)
&&
source
!=
@group
-
if
source
.
instance_of?
(
Group
)
&&
source
!=
membership_source
·
=
link_to
source
.
full_name
,
source
,
class:
"gl-display-inline-block inline-link"
...
...
@@ -57,10 +60,9 @@
=
link_to
member
.
created_by
.
name
,
user_path
(
member
.
created_by
)
=
time_ago_with_tooltip
(
member
.
created_at
)
-
if
show_roles
-
current_resource
=
@project
||
@group
.controls.member-controls.align-items-center
=
render_if_exists
'shared/members/ee/ldap_tag'
,
can_override:
member
.
can_override?
-
if
show_controls
&&
member
.
source
==
current_re
source
-
if
show_controls
&&
member
.
source
==
membership_
source
-
if
member
.
can_resend_invite?
=
link_to
sprite_icon
(
'paper-airplane'
),
polymorphic_path
([
:resend_invite
,
member
]),
...
...
@@ -88,7 +90,7 @@
class:
(
"is-active"
if
member
.
access_level
==
role_id
),
data:
{
id:
role_id
,
el_id:
dom_id
(
member
),
qa_selector:
"
#{
role
.
downcase
}
_access_level_link"
}
=
render_if_exists
'shared/members/ee/revert_ldap_group_sync_option'
,
group:
@
group
,
group:
group
,
member:
member
,
can_override:
member
.
can_override?
.clearable-input.member-form-control
{
class:
[(
"d-sm-inline-block"
unless
force_mobile_view
)]
}
...
...
@@ -125,8 +127,8 @@
=
_
(
"Delete"
)
-
unless
force_mobile_view
=
sprite_icon
(
'remove'
,
css_class:
'd-none d-sm-block gl-icon'
)
=
render_if_exists
'shared/members/ee/override_member_buttons'
,
group:
@
group
,
member:
member
,
user:
user
,
action: :edit
,
can_override:
member
.
can_override?
=
render_if_exists
'shared/members/ee/override_member_buttons'
,
group:
group
,
member:
member
,
user:
user
,
action: :edit
,
can_override:
member
.
can_override?
-
else
%span
.member-access-text.user-access-role
=
member
.
human_access
=
render_if_exists
'shared/members/ee/override_member_buttons'
,
group:
@
group
,
member:
member
,
user:
user
,
action: :confirm
,
can_override:
member
.
can_override?
=
render_if_exists
'shared/members/ee/override_member_buttons'
,
group:
group
,
member:
member
,
user:
user
,
action: :confirm
,
can_override:
member
.
can_override?
app/views/shared/members/_requests.html.haml
View file @
f86f4507
-
membership_source
=
local_assigns
.
fetch
(
:membership_source
)
-
requesters
=
local_assigns
.
fetch
(
:requesters
)
-
force_mobile_view
=
local_assigns
.
fetch
(
:force_mobile_view
,
false
)
-
group
=
local_assigns
.
fetch
(
:group
)
-
current_user_is_group_owner
=
group
&&
group
.
has_owner?
(
current_user
)
-
return
if
requesters
.
empty?
...
...
@@ -10,4 +12,9 @@
%strong
=
membership_source
.
name
%span
.badge.badge-pill
=
requesters
.
size
%ul
.content-list.members-list
=
render
partial:
'shared/members/member'
,
collection:
requesters
,
as: :member
,
locals:
{
force_mobile_view:
force_mobile_view
}
=
render
partial:
'shared/members/member'
,
collection:
requesters
,
as: :member
,
locals:
{
membership_source:
membership_source
,
group:
group
,
force_mobile_view:
force_mobile_view
,
current_user_is_group_owner:
current_user_is_group_owner
}
ee/app/views/shared/members/ee/_license_badge.html.haml
View file @
f86f4507
-
if
group
.
present?
&&
group
.
has_owner?
(
current_user
)
&&
user
.
using_gitlab_com_seat?
(
group
)
-
if
group
.
present?
&&
current_user_is_group_owner
&&
user
.
using_gitlab_com_seat?
(
group
)
=
render
'shared/members/badge'
,
type:
'light'
do
=
_
(
"Is using seat"
)
ee/changelogs/unreleased/231468-fix-cached-queries-for-group-mebmers-controller.yml
0 → 100644
View file @
f86f4507
---
title
:
Fix cached queries for Groups::GroupMembersController#index
merge_request
:
44626
author
:
type
:
performance
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment