Welcome to mirror list, hosted at ThFree Co, Russian Federation.

diff_line.vue « components « diffs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 40e53438bc8ced501b2727d0cf27fcc75f96f57e (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
36
37
38
39
40
41
42
43
44
45
<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;
    },
    parsedSast() {
      return (this.line.left ?? this.line.right)?.sast;
    },
    codeQualityLineNumber() {
      return this.parsedCodeQuality[0]?.line;
    },
    sastLineNumber() {
      return this.parsedSast[0]?.line;
    },
  },
  methods: {
    hideCodeQualityFindings() {
      this.$emit(
        'hideCodeQualityFindings',
        this.codeQualityLineNumber ? this.codeQualityLineNumber : this.sastLineNumber,
      );
    },
  },
};
</script>

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