diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-08 00:09:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-08 00:09:26 +0300 |
commit | 17c8111494f51e79744c782db023804f5e4a7410 (patch) | |
tree | 8aebe53b8aea72f9d4abac1bf9131203302a5b6e /app/assets/javascripts/mr_notes | |
parent | 4b7575da97d88ef4c7b2ec599b0c3fc457b4f561 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/mr_notes')
-rw-r--r-- | app/assets/javascripts/mr_notes/init_notes.js | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/app/assets/javascripts/mr_notes/init_notes.js b/app/assets/javascripts/mr_notes/init_notes.js index ec9c800b7a2..2580f8e86b1 100644 --- a/app/assets/javascripts/mr_notes/init_notes.js +++ b/app/assets/javascripts/mr_notes/init_notes.js @@ -15,6 +15,19 @@ export default () => { notesApp, }, store, + data() { + const notesDataset = document.getElementById('js-vue-mr-discussions').dataset; + const noteableData = JSON.parse(notesDataset.noteableData); + noteableData.noteableType = notesDataset.noteableType; + noteableData.targetType = notesDataset.targetType; + + return { + noteableData, + currentUserData: JSON.parse(notesDataset.currentUserData), + notesData: JSON.parse(notesDataset.notesData), + helpPagePath: notesDataset.helpPagePath, + }; + }, computed: { ...mapGetters(['discussionTabCounter']), ...mapState({ @@ -54,19 +67,6 @@ export default () => { updateDiscussionTabCounter() { this.notesCountBadge.text(this.discussionTabCounter); }, - dataset() { - const data = this.$el.dataset; - const noteableData = JSON.parse(data.noteableData); - noteableData.noteableType = data.noteableType; - noteableData.targetType = data.targetType; - - return { - noteableData, - notesData: JSON.parse(data.notesData), - userData: JSON.parse(data.currentUserData), - helpPagePath: data.helpPagePath, - }; - }, }, render(createElement) { // NOTE: Even though `discussionKeyboardNavigator` is added to the `notes-app`, @@ -76,8 +76,11 @@ export default () => { return createElement(discussionKeyboardNavigator, [ createElement('notes-app', { props: { - ...this.dataset(), + noteableData: this.noteableData, + notesData: this.notesData, + userData: this.currentUserData, shouldShow: this.isShowTabActive, + helpPagePath: this.helpPagePath, }, }), ]); |