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/inline_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/inline_diff_view.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/inline_diff_view.vue | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/app/assets/javascripts/diffs/components/inline_diff_view.vue b/app/assets/javascripts/diffs/components/inline_diff_view.vue index 13805910648..05f5461054f 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_view.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_view.vue @@ -2,18 +2,18 @@ import { mapGetters, mapState } from 'vuex'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import draftCommentsMixin from '~/diffs/mixins/draft_comments'; -import InlineDraftCommentRow from '~/batch_comments/components/inline_draft_comment_row.vue'; +import DraftNote from '~/batch_comments/components/draft_note.vue'; import inlineDiffTableRow from './inline_diff_table_row.vue'; -import inlineDiffCommentRow from './inline_diff_comment_row.vue'; -import inlineDiffExpansionRow from './inline_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: { - inlineDiffCommentRow, + DiffCommentCell, inlineDiffTableRow, - InlineDraftCommentRow, - inlineDiffExpansionRow, + DraftNote, + DiffExpansionCell, }, mixins: [draftCommentsMixin, glFeatureFlagsMixin()], props: { @@ -65,15 +65,19 @@ export default { </colgroup> <tbody> <template v-for="(line, index) in diffLines"> - <inline-diff-expansion-row - :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" - /> + <tr v-if="line.isMatchLine" :key="`expand-${index}`" class="line_expansion match"> + <td colspan="4" class="text-center gl-font-regular"> + <diff-expansion-cell + :file-hash="diffFile.file_hash" + :context-lines-path="diffFile.context_lines_path" + :line="line" + :is-top="index === 0" + :is-bottom="index + 1 === diffLinesLength" + /> + </td> + </tr> <inline-diff-table-row + v-if="!line.isMatchLine" :key="`${line.line_code || index}`" :file-hash="diffFile.file_hash" :file-path="diffFile.file_path" @@ -81,20 +85,32 @@ export default { :is-bottom="index + 1 === diffLinesLength" :is-commented="index >= commentedLines.startLine && index <= commentedLines.endLine" /> - <inline-diff-comment-row + <tr + v-if="line.renderCommentRow" :key="`icr-${line.line_code || index}`" - :diff-file-hash="diffFile.file_hash" - :line="line" - :help-page-path="helpPagePath" - :has-draft="shouldRenderDraftRow(diffFile.file_hash, line) || false" - /> - <inline-draft-comment-row - v-if="shouldRenderDraftRow(diffFile.file_hash, line)" - :key="`draft_${index}`" - :draft="draftForLine(diffFile.file_hash, line)" - :diff-file="diffFile" - :line="line" - /> + :class="line.commentRowClasses" + class="notes_holder" + > + <td class="notes-content" colspan="4"> + <diff-comment-cell + :diff-file-hash="diffFile.file_hash" + :line="line" + :help-page-path="helpPagePath" + :has-draft="line.hasDraft" + /> + </td> + </tr> + <tr v-if="line.hasDraft" :key="`draft_${index}`" class="notes_holder js-temp-notes-holder"> + <td class="notes-content" colspan="4"> + <div class="content"> + <draft-note + :draft="draftForLine(diffFile.file_hash, line)" + :diff-file="diffFile" + :line="line" + /> + </div> + </td> + </tr> </template> </tbody> </table> |