diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/assets/javascripts/diffs/components/parallel_diff_view.vue | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/assets/javascripts/diffs/components/parallel_diff_view.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/parallel_diff_view.vue | 89 |
1 files changed, 64 insertions, 25 deletions
diff --git a/app/assets/javascripts/diffs/components/parallel_diff_view.vue b/app/assets/javascripts/diffs/components/parallel_diff_view.vue index 46a691ad22d..67b599fe163 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_view.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_view.vue @@ -1,18 +1,18 @@ <script> import { mapGetters, mapState } from 'vuex'; import draftCommentsMixin from '~/diffs/mixins/draft_comments'; -import ParallelDraftCommentRow from '~/batch_comments/components/parallel_draft_comment_row.vue'; +import DraftNote from '~/batch_comments/components/draft_note.vue'; import parallelDiffTableRow from './parallel_diff_table_row.vue'; -import parallelDiffCommentRow from './parallel_diff_comment_row.vue'; -import parallelDiffExpansionRow from './parallel_diff_expansion_row.vue'; +import DiffCommentCell from './diff_comment_cell.vue'; +import DiffExpansionCell from './diff_expansion_cell.vue'; import { getCommentedLines } from '~/notes/components/multiline_comment_utils'; export default { components: { - parallelDiffExpansionRow, + DiffExpansionCell, parallelDiffTableRow, - parallelDiffCommentRow, - ParallelDraftCommentRow, + DiffCommentCell, + DraftNote, }, mixins: [draftCommentsMixin], props: { @@ -66,14 +66,21 @@ export default { </colgroup> <tbody> <template v-for="(line, index) in diffLines"> - <parallel-diff-expansion-row + <tr + v-if="line.isMatchLineLeft || line.isMatchLineRight" :key="`expand-${index}`" - :file-hash="diffFile.file_hash" - :context-lines-path="diffFile.context_lines_path" - :line="line" - :is-top="index === 0" - :is-bottom="index + 1 === diffLinesLength" - /> + class="line_expansion match" + > + <td colspan="6" class="text-center gl-font-regular"> + <diff-expansion-cell + :file-hash="diffFile.file_hash" + :context-lines-path="diffFile.context_lines_path" + :line="line.left" + :is-top="index === 0" + :is-bottom="index + 1 === diffLinesLength" + /> + </td> + </tr> <parallel-diff-table-row :key="line.line_code" :file-hash="diffFile.file_hash" @@ -82,21 +89,53 @@ export default { :is-bottom="index + 1 === diffLinesLength" :is-commented="index >= commentedLines.startLine && index <= commentedLines.endLine" /> - <parallel-diff-comment-row + <tr + v-if="line.renderCommentRow" :key="`dcr-${line.line_code || index}`" - :line="line" - :diff-file-hash="diffFile.file_hash" - :line-index="index" - :help-page-path="helpPagePath" - :has-draft-left="hasParallelDraftLeft(diffFile.file_hash, line) || false" - :has-draft-right="hasParallelDraftRight(diffFile.file_hash, line) || false" - /> - <parallel-draft-comment-row + :class="line.commentRowClasses" + class="notes_holder" + > + <td class="notes-content parallel old" colspan="3"> + <diff-comment-cell + v-if="line.left" + :line="line.left" + :diff-file-hash="diffFile.file_hash" + :help-page-path="helpPagePath" + :has-draft="line.left.hasDraft" + line-position="left" + /> + </td> + <td class="notes-content parallel new" colspan="3"> + <diff-comment-cell + v-if="line.right" + :line="line.right" + :diff-file-hash="diffFile.file_hash" + :line-index="index" + :help-page-path="helpPagePath" + :has-draft="line.right.hasDraft" + line-position="right" + /> + </td> + </tr> + <tr v-if="shouldRenderParallelDraftRow(diffFile.file_hash, line)" :key="`drafts-${index}`" - :line="line" - :diff-file-content-sha="diffFile.file_hash" - /> + :class="line.draftRowClasses" + class="notes_holder" + > + <td class="notes_line old"></td> + <td class="notes-content parallel old" colspan="2"> + <div v-if="line.left && line.left.lineDraft.isDraft" class="content"> + <draft-note :draft="line.left.lineDraft" :line="line.left" /> + </div> + </td> + <td class="notes_line new"></td> + <td class="notes-content parallel new" colspan="2"> + <div v-if="line.right && line.right.lineDraft.isDraft" class="content"> + <draft-note :draft="line.right.lineDraft" :line="line.right" /> + </div> + </td> + </tr> </template> </tbody> </table> |