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
Jérome Perrin
gitlab-ce
Commits
d76d051b
Commit
d76d051b
authored
Jul 25, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collapse/hide resolved discussions
parent
eeb41c75
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
app/models/discussion.rb
app/models/discussion.rb
+13
-1
app/models/note.rb
app/models/note.rb
+4
-2
No files found.
app/models/discussion.rb
View file @
d76d051b
...
...
@@ -87,8 +87,20 @@ class Discussion
self
.
noteable
==
target
&&
!
diff_discussion?
end
def
collapsed?
return
false
unless
diff_discussion?
if
resolvable?
# New diff discussions only disappear once they are marked resolved
resolved?
else
# Old diff discussions disappear once they become outdated
!
active?
end
end
def
expanded?
!
diff_discussion?
||
active
?
!
collapsed
?
end
def
reply_attributes
...
...
app/models/note.rb
View file @
d76d051b
...
...
@@ -86,8 +86,10 @@ class Note < ActiveRecord::Base
end
def
grouped_diff_discussions
notes
=
diff_notes
.
fresh
.
select
(
&
:active?
)
Discussion
.
for_diff_notes
(
notes
).
map
{
|
d
|
[
d
.
line_code
,
d
]
}.
to_h
active_notes
=
diff_notes
.
fresh
.
select
(
&
:active?
)
Discussion
.
for_diff_notes
(
active_notes
).
reject
(
&
:resolved?
).
map
{
|
d
|
[
d
.
line_code
,
d
]
}.
to_h
end
# Searches for notes matching the given query.
...
...
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