summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/diff_view.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_view.vue')
-rw-r--r--app/assets/javascripts/diffs/components/diff_view.vue12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue
index 43cfa22073f..a2a6ebaeedf 100644
--- a/app/assets/javascripts/diffs/components/diff_view.vue
+++ b/app/assets/javascripts/diffs/components/diff_view.vue
@@ -3,6 +3,7 @@ import { mapGetters, mapState, mapActions } from 'vuex';
import DraftNote from '~/batch_comments/components/draft_note.vue';
import draftCommentsMixin from '~/diffs/mixins/draft_comments';
import { getCommentedLines } from '~/notes/components/multiline_comment_utils';
+import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import DiffCommentCell from './diff_comment_cell.vue';
import DiffExpansionCell from './diff_expansion_cell.vue';
import DiffRow from './diff_row.vue';
@@ -14,7 +15,7 @@ export default {
DiffCommentCell,
DraftNote,
},
- mixins: [draftCommentsMixin],
+ mixins: [draftCommentsMixin, glFeatureFlagsMixin()],
props: {
diffFile: {
type: Object,
@@ -43,6 +44,7 @@ export default {
},
computed: {
...mapGetters('diffs', ['commitId']),
+ ...mapState('diffs', ['codequalityDiff']),
...mapState({
selectedCommentPosition: ({ notes }) => notes.selectedCommentPosition,
selectedCommentPositionHover: ({ notes }) => notes.selectedCommentPositionHover,
@@ -56,6 +58,12 @@ export default {
this.diffLines,
);
},
+ hasCodequalityChanges() {
+ return (
+ this.glFeatures.codequalityMrDiffAnnotations &&
+ this.codequalityDiff?.files?.[this.diffFile.file_path]?.length > 0
+ );
+ },
},
methods: {
...mapActions(['setSelectedCommentPosition']),
@@ -98,7 +106,7 @@ export default {
<template>
<div
- :class="[$options.userColorScheme, { inline }]"
+ :class="[$options.userColorScheme, { inline, 'with-codequality': hasCodequalityChanges }]"
:data-commit-id="commitId"
class="diff-grid diff-table code diff-wrap-lines js-syntax-highlight text-file"
>