From 6dd737a84f56f0aa978d591ffa90a4b6aec4161b Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Wed, 25 Aug 2021 20:56:48 +0200 Subject: [PATCH] Add new modal for changing visibility --- .../frontend/rooms/room-page.spec.js | 31 ++++- .../frontend/rooms/rooms-page.spec.js | 2 +- client/src/App.vue | 2 + .../components/modules/SnapshotCreated.vue | 4 +- .../src/components/rooms/ChangeVisibility.vue | 64 +++++++++ client/src/components/rooms/RoomActions.vue | 14 +- client/src/styles/_mixins.scss | 126 +---------------- client/src/styles/mixins/_typography.scss | 129 ++++++++++++++++++ 8 files changed, 238 insertions(+), 134 deletions(-) create mode 100644 client/src/components/rooms/ChangeVisibility.vue create mode 100644 client/src/styles/mixins/_typography.scss diff --git a/client/cypress/integration/frontend/rooms/room-page.spec.js b/client/cypress/integration/frontend/rooms/room-page.spec.js index 35920468..b296d6bb 100644 --- a/client/cypress/integration/frontend/rooms/room-page.spec.js +++ b/client/cypress/integration/frontend/rooms/room-page.spec.js @@ -5,16 +5,18 @@ describe('The Room Page', () => { const entryTitle = 'some title'; const slug = 'ein-historisches-festival'; - const operations = { - MeQuery: getMinimalMe({}), - RoomEntriesQuery: { + const RoomEntriesQuery = { room: { slug, roomEntries: { edges: [], }, }, - }, + }; + + const operations = { + MeQuery: getMinimalMe({}), + RoomEntriesQuery, AddRoomEntry: { addRoomEntry: { roomEntry: { @@ -58,4 +60,25 @@ describe('The Room Page', () => { cy.get('.room-entry__content:first').should('contain', entryText).should('contain', 'Rachel Green'); }); + + it('changes visibility of a room', () => { + const MeQuery = getMinimalMe({ + isTeacher: true + }); + const operations = { + MeQuery, + RoomEntriesQuery + }; + + cy.mockGraphqlOps({ + operations, + }); + + cy.visit(`/room/${slug}`); + cy.getByDataCy('toggle-room-actions-menu').click(); + cy.getByDataCy('change-visibility').click(); + cy.getByDataCy('modal-title').should('contain', 'Sichtbarkeit anpassen'); + cy.getByDataCy('select-option').eq(1).click(); + cy.getByDataCy('save').click(); + }); }); diff --git a/client/cypress/integration/frontend/rooms/rooms-page.spec.js b/client/cypress/integration/frontend/rooms/rooms-page.spec.js index f96b0c6e..7fca57f5 100644 --- a/client/cypress/integration/frontend/rooms/rooms-page.spec.js +++ b/client/cypress/integration/frontend/rooms/rooms-page.spec.js @@ -84,7 +84,7 @@ describe('The Rooms Page', () => { cy.get('[data-cy=add-room]').should('not.exist'); }); - it.only('adds a room as teacher', () => { + it('adds a room as teacher', () => { const getRoom = (title, appearance, description) => { let id = title.toLowerCase().replace(' ', '-'); return { diff --git a/client/src/App.vue b/client/src/App.vue index 1d53d296..cbb6e90a 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -39,6 +39,7 @@ import FullscreenVideo from '@/components/FullscreenVideo'; import DeactivatePerson from '@/components/profile/DeactivatePerson'; import SnapshotCreated from '@/components/modules/SnapshotCreated'; + import ChangeVisibility from '@/components/rooms/ChangeVisibility'; import {mapGetters} from 'vuex'; import ScrollUp from '@/components/ScrollUp'; import ReadOnlyBanner from '@/components/ReadOnlyBanner'; @@ -72,6 +73,7 @@ FullscreenVideo, DeactivatePerson, SnapshotCreated, + ChangeVisibility, }, computed: { diff --git a/client/src/components/modules/SnapshotCreated.vue b/client/src/components/modules/SnapshotCreated.vue index 2a4c53de..c75d880a 100644 --- a/client/src/components/modules/SnapshotCreated.vue +++ b/client/src/components/modules/SnapshotCreated.vue @@ -68,9 +68,7 @@ .snapshot-created { &__heading { - @include heading-2; - margin-bottom: 0; - line-height: 1.5; + @include modal-heading; } &__content { diff --git a/client/src/components/rooms/ChangeVisibility.vue b/client/src/components/rooms/ChangeVisibility.vue new file mode 100644 index 00000000..63a0687b --- /dev/null +++ b/client/src/components/rooms/ChangeVisibility.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/client/src/components/rooms/RoomActions.vue b/client/src/components/rooms/RoomActions.vue index dc051a2b..d9591d68 100644 --- a/client/src/components/rooms/RoomActions.vue +++ b/client/src/components/rooms/RoomActions.vue @@ -4,6 +4,7 @@ data-cy="room-actions"> @@ -20,8 +21,9 @@