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
795b4a30
Commit
795b4a30
authored
Dec 11, 2018
by
Douwe Maan
Committed by
Winnie Hellmann
Dec 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link to specific commit note from MR commit discussion link
parent
6aed2212
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+1
-1
spec/helpers/notes_helper_spec.rb
spec/helpers/notes_helper_spec.rb
+2
-2
No files found.
app/helpers/notes_helper.rb
View file @
795b4a30
...
...
@@ -85,7 +85,7 @@ module NotesHelper
diffs_project_merge_request_path
(
discussion
.
project
,
discussion
.
noteable
,
path_params
)
elsif
discussion
.
for_commit?
anchor
=
discussion
.
line_code
if
discussion
.
diff_discussion?
anchor
=
discussion
.
diff_discussion?
?
discussion
.
line_code
:
"note_
#{
discussion
.
first_note
.
id
}
"
project_commit_path
(
discussion
.
project
,
discussion
.
noteable
,
anchor:
anchor
)
end
...
...
spec/helpers/notes_helper_spec.rb
View file @
795b4a30
...
...
@@ -185,8 +185,8 @@ describe NotesHelper do
context
'for a non-diff discussion'
do
let
(
:discussion
)
{
create
(
:discussion_note_on_commit
,
project:
project
).
to_discussion
}
it
'returns the commit path'
do
expect
(
helper
.
discussion_path
(
discussion
)).
to
eq
(
project_commit_path
(
project
,
commit
))
it
'returns the commit path
with the note anchor
'
do
expect
(
helper
.
discussion_path
(
discussion
)).
to
eq
(
project_commit_path
(
project
,
commit
,
anchor:
"note_
#{
discussion
.
first_note
.
id
}
"
))
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