summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/components/notes_app.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/notes/components/notes_app.vue')
-rw-r--r--app/assets/javascripts/notes/components/notes_app.vue60
1 files changed, 30 insertions, 30 deletions
diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue
index c4cae4b3b6f..92db4830704 100644
--- a/app/assets/javascripts/notes/components/notes_app.vue
+++ b/app/assets/javascripts/notes/components/notes_app.vue
@@ -13,7 +13,16 @@
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
export default {
- name: 'notesApp',
+ name: 'NotesApp',
+ components: {
+ noteableNote,
+ noteableDiscussion,
+ systemNote,
+ commentForm,
+ loadingIcon,
+ placeholderNote,
+ placeholderSystemNote,
+ },
props: {
noteableData: {
type: Object,
@@ -26,7 +35,7 @@
userData: {
type: Object,
required: false,
- default: {},
+ default: () => ({}),
},
},
store,
@@ -35,21 +44,30 @@
isLoading: true,
};
},
- components: {
- noteableNote,
- noteableDiscussion,
- systemNote,
- commentForm,
- loadingIcon,
- placeholderNote,
- placeholderSystemNote,
- },
computed: {
...mapGetters([
'notes',
'getNotesDataByProp',
]),
},
+ created() {
+ this.setNotesData(this.notesData);
+ this.setNoteableData(this.noteableData);
+ this.setUserData(this.userData);
+ },
+ mounted() {
+ this.fetchNotes();
+
+ const parentElement = this.$el.parentElement;
+
+ if (parentElement &&
+ parentElement.classList.contains('js-vue-notes-event')) {
+ parentElement.addEventListener('toggleAward', (event) => {
+ const { awardName, noteId } = event.detail;
+ this.actionToggleAward({ awardName, noteId });
+ });
+ }
+ },
methods: {
...mapActions({
actionFetchNotes: 'fetchNotes',
@@ -105,24 +123,6 @@
}
},
},
- created() {
- this.setNotesData(this.notesData);
- this.setNoteableData(this.noteableData);
- this.setUserData(this.userData);
- },
- mounted() {
- this.fetchNotes();
-
- const parentElement = this.$el.parentElement;
-
- if (parentElement &&
- parentElement.classList.contains('js-vue-notes-event')) {
- parentElement.addEventListener('toggleAward', (event) => {
- const { awardName, noteId } = event.detail;
- this.actionToggleAward({ awardName, noteId });
- });
- }
- },
};
</script>
@@ -144,7 +144,7 @@
:is="getComponentName(note)"
:note="getComponentData(note)"
:key="note.id"
- />
+ />
</ul>
<comment-form />