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
222c70d5
Commit
222c70d5
authored
Oct 26, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-10-26
parents
c9ce4db3
c10c553e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
app/services/resource_events/merge_into_notes_service.rb
app/services/resource_events/merge_into_notes_service.rb
+1
-1
changelogs/unreleased/bvl-preload-user-status-for-events.yml
changelogs/unreleased/bvl-preload-user-status-for-events.yml
+5
-0
spec/features/issues/resource_label_events_spec.rb
spec/features/issues/resource_label_events_spec.rb
+7
-0
spec/services/resource_events/merge_into_notes_service_spec.rb
...services/resource_events/merge_into_notes_service_spec.rb
+9
-0
No files found.
app/services/resource_events/merge_into_notes_service.rb
View file @
222c70d5
...
...
@@ -34,7 +34,7 @@ module ResourceEvents
def
label_events_by_discussion_id
return
[]
unless
resource
.
respond_to?
(
:resource_label_events
)
events
=
resource
.
resource_label_events
.
includes
(
:label
,
:user
)
events
=
resource
.
resource_label_events
.
includes
(
:label
,
user: :status
)
events
=
since_fetch_at
(
events
)
events
.
group_by
{
|
event
|
event
.
discussion_id
}
...
...
changelogs/unreleased/bvl-preload-user-status-for-events.yml
0 → 100644
View file @
222c70d5
---
title
:
Show user status for label events in system notes
merge_request
:
22609
author
:
type
:
fixed
spec/features/issues/resource_label_events_spec.rb
View file @
222c70d5
...
...
@@ -7,6 +7,7 @@ describe 'List issue resource label events', :js do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'foo'
)
}
let!
(
:user_status
)
{
create
(
:user_status
,
user:
user
)
}
context
'when user displays the issue'
do
let!
(
:note
)
{
create
(
:note_on_issue
,
author:
user
,
project:
project
,
noteable:
issue
,
note:
'some note'
)
}
...
...
@@ -23,6 +24,12 @@ describe 'List issue resource label events', :js do
expect
(
find
(
"#note_
#{
event
.
discussion_id
}
"
)).
to
have_content
'added foo label'
end
end
it
'shows the user status on the system note for the label'
do
page
.
within
(
"#note_
#{
event
.
discussion_id
}
"
)
do
expect
(
page
).
to
show_user_status
user_status
end
end
end
context
'when user adds label to the issue'
do
...
...
spec/services/resource_events/merge_into_notes_service_spec.rb
View file @
222c70d5
...
...
@@ -66,5 +66,14 @@ describe ResourceEvents::MergeIntoNotesService do
expect
(
notes
.
count
).
to
eq
1
expect
(
notes
.
first
.
discussion_id
).
to
eq
event
.
discussion_id
end
it
"preloads the note author's status"
do
event
=
create_event
(
created_at:
time
)
create
(
:user_status
,
user:
event
.
user
)
notes
=
described_class
.
new
(
resource
,
user
).
execute
expect
(
notes
.
first
.
author
.
association
(
:status
)).
to
be_loaded
end
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