summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-06-27 21:20:41 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-06-27 21:20:41 +0000
commitfbf747194f2a655aab3670c30cc6f054c29bbfe7 (patch)
tree57fb1be412df30689face16c86ff8abe0c89c20c /app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
parent5c13af58b89c6b6721ba018e519738b291f7f72b (diff)
downloadgitlab-ce-fbf747194f2a655aab3670c30cc6f054c29bbfe7.tar.gz
Componentize diff lines and diff comments
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_line_gutter_content.vue')
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_gutter_content.vue37
1 files changed, 18 insertions, 19 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
index 8999fd2ac96..a74ea4bfaaf 100644
--- a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
+++ b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
@@ -4,14 +4,7 @@ import { s__ } from '~/locale';
import { mapState, mapGetters, mapActions } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue';
import DiffGutterAvatars from './diff_gutter_avatars.vue';
-import {
- MATCH_LINE_TYPE,
- CONTEXT_LINE_TYPE,
- OLD_NO_NEW_LINE_TYPE,
- NEW_NO_NEW_LINE_TYPE,
- LINE_POSITION_RIGHT,
- UNFOLD_COUNT,
-} from '../constants';
+import { LINE_POSITION_RIGHT, UNFOLD_COUNT } from '../constants';
import * as utils from '../store/utils';
export default {
@@ -63,6 +56,21 @@ export default {
required: false,
default: false,
},
+ isMatchLine: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
+ isMetaLine: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
+ isContextLine: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
computed: {
...mapState({
@@ -70,15 +78,6 @@ export default {
diffFiles: state => state.diffs.diffFiles,
}),
...mapGetters(['isLoggedIn', 'discussionsByLineCode']),
- isMatchLine() {
- return this.lineType === MATCH_LINE_TYPE;
- },
- isContextLine() {
- return this.lineType === CONTEXT_LINE_TYPE;
- },
- isMetaLine() {
- return this.lineType === OLD_NO_NEW_LINE_TYPE || this.lineType === NEW_NO_NEW_LINE_TYPE;
- },
lineHref() {
return this.lineCode ? `#${this.lineCode}` : '#';
},
@@ -109,9 +108,9 @@ export default {
},
},
methods: {
- ...mapActions(['loadMoreLines']),
+ ...mapActions(['loadMoreLines', 'showCommentForm']),
handleCommentButton() {
- this.$emit('showCommentForm', { lineCode: this.lineCode });
+ this.showCommentForm({ lineCode: this.lineCode });
},
handleLoadMoreLines() {
if (this.isRequesting) {