2018-06-21 08:22:40 -04:00
|
|
|
<script>
|
2018-11-09 04:44:07 -05:00
|
|
|
import { mapGetters } from 'vuex';
|
2018-07-03 19:18:27 -04:00
|
|
|
import parallelDiffTableRow from './parallel_diff_table_row.vue';
|
2018-06-27 17:20:41 -04:00
|
|
|
import parallelDiffCommentRow from './parallel_diff_comment_row.vue';
|
2018-06-21 08:22:40 -04:00
|
|
|
|
|
|
|
export default {
|
2018-06-27 17:20:41 -04:00
|
|
|
components: {
|
2018-07-03 19:18:27 -04:00
|
|
|
parallelDiffTableRow,
|
2018-06-27 17:20:41 -04:00
|
|
|
parallelDiffCommentRow,
|
|
|
|
},
|
2018-07-03 19:18:27 -04:00
|
|
|
props: {
|
|
|
|
diffFile: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
diffLines: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2018-06-21 08:22:40 -04:00
|
|
|
computed: {
|
2018-11-09 04:44:07 -05:00
|
|
|
...mapGetters('diffs', ['commitId']),
|
2018-07-03 19:18:27 -04:00
|
|
|
diffLinesLength() {
|
2018-08-06 17:13:34 -04:00
|
|
|
return this.diffLines.length;
|
2018-07-03 19:18:27 -04:00
|
|
|
},
|
2018-06-21 08:22:40 -04:00
|
|
|
},
|
2018-11-09 04:44:07 -05:00
|
|
|
userColorScheme: window.gon.user_color_scheme,
|
2018-06-21 08:22:40 -04:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div
|
2018-11-09 04:44:07 -05:00
|
|
|
:class="$options.userColorScheme"
|
2018-06-21 08:22:40 -04:00
|
|
|
:data-commit-id="commitId"
|
2018-06-27 17:20:41 -04:00
|
|
|
class="code diff-wrap-lines js-syntax-highlight text-file"
|
|
|
|
>
|
2018-06-21 08:22:40 -04:00
|
|
|
<table>
|
|
|
|
<tbody>
|
2018-11-16 15:07:38 -05:00
|
|
|
<template v-for="(line, index) in diffLines">
|
2018-07-03 19:18:27 -04:00
|
|
|
<parallel-diff-table-row
|
2018-09-20 02:13:50 -04:00
|
|
|
:key="index"
|
2018-11-09 14:48:41 -05:00
|
|
|
:file-hash="diffFile.file_hash"
|
|
|
|
:context-lines-path="diffFile.context_lines_path"
|
2018-06-27 17:20:41 -04:00
|
|
|
:line="line"
|
|
|
|
:is-bottom="index + 1 === diffLinesLength"
|
|
|
|
/>
|
2018-08-13 04:47:54 -04:00
|
|
|
<parallel-diff-comment-row
|
2018-07-17 11:47:02 -04:00
|
|
|
:key="`dcr-${index}`"
|
2018-06-27 17:20:41 -04:00
|
|
|
:line="line"
|
2018-11-09 14:48:41 -05:00
|
|
|
:diff-file-hash="diffFile.file_hash"
|
2018-06-27 17:20:41 -04:00
|
|
|
:line-index="index"
|
2018-08-13 04:47:54 -04:00
|
|
|
/>
|
2018-06-21 08:22:40 -04:00
|
|
|
</template>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</template>
|