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
Tatuya Kamada
gitlab-ce
Commits
43d50117
Commit
43d50117
authored
Aug 25, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix diff comments on legacy MRs
parent
1bf2fe27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
CHANGELOG
CHANGELOG
+3
-0
app/models/legacy_diff_note.rb
app/models/legacy_diff_note.rb
+4
-0
spec/features/merge_requests/diff_notes_spec.rb
spec/features/merge_requests/diff_notes_spec.rb
+31
-0
No files found.
CHANGELOG
View file @
43d50117
...
@@ -32,6 +32,9 @@ v 8.12.0 (unreleased)
...
@@ -32,6 +32,9 @@ v 8.12.0 (unreleased)
- Use the default branch for displaying the project icon instead of master !5792 (Hannes Rosenögger)
- Use the default branch for displaying the project icon instead of master !5792 (Hannes Rosenögger)
- Adds response mime type to transaction metric action when it's not HTML
- Adds response mime type to transaction metric action when it's not HTML
v 8.11.4 (unreleased)
- Fix diff commenting on merge requests created prior to 8.10
v 8.11.3 (unreleased)
v 8.11.3 (unreleased)
- Allow system info page to handle case where info is unavailable
- Allow system info page to handle case where info is unavailable
- Label list shows all issues (opened or closed) with that label
- Label list shows all issues (opened or closed) with that label
...
...
app/models/legacy_diff_note.rb
View file @
43d50117
...
@@ -53,6 +53,10 @@ class LegacyDiffNote < Note
...
@@ -53,6 +53,10 @@ class LegacyDiffNote < Note
self
.
line_code
self
.
line_code
end
end
def
to_discussion
Discussion
.
new
([
self
])
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,
...
...
spec/features/merge_requests/diff_notes_spec.rb
View file @
43d50117
...
@@ -147,6 +147,37 @@ feature 'Diff notes', js: true, feature: true do
...
@@ -147,6 +147,37 @@ feature 'Diff notes', js: true, feature: true do
end
end
end
end
context
'when the MR only supports legacy diff notes'
do
before
do
@merge_request
.
merge_request_diff
.
update_attributes
(
start_commit_sha:
nil
)
visit
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
view:
'inline'
)
end
context
'with a new line'
do
it
'should allow commenting'
do
should_allow_commenting
(
find
(
'[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"]'
))
end
end
context
'with an old line'
do
it
'should allow commenting'
do
should_allow_commenting
(
find
(
'[id="6eb14e00385d2fb284765eb1cd8d420d33d63fc9_22_22"]'
))
end
end
context
'with an unchanged line'
do
it
'should allow commenting'
do
should_allow_commenting
(
find
(
'[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7"]'
))
end
end
context
'with a match line'
do
it
'should not allow commenting'
do
should_not_allow_commenting
(
find
(
'.match'
,
match: :first
))
end
end
end
def
should_allow_commenting
(
line_holder
,
diff_side
=
nil
)
def
should_allow_commenting
(
line_holder
,
diff_side
=
nil
)
line
=
get_line_components
(
line_holder
,
diff_side
)
line
=
get_line_components
(
line_holder
,
diff_side
)
line
[
:content
].
hover
line
[
:content
].
hover
...
...
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