Commit 7335f366dc952aa371e1e17cfbe2874d51dd6f16

Authored by Riyad Preukschas
1 parent db2c1536

Fix comment and reply buttons

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