diff options
Diffstat (limited to 'app/assets/javascripts/mr_notes')
-rw-r--r-- | app/assets/javascripts/mr_notes/index.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/mr_notes/init_notes.js | 13 |
2 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/mr_notes/index.js b/app/assets/javascripts/mr_notes/index.js index 297420bf94d..c32a1f4c2ac 100644 --- a/app/assets/javascripts/mr_notes/index.js +++ b/app/assets/javascripts/mr_notes/index.js @@ -6,7 +6,6 @@ import initDiffsApp from '../diffs'; import { resetServiceWorkersPublicPath } from '../lib/utils/webpack'; import MergeRequest from '../merge_request'; import DiscussionCounter from '../notes/components/discussion_counter.vue'; -import initDiscussionFilters from '../notes/discussion_filters'; import initNotesApp from './init_notes'; export default function initMrNotes() { @@ -49,7 +48,5 @@ export default function initMrNotes() { }, }); } - - initDiscussionFilters(store); }); } diff --git a/app/assets/javascripts/mr_notes/init_notes.js b/app/assets/javascripts/mr_notes/init_notes.js index e4a7a7bd9fc..3a67e7925c3 100644 --- a/app/assets/javascripts/mr_notes/init_notes.js +++ b/app/assets/javascripts/mr_notes/init_notes.js @@ -5,19 +5,27 @@ import { parseBoolean } from '~/lib/utils/common_utils'; import store from '~/mr_notes/stores'; import discussionNavigator from '../notes/components/discussion_navigator.vue'; import NotesApp from '../notes/components/notes_app.vue'; +import { getNotesFilterData } from '../notes/utils/get_notes_filter_data'; import initWidget from '../vue_merge_request_widget'; export default () => { + const el = document.getElementById('js-vue-mr-discussions'); + if (!el) { + return; + } + + const notesFilterProps = getNotesFilterData(el); + // eslint-disable-next-line no-new new Vue({ - el: '#js-vue-mr-discussions', + el, name: 'MergeRequestDiscussions', components: { NotesApp, }, store, data() { - const notesDataset = document.getElementById('js-vue-mr-discussions').dataset; + const notesDataset = el.dataset; const noteableData = JSON.parse(notesDataset.noteableData); noteableData.noteableType = notesDataset.noteableType; noteableData.targetType = notesDataset.targetType; @@ -95,6 +103,7 @@ export default () => { userData: this.currentUserData, shouldShow: this.isShowTabActive, helpPagePath: this.helpPagePath, + ...notesFilterProps, }, }), ]); |