From f4270b8243dc1aac4c0241f32b0c76147bc40e43 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 5 Mar 2020 16:41:07 +0100 Subject: [PATCH] Remove actions in class list for students --- client/cypress/fixtures/schema.json | 12 +++++++ .../fixtures/selected-school-class.json | 1 + client/cypress/integration/join-class.spec.js | 2 +- client/src/components/profile/ClassList.vue | 36 +++++++++++++++---- client/src/graphql/gql/mySchoolClass.gql | 1 + client/src/pages/myClass.vue | 21 ++++++----- server/users/schema.py | 3 ++ 7 files changed, 60 insertions(+), 16 deletions(-) diff --git a/client/cypress/fixtures/schema.json b/client/cypress/fixtures/schema.json index e5af620f..df2ae845 100644 --- a/client/cypress/fixtures/schema.json +++ b/client/cypress/fixtures/schema.json @@ -3069,6 +3069,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "isTeacher", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, diff --git a/client/cypress/fixtures/selected-school-class.json b/client/cypress/fixtures/selected-school-class.json index d9377a6d..b905ec95 100644 --- a/client/cypress/fixtures/selected-school-class.json +++ b/client/cypress/fixtures/selected-school-class.json @@ -1,6 +1,7 @@ { "me": { "id": "VXNlck5vZGU6Mg==", + "isTeacher": true, "selectedClass": { "id": "U2Nob29sQ2xhc3NOb2RlOjE=", "name": "Moordale", diff --git a/client/cypress/integration/join-class.spec.js b/client/cypress/integration/join-class.spec.js index fb29736d..9e1f8cdf 100644 --- a/client/cypress/integration/join-class.spec.js +++ b/client/cypress/integration/join-class.spec.js @@ -53,7 +53,7 @@ describe('Class Management', () => { cy.get('[data-cy=class-selection-entry]').should('have.length', 2); }); - it('should leave and re-join class', () => { + it.only('should leave and re-join class', () => { const teacher = { ...me, permissions: ['users.can_manage_school_class_content'] diff --git a/client/src/components/profile/ClassList.vue b/client/src/components/profile/ClassList.vue index cbe94307..d0b55c6f 100644 --- a/client/src/components/profile/ClassList.vue +++ b/client/src/components/profile/ClassList.vue @@ -2,7 +2,7 @@

{{name}}

-
@@ -31,7 +39,7 @@