Commit 7335f366dc952aa371e1e17cfbe2874d51dd6f16
1 parent
db2c1536
Exists in
master
and in
4 other branches
Fix comment and reply buttons
Showing
4 changed files
with
4 additions
and
1 deletions
Show diff stats
app/assets/javascripts/notes.js
@@ -244,6 +244,7 @@ var NoteList = { | @@ -244,6 +244,7 @@ var NoteList = { | ||
244 | setupDiscussionNoteForm: function(dataHolder, form) { | 244 | setupDiscussionNoteForm: function(dataHolder, form) { |
245 | // setup note target | 245 | // setup note target |
246 | form.attr("rel", dataHolder.data("discussionId")); | 246 | form.attr("rel", dataHolder.data("discussionId")); |
247 | + form.find("#note_commit_id").val(dataHolder.data("commitId")); | ||
247 | form.find("#note_line_code").val(dataHolder.data("lineCode")); | 248 | form.find("#note_line_code").val(dataHolder.data("lineCode")); |
248 | form.find("#note_noteable_type").val(dataHolder.data("noteableType")); | 249 | form.find("#note_noteable_type").val(dataHolder.data("noteableType")); |
249 | form.find("#note_noteable_id").val(dataHolder.data("noteableId")); | 250 | form.find("#note_noteable_id").val(dataHolder.data("noteableId")); |
app/controllers/commit_controller.rb
@@ -23,7 +23,7 @@ class CommitController < ProjectResourceController | @@ -23,7 +23,7 @@ class CommitController < ProjectResourceController | ||
23 | 23 | ||
24 | @comments_allowed = @reply_allowed = true | 24 | @comments_allowed = @reply_allowed = true |
25 | @comments_target = { noteable_type: 'Commit', | 25 | @comments_target = { noteable_type: 'Commit', |
26 | - noteable_id: @commit.id } | 26 | + commit_id: @commit.id } |
27 | 27 | ||
28 | respond_to do |format| | 28 | respond_to do |format| |
29 | format.html do | 29 | format.html do |
app/views/notes/_diff_note_link.html.haml
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | class: "add-diff-note js-add-diff-note-button", | 4 | class: "add-diff-note js-add-diff-note-button", |
5 | data: { noteable_type: note.noteable_type, | 5 | data: { noteable_type: note.noteable_type, |
6 | noteable_id: note.noteable_id, | 6 | noteable_id: note.noteable_id, |
7 | + commit_id: note.commit_id, | ||
7 | line_code: note.line_code, | 8 | line_code: note.line_code, |
8 | discussion_id: note.discussion_id }, | 9 | discussion_id: note.discussion_id }, |
9 | title: "Add a comment to this line" | 10 | title: "Add a comment to this line" |
app/views/notes/_discussion_reply_button.html.haml
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | class: "btn reply-btn js-discussion-reply-button", | 2 | class: "btn reply-btn js-discussion-reply-button", |
3 | data: { noteable_type: note.noteable_type, | 3 | data: { noteable_type: note.noteable_type, |
4 | noteable_id: note.noteable_id, | 4 | noteable_id: note.noteable_id, |
5 | + commit_id: note.commit_id, | ||
5 | line_code: note.line_code, | 6 | line_code: note.line_code, |
6 | discussion_id: note.discussion_id }, | 7 | discussion_id: note.discussion_id }, |
7 | title: "Add a reply" do | 8 | title: "Add a reply" do |