diff options
author | Felipe Artur <fcardozo@gitlab.com> | 2018-06-21 15:22:40 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-06-21 15:22:40 +0300 |
commit | 3e66795ef1ff1228906239763910b051d8afcc37 (patch) | |
tree | df6424d9ec008f5d1da455f8465681b371c4a11e /app/controllers/projects/discussions_controller.rb | |
parent | 14e35ac9b19d358d84e0cfd167f74036937285b6 (diff) |
Changes tab VUE refactoring
Diffstat (limited to 'app/controllers/projects/discussions_controller.rb')
-rw-r--r-- | app/controllers/projects/discussions_controller.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/app/controllers/projects/discussions_controller.rb b/app/controllers/projects/discussions_controller.rb index 8e86af43fee..78b9d53a780 100644 --- a/app/controllers/projects/discussions_controller.rb +++ b/app/controllers/projects/discussions_controller.rb @@ -21,7 +21,7 @@ class Projects::DiscussionsController < Projects::ApplicationController def show render json: { - discussion_html: view_to_html_string('discussions/_diff_with_notes', discussion: discussion, expanded: true) + truncated_diff_lines: discussion.try(:truncated_diff_lines) } end @@ -29,11 +29,6 @@ class Projects::DiscussionsController < Projects::ApplicationController def render_discussion if serialize_notes? - # TODO - It is not needed to serialize notes when resolving - # or unresolving discussions. We should remove this behavior - # passing a parameter to DiscussionEntity to return an empty array - # for notes. - # Check issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/42853 prepare_notes_for_rendering(discussion.notes, merge_request) render_json_with_discussions_serializer else @@ -44,7 +39,7 @@ class Projects::DiscussionsController < Projects::ApplicationController def render_json_with_discussions_serializer render json: DiscussionSerializer.new(project: project, noteable: discussion.noteable, current_user: current_user, note_entity: ProjectNoteEntity) - .represent(discussion, context: self) + .represent(discussion, context: self, render_truncated_diff_lines: true) end # Legacy method used to render discussions notes when not using Vue on views. |