gitlab-org--gitlab-foss/app/views/projects/notes/_discussion.html.haml
Dominik Sander d4fec49abc Fix merge request comments on files with multiple commits
Having a merge request with a comments on a line which is then changed
in a later commit prevented new comments from properly showing up in the
merge request show page.

 * `Note#set_diff` do not use stored the diff when creating a new note
   in merge requests (we can not be sure the diff did not changed since
   the last comment on that line)
 * Do not rely just on `outdated?` of the first note when displaying
   comments of a MR in the discussion tab, but partition the
   active/outdated notes and display them all
 * In the inline changes tab just select the active notes, so an
   outdated note does not prevent an active one from being rendered
 * Just show active comments in the side-by-side changes tab
2015-04-15 18:23:57 +02:00

13 lines
675 B
Text

- note = discussion_notes.first
.timeline-entry
.timeline-entry-inner
.timeline-icon
= link_to user_path(note.author) do
= image_tag avatar_icon(note.author_email), class: "avatar s40"
.timeline-content
- if note.for_merge_request?
- (active_notes, outdated_notes) = discussion_notes.partition(&:active?)
= render "projects/notes/discussions/active", discussion_notes: active_notes if active_notes.length > 0
= render "projects/notes/discussions/outdated", discussion_notes: outdated_notes if outdated_notes.length > 0
- else
= render "projects/notes/discussions/commit", discussion_notes: discussion_notes