summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/inline_diff_expansion_row.vue
blob: 071a988d78919453128e8ed01590beabe446c32d (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
46
47
48
49
50
51
<script>
import DiffExpansionCell from './diff_expansion_cell.vue';
import { MATCH_LINE_TYPE } from '../constants';

export default {
  components: {
    DiffExpansionCell,
  },
  props: {
    fileHash: {
      type: String,
      required: true,
    },
    contextLinesPath: {
      type: String,
      required: true,
    },
    line: {
      type: Object,
      required: true,
    },
    isTop: {
      type: Boolean,
      required: false,
      default: false,
    },
    isBottom: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  computed: {
    isMatchLine() {
      return this.line.type === MATCH_LINE_TYPE;
    },
  },
};
</script>

<template>
  <tr v-if="isMatchLine" class="line_expansion match">
    <diff-expansion-cell
      :file-hash="fileHash"
      :context-lines-path="contextLinesPath"
      :line="line"
      :is-top="isTop"
      :is-bottom="isBottom"
    />
  </tr>
</template>