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
382dab46
Commit
382dab46
authored
May 26, 2021
by
Jonas Wälter
Committed by
Heinrich Lee Yu
May 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group milestone: fix members autocomplete to include users [RUN AS-IF-FOSS]
parent
252e1089
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
app/services/groups/participants_service.rb
app/services/groups/participants_service.rb
+2
-2
spec/features/groups/milestones/gfm_autocomplete_spec.rb
spec/features/groups/milestones/gfm_autocomplete_spec.rb
+1
-0
spec/services/groups/participants_service_spec.rb
spec/services/groups/participants_service_spec.rb
+37
-0
No files found.
app/services/groups/participants_service.rb
View file @
382dab46
...
...
@@ -23,9 +23,9 @@ module Groups
end
def
group_members
return
[]
unless
noteable
return
[]
unless
group
@group_members
||=
sorted
(
noteable
.
group
.
direct_and_indirect_users
)
@group_members
||=
sorted
(
group
.
direct_and_indirect_users
)
end
end
end
spec/features/groups/milestones/gfm_autocomplete_spec.rb
View file @
382dab46
...
...
@@ -16,6 +16,7 @@ RSpec.describe 'GFM autocomplete', :js do
fill_in
'Description'
,
with:
User
.
reference_prefix
wait_for_requests
expect
(
find_autocomplete_menu
).
to
be_visible
expect_autocomplete_entry
(
user
.
name
)
expect_autocomplete_entry
(
group
.
name
)
fill_in
'Description'
,
with:
Label
.
reference_prefix
...
...
spec/services/groups/participants_service_spec.rb
0 → 100644
View file @
382dab46
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Groups
::
ParticipantsService
do
describe
'#group_members'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:parent_group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
,
parent:
parent_group
)
}
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:subproject
)
{
create
(
:project
,
group:
subgroup
)
}
it
'returns all members in parent groups, sub-groups, and sub-projects'
do
parent_group
.
add_developer
(
create
(
:user
))
subgroup
.
add_developer
(
create
(
:user
))
subproject
.
add_developer
(
create
(
:user
))
result
=
described_class
.
new
(
group
,
user
).
execute
(
nil
)
expected_users
=
(
group
.
self_and_hierarchy
.
flat_map
(
&
:users
)
+
subproject
.
users
)
.
map
{
|
user
|
user_to_autocompletable
(
user
)
}
expect
(
expected_users
.
count
).
to
eq
(
3
)
expect
(
result
).
to
include
(
*
expected_users
)
end
end
def
user_to_autocompletable
(
user
)
{
type:
user
.
class
.
name
,
username:
user
.
username
,
name:
user
.
name
,
avatar_url:
user
.
avatar_url
,
availability:
user
&
.
status
&
.
availability
}
end
end
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