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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
b06d5b96
Commit
b06d5b96
authored
Sep 13, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return only group's members in user dropdowns on issuables list pages
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
cbdd13f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
0 deletions
+55
-0
app/assets/javascripts/filtered_search/dropdown_user.js
app/assets/javascripts/filtered_search/dropdown_user.js
+5
-0
changelogs/unreleased/20824-scope-users-to-members-in-group-issuable-list.yml
...d/20824-scope-users-to-members-in-group-issuable-list.yml
+5
-0
spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb
...roups/user_sees_users_dropdowns_in_issuables_list_spec.rb
+22
-0
spec/javascripts/filtered_search/dropdown_user_spec.js
spec/javascripts/filtered_search/dropdown_user_spec.js
+2
-0
spec/support/shared_examples/features/issuables_user_dropdown_behaviors_shared_examples.rb
...ures/issuables_user_dropdown_behaviors_shared_examples.rb
+21
-0
spec/support/shared_examples/features/project_features_apply_to_issuables_shared_examples.rb
...es/project_features_apply_to_issuables_shared_examples.rb
+0
-0
No files found.
app/assets/javascripts/filtered_search/dropdown_user.js
View file @
b06d5b96
...
@@ -15,6 +15,7 @@ class DropdownUser extends gl.FilteredSearchDropdown {
...
@@ -15,6 +15,7 @@ class DropdownUser extends gl.FilteredSearchDropdown {
params
:
{
params
:
{
per_page
:
20
,
per_page
:
20
,
active
:
true
,
active
:
true
,
group_id
:
this
.
getGroupId
(),
project_id
:
this
.
getProjectId
(),
project_id
:
this
.
getProjectId
(),
current_user
:
true
,
current_user
:
true
,
},
},
...
@@ -47,6 +48,10 @@ class DropdownUser extends gl.FilteredSearchDropdown {
...
@@ -47,6 +48,10 @@ class DropdownUser extends gl.FilteredSearchDropdown {
super
.
renderContent
(
forceShowList
);
super
.
renderContent
(
forceShowList
);
}
}
getGroupId
()
{
return
this
.
input
.
getAttribute
(
'
data-group-id
'
);
}
getProjectId
()
{
getProjectId
()
{
return
this
.
input
.
getAttribute
(
'
data-project-id
'
);
return
this
.
input
.
getAttribute
(
'
data-project-id
'
);
}
}
...
...
changelogs/unreleased/20824-scope-users-to-members-in-group-issuable-list.yml
0 → 100644
View file @
b06d5b96
---
title
:
Return only group's members in user dropdowns on issuables list pages
merge_request
:
14249
author
:
type
:
changed
spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb
0 → 100644
View file @
b06d5b96
require
'spec_helper'
feature
'Groups > User sees users dropdowns in issuables list'
do
let
(
:entity
)
{
create
(
:group
)
}
let
(
:user_in_dropdown
)
{
create
(
:user
)
}
let!
(
:user_not_in_dropdown
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
group:
entity
)
}
before
do
entity
.
add_developer
(
user_in_dropdown
)
end
it_behaves_like
'issuable user dropdown behaviors'
do
let
(
:issuable
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issuables_path
)
{
issues_group_path
(
entity
)
}
end
it_behaves_like
'issuable user dropdown behaviors'
do
let
(
:issuable
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:issuables_path
)
{
merge_requests_group_path
(
entity
)
}
end
end
spec/javascripts/filtered_search/dropdown_user_spec.js
View file @
b06d5b96
...
@@ -10,6 +10,7 @@ describe('Dropdown User', () => {
...
@@ -10,6 +10,7 @@ describe('Dropdown User', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
bindEvents
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
bindEvents
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getProjectId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getProjectId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getGroupId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUtils
,
'
getSearchInput
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUtils
,
'
getSearchInput
'
).
and
.
callFake
(()
=>
{});
dropdownUser
=
new
gl
.
DropdownUser
({
dropdownUser
=
new
gl
.
DropdownUser
({
...
@@ -38,6 +39,7 @@ describe('Dropdown User', () => {
...
@@ -38,6 +39,7 @@ describe('Dropdown User', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
bindEvents
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
bindEvents
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getProjectId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getProjectId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getGroupId
'
).
and
.
callFake
(()
=>
{});
});
});
it
(
'
should return endpoint
'
,
()
=>
{
it
(
'
should return endpoint
'
,
()
=>
{
...
...
spec/support/shared_examples/features/issuables_user_dropdown_behaviors_shared_examples.rb
0 → 100644
View file @
b06d5b96
shared_examples
'issuable user dropdown behaviors'
do
include
FilteredSearchHelpers
before
do
issuable
# ensure we have at least one issuable
sign_in
(
user_in_dropdown
)
end
%w[author assignee]
.
each
do
|
dropdown
|
describe
"
#{
dropdown
}
dropdown"
,
:js
do
it
'only includes members of the project/group'
do
visit
issuables_path
filtered_search
.
set
(
"
#{
dropdown
}
:"
)
expect
(
find
(
"#js-dropdown-
#{
dropdown
}
.filter-dropdown"
)).
to
have_content
(
user_in_dropdown
.
name
)
expect
(
find
(
"#js-dropdown-
#{
dropdown
}
.filter-dropdown"
)).
not_to
have_content
(
user_not_in_dropdown
.
name
)
end
end
end
end
spec/support/project_features_apply_to_issuables_shared_examples.rb
→
spec/support/
shared_examples/features/
project_features_apply_to_issuables_shared_examples.rb
View file @
b06d5b96
File moved
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