From 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 20 Aug 2020 18:42:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-3-stable-ee --- app/assets/javascripts/mr_notes/init_notes.js | 8 +++++--- app/assets/javascripts/mr_notes/stores/getters.js | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'app/assets/javascripts/mr_notes') diff --git a/app/assets/javascripts/mr_notes/init_notes.js b/app/assets/javascripts/mr_notes/init_notes.js index fcde9bf7849..2be7cc951fc 100644 --- a/app/assets/javascripts/mr_notes/init_notes.js +++ b/app/assets/javascripts/mr_notes/init_notes.js @@ -3,8 +3,9 @@ import Vue from 'vue'; import { mapActions, mapState, mapGetters } from 'vuex'; import store from '~/mr_notes/stores'; import notesApp from '../notes/components/notes_app.vue'; -import discussionKeyboardNavigator from '../notes/components/discussion_keyboard_navigator.vue'; +import discussionNavigator from '../notes/components/discussion_navigator.vue'; import initWidget from '../vue_merge_request_widget'; +import { parseBoolean } from '~/lib/utils/common_utils'; export default () => { // eslint-disable-next-line no-new @@ -20,6 +21,7 @@ export default () => { const noteableData = JSON.parse(notesDataset.noteableData); noteableData.noteableType = notesDataset.noteableType; noteableData.targetType = notesDataset.targetType; + noteableData.discussion_locked = parseBoolean(notesDataset.isLocked); return { noteableData, @@ -69,11 +71,11 @@ export default () => { }, }, render(createElement) { - // NOTE: Even though `discussionKeyboardNavigator` is added to the `notes-app`, + // NOTE: Even though `discussionNavigator` is added to the `notes-app`, // it adds a global key listener so it works on the diffs tab as well. // If we create a single Vue app for all of the MR tabs, we should move this // up the tree, to the root. - return createElement(discussionKeyboardNavigator, [ + return createElement(discussionNavigator, [ createElement('notes-app', { props: { noteableData: this.noteableData, diff --git a/app/assets/javascripts/mr_notes/stores/getters.js b/app/assets/javascripts/mr_notes/stores/getters.js index e48cfcd9564..245443d7ecf 100644 --- a/app/assets/javascripts/mr_notes/stores/getters.js +++ b/app/assets/javascripts/mr_notes/stores/getters.js @@ -1,3 +1,8 @@ +// Note: this getter is important because +// `noteableData` is namespaced under `notes` for `~/mr_notes/stores` +// while `noteableData` is directly available as `state.noteableData` for `~/notes/stores` +export const getNoteableData = state => state.notes.noteableData; + export default { isLoggedIn(state, getters) { return Boolean(getters.getUserData.id); -- cgit v1.2.1