Merge branch 'hotfix/2021-11-16' into develop
This commit is contained in:
commit
fcd2369621
|
|
@ -92,6 +92,10 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
addNote(id) {
|
addNote(id) {
|
||||||
|
if (!this.parent.hasOwnProperty('__typename')) {
|
||||||
|
this.parent.__typename = 'ContentBlockNode';
|
||||||
|
}
|
||||||
|
|
||||||
this.$store.dispatch('addNote', {
|
this.$store.dispatch('addNote', {
|
||||||
content: id,
|
content: id,
|
||||||
type: this.parent.__typename,
|
type: this.parent.__typename,
|
||||||
|
|
|
||||||
|
|
@ -124,11 +124,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&--language-communication {
|
&--language-communication {
|
||||||
@include filter-block($color-accent-2-dark);
|
@include filter-block($color-accent-1-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
&--society {
|
&--society {
|
||||||
@include filter-block($color-accent-1-dark);
|
@include filter-block($color-accent-2-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
&--interdisciplinary {
|
&--interdisciplinary {
|
||||||
|
|
|
||||||
|
|
@ -56,19 +56,19 @@
|
||||||
$root: &;
|
$root: &;
|
||||||
|
|
||||||
&__language-communication {
|
&__language-communication {
|
||||||
background-color: $color-accent-2-light;
|
|
||||||
|
|
||||||
#{$root}__category {
|
|
||||||
color: $color-accent-2-dark;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__society {
|
|
||||||
background-color: $color-accent-1-light;
|
background-color: $color-accent-1-light;
|
||||||
|
|
||||||
#{$root}__category {
|
#{$root}__category {
|
||||||
color: $color-accent-1-dark;
|
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
|
id
|
||||||
title
|
title
|
||||||
contents
|
contents
|
||||||
type
|
type {
|
||||||
|
id
|
||||||
|
type
|
||||||
|
category
|
||||||
|
}
|
||||||
slug
|
slug
|
||||||
bookmarks {
|
bookmarks {
|
||||||
id
|
id
|
||||||
|
|
@ -13,11 +17,6 @@ query MyActivityQuery {
|
||||||
note {
|
note {
|
||||||
id
|
id
|
||||||
text
|
text
|
||||||
}
|
|
||||||
instrument {
|
|
||||||
id
|
|
||||||
type
|
|
||||||
contents
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,56 +8,7 @@ const compareUuid = uuid => element => element.uuid === uuid;
|
||||||
export const constructContentComponentBookmarkMutation = (uuid, bookmarked, parent, root) => {
|
export const constructContentComponentBookmarkMutation = (uuid, bookmarked, parent, root) => {
|
||||||
let mutation = {};
|
let mutation = {};
|
||||||
|
|
||||||
if (parent.__typename === 'ContentBlockNode') {
|
if (parent.__typename === 'InstrumentNode') {
|
||||||
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 {
|
|
||||||
mutation = {
|
mutation = {
|
||||||
mutation: UPDATE_INSTRUMENT_BOOKMARK,
|
mutation: UPDATE_INSTRUMENT_BOOKMARK,
|
||||||
variables: {
|
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;
|
return mutation;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
from graphene import relay
|
from graphene import relay
|
||||||
from graphene_django.filter import DjangoFilterConnectionField
|
from graphene_django.filter import DjangoFilterConnectionField
|
||||||
|
|
||||||
from assignments.models import StudentSubmission
|
|
||||||
from assignments.schema.types import AssignmentNode, StudentSubmissionNode
|
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
|
from django.conf import settings
|
||||||
import json
|
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
|
user=user
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
instrument = BasicKnowledge.objects.get(slug=content_block_id)
|
instrument = BasicKnowledge.objects.get(slug=content_block_id)
|
||||||
bookmark = InstrumentBookmark.objects.get(
|
bookmark = InstrumentBookmark.objects.get(
|
||||||
instrument=instrument,
|
instrument=instrument,
|
||||||
uuid=content_uuid,
|
uuid=content_uuid,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue