summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-03-21 10:29:21 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-03-21 10:29:21 +0000
commit9b45b0be2f247c4526e390abdf79998d789049b9 (patch)
treefcf2decfa3bb10e49d93a9fe35b66673621eff5f
parent27be6340602fc28b55d3ac33c3d689642d3e4ba8 (diff)
parent2b2eb7512123efba239be5245094997155c09301 (diff)
downloadgitlab-ce-9b45b0be2f247c4526e390abdf79998d789049b9.tar.gz
Merge branch '_mr-refactor-part-9' into '_mr-refector-review-target'
MR Diffs Refactor Part 09: Diffs app. See merge request gitlab-org/gitlab-ce!17853
-rw-r--r--app/assets/javascripts/mr_notes/index.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/app/assets/javascripts/mr_notes/index.js b/app/assets/javascripts/mr_notes/index.js
index 096c4ef5f31..c26f07f5a80 100644
--- a/app/assets/javascripts/mr_notes/index.js
+++ b/app/assets/javascripts/mr_notes/index.js
@@ -41,4 +41,32 @@ export default function initMrNotes() {
return createElement('discussion-counter');
},
});
+
+ // eslint-disable-next-line no-new
+ new Vue({
+ el: '#js-diffs-app',
+ name: 'DiffsApp',
+ components: {
+ diffsApp,
+ },
+ store,
+ data() {
+ const { dataset } = document.querySelector(this.$options.el);
+
+ return {
+ endpoint: dataset.endpoint,
+ };
+ },
+ computed: {
+ ...mapGetters(['activeTab']),
+ },
+ render(createElement) {
+ return createElement('diffs-app', {
+ props: {
+ endpoint: this.endpoint,
+ shouldShow: this.activeTab === 'diffs',
+ },
+ });
+ },
+ });
}