diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-24 14:57:59 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-24 14:57:59 +0300 |
commit | 30912c75b8e8eef7cd5d042f1266ec350aac6da5 (patch) | |
tree | 801db58c253c4968fd70126907886cef79af9295 /app/controllers/projects/notes_controller.rb | |
parent | 8c67c339dc631a6458d87deed7ce011562bb5e2a (diff) | |
download | gitlab-ce-30912c75b8e8eef7cd5d042f1266ec350aac6da5.tar.gz |
Improve merge request comments
When add diff note on 'Changes' page - and then go to 'Discussions' tab
you will not see this discussion unless you reload a page. This commit
fixes it by rendering discussion on 'Discussion' page as soon as you
submit comment on 'Changes' page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/projects/notes_controller.rb')
-rw-r--r-- | app/controllers/projects/notes_controller.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index 5df92b29eda..fca4c2f652d 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -85,12 +85,22 @@ class Projects::NotesController < Projects::ApplicationController ) end + def note_to_discussion_with_diff_html(note) + render_to_string( + "projects/notes/_discussion", + layout: false, + formats: [:html], + locals: { discussion_notes: [note] } + ) + end + def render_note_json(note) render json: { id: note.id, discussion_id: note.discussion_id, html: note_to_html(note), - discussion_html: note_to_discussion_html(note) + discussion_html: note_to_discussion_html(note), + discussion_with_diff_html: note_to_discussion_with_diff_html(note) } end |