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
Boxiang Sun
gitlab-ce
Commits
080924f9
Commit
080924f9
authored
Aug 19, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug where notes weren’t shown in discussion when the code had changed after creation
parent
8d3ef366
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/concerns/note_on_diff.rb
app/models/concerns/note_on_diff.rb
+4
-0
app/models/diff_note.rb
app/models/diff_note.rb
+4
-0
app/models/discussion.rb
app/models/discussion.rb
+1
-0
app/models/legacy_diff_note.rb
app/models/legacy_diff_note.rb
+4
-0
app/views/discussions/_diff_with_notes.html.haml
app/views/discussions/_diff_with_notes.html.haml
+1
-1
No files found.
app/models/concerns/note_on_diff.rb
View file @
080924f9
...
@@ -17,6 +17,10 @@ module NoteOnDiff
...
@@ -17,6 +17,10 @@ module NoteOnDiff
raise
NotImplementedError
raise
NotImplementedError
end
end
def
original_line_code
raise
NotImplementedError
end
def
diff_attributes
def
diff_attributes
raise
NotImplementedError
raise
NotImplementedError
end
end
...
...
app/models/diff_note.rb
View file @
080924f9
...
@@ -57,6 +57,10 @@ class DiffNote < Note
...
@@ -57,6 +57,10 @@ class DiffNote < Note
diff_file
.
position
(
line
)
==
self
.
original_position
diff_file
.
position
(
line
)
==
self
.
original_position
end
end
def
original_line_code
self
.
diff_file
.
line_code
(
self
.
diff_line
)
end
def
active?
(
diff_refs
=
nil
)
def
active?
(
diff_refs
=
nil
)
return
false
unless
supported?
return
false
unless
supported?
return
true
if
for_commit?
return
true
if
for_commit?
...
...
app/models/discussion.rb
View file @
080924f9
...
@@ -12,6 +12,7 @@ class Discussion
...
@@ -12,6 +12,7 @@ class Discussion
:for_merge_request?
,
:for_merge_request?
,
:line_code
,
:line_code
,
:original_line_code
,
:diff_file
,
:diff_file
,
:for_line?
,
:for_line?
,
:active?
,
:active?
,
...
...
app/models/legacy_diff_note.rb
View file @
080924f9
...
@@ -49,6 +49,10 @@ class LegacyDiffNote < Note
...
@@ -49,6 +49,10 @@ class LegacyDiffNote < Note
!
line
.
meta?
&&
diff_file
.
line_code
(
line
)
==
self
.
line_code
!
line
.
meta?
&&
diff_file
.
line_code
(
line
)
==
self
.
line_code
end
end
def
original_line_code
self
.
line_code
end
# Check if this note is part of an "active" discussion
# Check if this note is part of an "active" discussion
#
#
# This will always return true for anything except MergeRequest noteables,
# This will always return true for anything except MergeRequest noteables,
...
...
app/views/discussions/_diff_with_notes.html.haml
View file @
080924f9
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
.diff-content.code.js-syntax-highlight
.diff-content.code.js-syntax-highlight
%table
%table
-
discussions
=
{
discussion
.
line_code
=>
discussion
}
-
discussions
=
{
discussion
.
original_
line_code
=>
discussion
}
=
render
partial:
"projects/diffs/line"
,
=
render
partial:
"projects/diffs/line"
,
collection:
discussion
.
truncated_diff_lines
,
collection:
discussion
.
truncated_diff_lines
,
as: :line
,
as: :line
,
...
...
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