Commit a1f64642 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'revert-cdd5e8a8' into 'master'

Revert "Merge branch 'ss-simon/rm-data-from-mount' into 'master'"

Closes #217006

See merge request gitlab-org/gitlab!31400
parents 08516c10 7bf5481f
......@@ -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,
},
}),
]);
......
......@@ -14,36 +14,38 @@ document.addEventListener('DOMContentLoaded', () => {
notesApp,
},
store,
methods: {
setData() {
const notesDataset = this.$el.dataset;
const parsedUserData = JSON.parse(notesDataset.currentUserData);
const noteableData = JSON.parse(notesDataset.noteableData);
let currentUserData = {};
data() {
const notesDataset = document.getElementById('js-vue-notes').dataset;
const parsedUserData = JSON.parse(notesDataset.currentUserData);
const noteableData = JSON.parse(notesDataset.noteableData);
let currentUserData = {};
noteableData.noteableType = notesDataset.noteableType;
noteableData.targetType = notesDataset.targetType;
noteableData.noteableType = notesDataset.noteableType;
noteableData.targetType = notesDataset.targetType;
if (parsedUserData) {
currentUserData = {
id: parsedUserData.id,
name: parsedUserData.name,
username: parsedUserData.username,
avatar_url: parsedUserData.avatar_path || parsedUserData.avatar_url,
path: parsedUserData.path,
};
}
return {
noteableData,
userData: currentUserData,
notesData: JSON.parse(notesDataset.notesData),
if (parsedUserData) {
currentUserData = {
id: parsedUserData.id,
name: parsedUserData.name,
username: parsedUserData.username,
avatar_url: parsedUserData.avatar_path || parsedUserData.avatar_url,
path: parsedUserData.path,
};
},
}
return {
noteableData,
currentUserData,
notesData: JSON.parse(notesDataset.notesData),
};
},
render(createElement) {
return createElement('notes-app', {
props: { ...this.setData() },
props: {
noteableData: this.noteableData,
notesData: this.notesData,
userData: this.currentUserData,
},
});
},
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment