diff options
author | Fatih Acet <acetfatih@gmail.com> | 2018-03-19 15:40:21 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2018-03-19 15:40:21 +0300 |
commit | 80791b808b54fc50a5bcedaae6683abcc76fcf82 (patch) | |
tree | ec91be2a6e027b5a67b23bfccffdf28f468a7062 | |
parent | e1739e47c5664c93c66dd58ded59f9d79cd8a426 (diff) | |
download | gitlab-ce-_mr-refactor-part-9.tar.gz |
MR Diffs Refactor Part 09: Diffs app._mr-refactor-part-9
-rw-r--r-- | app/assets/javascripts/mr_notes/index.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/assets/javascripts/mr_notes/index.js b/app/assets/javascripts/mr_notes/index.js index 096c4ef5f31..8fcbadb6acf 100644 --- a/app/assets/javascripts/mr_notes/index.js +++ b/app/assets/javascripts/mr_notes/index.js @@ -2,6 +2,7 @@ import Vue from 'vue'; import notesApp from '../notes/components/notes_app.vue'; import discussionCounter from '../notes/components/discussion_counter.vue'; import store from '../notes/stores'; + diffs: diffsStoreConfig, export default function initMrNotes() { // eslint-disable-next-line no-new @@ -41,4 +42,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', + }, + }); + }, + }); } |