Merge branch 'hotfix/2021-11-16' into develop
This commit is contained in:
commit
fcd2369621
|
|
@ -92,6 +92,10 @@ export default {
|
|||
|
||||
methods: {
|
||||
addNote(id) {
|
||||
if (!this.parent.hasOwnProperty('__typename')) {
|
||||
this.parent.__typename = 'ContentBlockNode';
|
||||
}
|
||||
|
||||
this.$store.dispatch('addNote', {
|
||||
content: id,
|
||||
type: this.parent.__typename,
|
||||
|
|
|
|||
|
|
@ -124,11 +124,11 @@
|
|||
}
|
||||
|
||||
&--language-communication {
|
||||
@include filter-block($color-accent-2-dark);
|
||||
@include filter-block($color-accent-1-dark);
|
||||
}
|
||||
|
||||
&--society {
|
||||
@include filter-block($color-accent-1-dark);
|
||||
@include filter-block($color-accent-2-dark);
|
||||
}
|
||||
|
||||
&--interdisciplinary {
|
||||
|
|
|
|||
|
|
@ -56,19 +56,19 @@
|
|||
$root: &;
|
||||
|
||||
&__language-communication {
|
||||
background-color: $color-accent-2-light;
|
||||
|
||||
#{$root}__category {
|
||||
color: $color-accent-2-dark;
|
||||
}
|
||||
}
|
||||
|
||||
&__society {
|
||||
background-color: $color-accent-1-light;
|
||||
|
||||
#{$root}__category {
|
||||
color: $color-accent-1-dark;
|
||||
}
|
||||
}
|
||||
|
||||
&__society {
|
||||
background-color: $color-accent-2-light;
|
||||
|
||||
#{$root}__category {
|
||||
color: $color-accent-2-dark;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,11 @@ query MyActivityQuery {
|
|||
id
|
||||
title
|
||||
contents
|
||||
type
|
||||
type {
|
||||
id
|
||||
type
|
||||
category
|
||||
}
|
||||
slug
|
||||
bookmarks {
|
||||
id
|
||||
|
|
@ -13,11 +17,6 @@ query MyActivityQuery {
|
|||
note {
|
||||
id
|
||||
text
|
||||
}
|
||||
instrument {
|
||||
id
|
||||
type
|
||||
contents
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,56 +8,7 @@ const compareUuid = uuid => element => element.uuid === uuid;
|
|||
export const constructContentComponentBookmarkMutation = (uuid, bookmarked, parent, root) => {
|
||||
let mutation = {};
|
||||
|
||||
if (parent.__typename === 'ContentBlockNode') {
|
||||
mutation = {
|
||||
mutation: UPDATE_CONTENT_BOOKMARK,
|
||||
variables: {
|
||||
input: {
|
||||
uuid,
|
||||
contentBlock: root,
|
||||
bookmarked
|
||||
}
|
||||
},
|
||||
update: (store, response) => {
|
||||
const query = CONTENT_BLOCK_QUERY;
|
||||
const variables = {id: root};
|
||||
const data = store.readQuery({
|
||||
query,
|
||||
variables
|
||||
});
|
||||
|
||||
const bookmarks = data.contentBlock.bookmarks;
|
||||
|
||||
if (bookmarked) {
|
||||
bookmarks.push({
|
||||
note: null,
|
||||
uuid,
|
||||
__typename: 'ContentBlockBookmarkNode'
|
||||
});
|
||||
} else {
|
||||
let index = bookmarks.findIndex(compareUuid(uuid));
|
||||
if (index > -1) {
|
||||
bookmarks.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
data.contentBlock.bookmarks = bookmarks;
|
||||
|
||||
store.writeQuery({
|
||||
data,
|
||||
query,
|
||||
variables
|
||||
});
|
||||
},
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
updateContentBookmark: {
|
||||
__typename: 'UpdateContentBookmarkPayload',
|
||||
success: true
|
||||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
if (parent.__typename === 'InstrumentNode') {
|
||||
mutation = {
|
||||
mutation: UPDATE_INSTRUMENT_BOOKMARK,
|
||||
variables: {
|
||||
|
|
@ -106,6 +57,55 @@ export const constructContentComponentBookmarkMutation = (uuid, bookmarked, pare
|
|||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
mutation = {
|
||||
mutation: UPDATE_CONTENT_BOOKMARK,
|
||||
variables: {
|
||||
input: {
|
||||
uuid,
|
||||
contentBlock: root,
|
||||
bookmarked
|
||||
}
|
||||
},
|
||||
update: (store, response) => {
|
||||
const query = CONTENT_BLOCK_QUERY;
|
||||
const variables = {id: root};
|
||||
const data = store.readQuery({
|
||||
query,
|
||||
variables
|
||||
});
|
||||
|
||||
const bookmarks = data.contentBlock.bookmarks;
|
||||
|
||||
if (bookmarked) {
|
||||
bookmarks.push({
|
||||
note: null,
|
||||
uuid,
|
||||
__typename: 'ContentBlockBookmarkNode'
|
||||
});
|
||||
} else {
|
||||
let index = bookmarks.findIndex(compareUuid(uuid));
|
||||
if (index > -1) {
|
||||
bookmarks.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
data.contentBlock.bookmarks = bookmarks;
|
||||
|
||||
store.writeQuery({
|
||||
data,
|
||||
query,
|
||||
variables
|
||||
});
|
||||
},
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
updateContentBookmark: {
|
||||
__typename: 'UpdateContentBookmarkPayload',
|
||||
success: true
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return mutation;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from graphene import relay
|
||||
from graphene_django.filter import DjangoFilterConnectionField
|
||||
|
||||
from assignments.models import StudentSubmission
|
||||
from assignments.schema.types import AssignmentNode, StudentSubmissionNode
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# ITerativ GmbH
|
||||
# http://www.iterativ.ch/
|
||||
#
|
||||
# Copyright (c) 2019 ITerativ GmbH. All rights reserved.
|
||||
#
|
||||
# Created on 2019-04-11
|
||||
# @author: chrigu <christian.cueni@iterativ.ch>
|
||||
from django.conf import settings
|
||||
import json
|
||||
|
||||
|
|
@ -119,6 +110,29 @@ class MyAssignemntsText(DefaultUserTestCase):
|
|||
}
|
||||
}
|
||||
}
|
||||
myInstrumentActivity {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
contents
|
||||
type {
|
||||
id
|
||||
type
|
||||
category
|
||||
}
|
||||
slug
|
||||
bookmarks {
|
||||
id
|
||||
uuid
|
||||
note {
|
||||
id
|
||||
text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
'''
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class AddNote(relay.ClientIDMutation):
|
|||
user=user
|
||||
)
|
||||
else:
|
||||
instrument = BasicKnowledge.objects.get(slug=content_block_id)
|
||||
instrument = BasicKnowledge.objects.get(slug=content_block_id)
|
||||
bookmark = InstrumentBookmark.objects.get(
|
||||
instrument=instrument,
|
||||
uuid=content_uuid,
|
||||
|
|
|
|||
Loading…
Reference in New Issue