diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /app/assets/javascripts/mr_notes/init_notes.js | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/mr_notes/init_notes.js')
-rw-r--r-- | app/assets/javascripts/mr_notes/init_notes.js | 13 |
1 files changed, 11 insertions, 2 deletions
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, }, }), ]); |