From ef15a655b8d60eeefb8285ad1c066563ad045720 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 18 May 2021 17:32:38 +0200 Subject: [PATCH] Add objectives to snapshot preview --- client/src/components/modules/Module.vue | 10 ++-- .../objective-groups/ObjectiveGroup.vue | 4 +- .../graphql/gql/queries/snapshots/detail.gql | 11 ++++- server/books/models/snapshot.py | 3 +- server/books/schema/nodes/snapshot.py | 17 +++++-- server/books/tests/test_snapshots.py | 48 +++++++++++++++---- server/schema.graphql | 27 +++++++++++ 7 files changed, 96 insertions(+), 24 deletions(-) diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index a5380ef4..38d690cb 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -53,8 +53,8 @@ props: { module: { type: Object, - default: () => ({}) - } + default: () => ({}), + }, }, components: { BookmarkActions, @@ -65,15 +65,15 @@ computed: { languageCommunicationObjectiveGroups() { return this.module.objectiveGroups ? this.module.objectiveGroups - .filter(group => group.title === 'LANGUAGE_COMMUNICATION') : []; + .filter(group => group.title.toLowerCase() === 'language_communication') : []; }, societyObjectiveGroups() { return this.module.objectiveGroups ? this.module.objectiveGroups - .filter(group => group.title === 'SOCIETY') : []; + .filter(group => group.title.toLowerCase() === 'society') : []; }, interdisciplinaryObjectiveGroups() { return this.module.objectiveGroups ? this.module.objectiveGroups - .filter(group => group.title === 'INTERDISCIPLINARY') : []; + .filter(group => group.title.toLowerCase() === 'interdisciplinary') : []; }, isStudent() { return !this.me.permissions.includes('users.can_manage_school_class_content'); diff --git a/client/src/components/objective-groups/ObjectiveGroup.vue b/client/src/components/objective-groups/ObjectiveGroup.vue index 070fdcaf..d8c9aa92 100644 --- a/client/src/components/objective-groups/ObjectiveGroup.vue +++ b/client/src/components/objective-groups/ObjectiveGroup.vue @@ -62,7 +62,7 @@ return hidden({ block: this.group, schoolClass: this.schoolClass, - type: this.type + type: this.type, }); }, }, @@ -70,7 +70,7 @@