summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/diff_line.vue
blob: 448272549d3bdb2cab00ac286fb95456dc4a1148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<script>
import DiffCodeQuality from './diff_code_quality.vue';

export default {
  components: {
    DiffCodeQuality,
  },
  props: {
    line: {
      type: Object,
      required: true,
    },
  },
  computed: {
    parsedCodeQuality() {
      return (this.line.left ?? this.line.right)?.codequality;
    },
    codeQualityLineNumber() {
      return this.parsedCodeQuality[0].line;
    },
  },
  methods: {
    hideCodeQualityFindings() {
      this.$emit('hideCodeQualityFindings', this.codeQualityLineNumber);
    },
  },
};
</script>

<template>
  <diff-code-quality
    :code-quality="parsedCodeQuality"
    @hideCodeQualityFindings="hideCodeQualityFindings"
  />
</template>