From 3f66ce5a0f7b62124eda7268baeed298092d2de4 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 5 Dec 2019 14:39:50 +0100 Subject: [PATCH] Add notes to chapters and modules --- client/src/components/Chapter.vue | 14 ++- client/src/components/modules/Module.vue | 14 ++- client/src/components/notes/NewNoteWizard.vue | 80 +++++------------ client/src/helpers/new-note-mutation.js | 85 +++++++++++++++++++ client/src/store/index.js | 14 ++- server/notes/inputs.py | 5 +- server/notes/mutations.py | 39 ++++++--- 7 files changed, 176 insertions(+), 75 deletions(-) create mode 100644 client/src/helpers/new-note-mutation.js diff --git a/client/src/components/Chapter.vue b/client/src/components/Chapter.vue index 925b2d4e..14366295 100644 --- a/client/src/components/Chapter.vue +++ b/client/src/components/Chapter.vue @@ -4,8 +4,11 @@

{{chapter.description}} @@ -109,7 +112,16 @@ } } }); - } + }, + addNote(id) { + this.$store.dispatch('addNote', { + content: id, + parent: this.chapter.id + }); + }, + editNote() { + this.$store.dispatch('editNote', this.chapter.bookmark.note); + }, }, apollo: { diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 69513816..6e9b5534 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -9,7 +9,10 @@

@@ -168,7 +171,16 @@ } } }); - } + }, + addNote(id) { + this.$store.dispatch('addNote', { + content: id, + parent: this.module.id + }); + }, + editNote() { + this.$store.dispatch('editNote', this.module.bookmark.note); + }, }, apollo: { diff --git a/client/src/components/notes/NewNoteWizard.vue b/client/src/components/notes/NewNoteWizard.vue index eca6123b..70f6be8c 100644 --- a/client/src/components/notes/NewNoteWizard.vue +++ b/client/src/components/notes/NewNoteWizard.vue @@ -5,10 +5,8 @@