diff --git a/client/cypress/integration/frontend/apply-module-visibility.spec.js b/client/cypress/integration/frontend/apply-module-visibility.spec.js index c7492f0b..272fc3bd 100644 --- a/client/cypress/integration/frontend/apply-module-visibility.spec.js +++ b/client/cypress/integration/frontend/apply-module-visibility.spec.js @@ -1,4 +1,4 @@ -// import * as schema from '../fixtures/schema.json'; + import {getModules, getMe} from '../../support/helpers'; import mocks from '../../fixtures/mocks'; diff --git a/client/cypress/integration/frontend/current-module.spec.js b/client/cypress/integration/frontend/current-module.spec.js index d3dab308..c19a65d4 100644 --- a/client/cypress/integration/frontend/current-module.spec.js +++ b/client/cypress/integration/frontend/current-module.spec.js @@ -1,4 +1,3 @@ -// const schema = require('../../fixtures/schema.json'); const assignments = require('../../fixtures/assignments.json'); const mePayload = require('../../fixtures/me.join-class.json'); const topics = require('../../fixtures/topics.json'); diff --git a/client/cypress/integration/frontend/new-project.spec.js b/client/cypress/integration/frontend/new-project.spec.js index 5b994d7c..1b54d9d2 100644 --- a/client/cypress/integration/frontend/new-project.spec.js +++ b/client/cypress/integration/frontend/new-project.spec.js @@ -1,5 +1,3 @@ -// const schema = require('../../fixtures/schema.json'); - const operations = { ProjectsQuery: { projects: { diff --git a/client/src/graphql/gql/fragments/userParts.gql b/client/src/graphql/gql/fragments/userParts.gql index 71d148eb..6d6b949e 100644 --- a/client/src/graphql/gql/fragments/userParts.gql +++ b/client/src/graphql/gql/fragments/userParts.gql @@ -1,6 +1,6 @@ #import "./schoolClassParts.gql" #import "./moduleParts.gql" -fragment UserParts on UserNode { +fragment UserParts on PrivateUserNode { id pk username diff --git a/server/schema.graphql b/server/schema.graphql index e673b4f2..bee2c618 100644 --- a/server/schema.graphql +++ b/server/schema.graphql @@ -135,7 +135,7 @@ type AddRoomPayload { type AnswerNode implements Node { id: ID! - owner: UserNode! + owner: PrivateUserNode! data: JSONString! survey: SurveyNode! pk: Int @@ -178,7 +178,7 @@ type AssignmentNode implements Node { assignment: String! solution: String deleted: Boolean! - owner: UserNode + owner: PrivateUserNode module: ModuleNode! userCreated: Boolean! taskbaseId: String @@ -203,7 +203,7 @@ enum BasicKnowledgeType { } type ChapterBookmarkNode implements Node { - user: UserNode! + user: PrivateUserNode! note: NoteNode id: ID! chapter: ChapterNode! @@ -246,7 +246,7 @@ type ChapterNodeEdge { } type ClassMemberNode { - user: UserNode + user: PublicUserNode active: Boolean firstName: String lastName: String @@ -256,7 +256,7 @@ type ClassMemberNode { type ContentBlockBookmarkNode implements Node { id: ID! - user: UserNode! + user: PrivateUserNode! note: NoteNode uuid: UUID contentBlock: ContentBlockNode! @@ -296,6 +296,7 @@ type ContentBlockNode implements Node & ContentBlockInterface { id: ID! mine: Boolean bookmarks: [ContentBlockBookmarkNode] + originalCreator: PublicUserNode } type ContentBlockNodeConnection { @@ -450,8 +451,8 @@ type CustomQuery { rooms(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, appearance: String): RoomNodeConnection allRoomEntries(offset: Int, before: String, after: String, first: Int, last: Int, slug: String): RoomEntryNodeConnection moduleRoom(slug: String, classId: ID): RoomNode - me: UserNode - allUsers(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): UserNodeConnection + me: PrivateUserNode + allUsers(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): PrivateUserNodeConnection myActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, slug_Icontains: String, slug_In: [String], title: String, title_Icontains: String, title_In: [String]): ModuleNodeConnection myInstrumentActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, type: String): InstrumentNodeConnection _debug: DjangoDebug @@ -564,7 +565,7 @@ enum InputTypes { } type InstrumentBookmarkNode implements Node { - user: UserNode! + user: PrivateUserNode! note: NoteNode id: ID! uuid: UUID @@ -624,7 +625,7 @@ type Logout { } type ModuleBookmarkNode { - user: UserNode! + user: PrivateUserNode! note: NoteNode id: ID! module: ModuleNode! @@ -735,7 +736,7 @@ type ObjectiveNode implements Node { id: ID! text: String! group: ObjectiveGroupNode! - owner: UserNode + owner: PrivateUserNode hiddenFor: [SchoolClassNode] visibleFor: [SchoolClassNode] order: Int @@ -767,6 +768,37 @@ input PasswordUpdateInput { newPassword: String } +type PrivateUserNode implements Node { + firstName: String! + lastName: String! + avatarUrl: String! + username: String! + lastModule: ModuleNode + lastTopic: TopicNode + email: String! + onboardingVisited: Boolean! + team: TeamNode + schoolClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection! + id: ID! + pk: Int + permissions: [String] + selectedClass: SchoolClassNode + expiryDate: String + isTeacher: Boolean + oldClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection + recentModules(offset: Int, before: String, after: String, first: Int, last: Int, recentModules: [ID], orderBy: String): ModuleNodeConnection +} + +type PrivateUserNodeConnection { + pageInfo: PageInfo! + edges: [PrivateUserNodeEdge]! +} + +type PrivateUserNodeEdge { + node: PrivateUserNode + cursor: String! +} + type ProjectEntryNode implements Node { id: ID! activity: String! @@ -794,7 +826,7 @@ type ProjectNode implements Node { slug: String! objectives: String! appearance: String! - student: UserNode! + student: PrivateUserNode! final: Boolean! entries(offset: Int, before: String, after: String, first: Int, last: Int): ProjectEntryNodeConnection! pk: Int @@ -811,13 +843,22 @@ type ProjectNodeEdge { cursor: String! } +type PublicUserNode implements Node { + firstName: String! + lastName: String! + avatarUrl: String! + id: ID! + isMe: Boolean + fullName: String! +} + type RoomEntryNode implements Node { title: String! description: String slug: String! id: ID! room: RoomNode! - author: UserNode + author: PublicUserNode contents: GenericStreamFieldType pk: Int } @@ -865,7 +906,7 @@ type SchoolClassNode implements Node { name: String! isDeleted: Boolean! code: String - users(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): UserNodeConnection! + users(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): PrivateUserNodeConnection! moduleSet(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, slug_Icontains: String, slug_In: [String], title: String, title_Icontains: String, title_In: [String]): ModuleNodeConnection! hiddenChapterTitles(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, title: String): ChapterNodeConnection! hiddenChapterDescriptions(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, title: String): ChapterNodeConnection! @@ -994,7 +1035,7 @@ type StudentSubmissionNode implements Node { text: String! document: String! assignment: AssignmentNode! - student: UserNode! + student: PrivateUserNode! final: Boolean! submissionFeedback: SubmissionFeedbackNode } @@ -1020,7 +1061,7 @@ type SubmissionFeedbackNode implements Node { created: DateTime! modified: DateTime! text: String! - teacher: UserNode! + teacher: PrivateUserNode! studentSubmission: StudentSubmissionNode! final: Boolean! id: ID! @@ -1063,8 +1104,8 @@ type TeamNode implements Node { isDeleted: Boolean! code: String id: ID! - creator: UserNode - members: [UserNode] + creator: PrivateUserNode + members: [PublicUserNode] pk: Int } @@ -1421,35 +1462,3 @@ input UserGroupBlockVisibility { schoolClassId: ID! hidden: Boolean! } - -type UserNode implements Node { - username: String! - firstName: String! - lastName: String! - lastModule: ModuleNode - lastTopic: TopicNode - avatarUrl: String! - email: String! - onboardingVisited: Boolean! - team: TeamNode - schoolClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection! - id: ID! - pk: Int - permissions: [String] - selectedClass: SchoolClassNode - expiryDate: String - isTeacher: Boolean - oldClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection - recentModules(offset: Int, before: String, after: String, first: Int, last: Int, recentModules: [ID], orderBy: String): ModuleNodeConnection - isMe: Boolean -} - -type UserNodeConnection { - pageInfo: PageInfo! - edges: [UserNodeEdge]! -} - -type UserNodeEdge { - node: UserNode - cursor: String! -}