diff --git a/.github/workflows/test-webapp.yml b/.github/workflows/test-webapp.yml index 9ca3023cc..c1aee47cf 100644 --- a/.github/workflows/test-webapp.yml +++ b/.github/workflows/test-webapp.yml @@ -23,7 +23,7 @@ jobs: prepare: name: Prepare - if: needs.files-changed.outputs.webapp + if: needs.files-changed.outputs.webapp == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -37,7 +37,7 @@ jobs: build_test_webapp: name: Docker Build Test - Webapp - if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.webapp + if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.webapp == 'true' needs: [files-changed, prepare] runs-on: ubuntu-latest steps: @@ -57,7 +57,7 @@ jobs: lint_webapp: name: Lint Webapp - if: needs.files-changed.outputs.webapp + if: needs.files-changed.outputs.webapp == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -69,7 +69,7 @@ jobs: unit_test_webapp: name: Unit Tests - Webapp - if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.webapp + if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.webapp == 'true' needs: [files-changed, build_test_webapp] runs-on: ubuntu-latest permissions: diff --git a/backend/src/schema/resolvers/rooms.spec.ts b/backend/src/schema/resolvers/rooms.spec.ts index d27c64e57..03c3d4456 100644 --- a/backend/src/schema/resolvers/rooms.spec.ts +++ b/backend/src/schema/resolvers/rooms.spec.ts @@ -92,6 +92,21 @@ describe('Room', () => { }) }) + describe('user id is self', () => { + it('throws error', async () => { + await expect( + mutate({ + mutation: createRoomMutation(), + variables: { + userId: 'chatting-user', + }, + }), + ).resolves.toMatchObject({ + errors: [{ message: 'Cannot create a room with self' }], + }) + }) + }) + describe('user id exists', () => { it('returns the id of the room', async () => { const result = await mutate({ diff --git a/backend/src/schema/resolvers/rooms.ts b/backend/src/schema/resolvers/rooms.ts index 02309e172..d5015a03b 100644 --- a/backend/src/schema/resolvers/rooms.ts +++ b/backend/src/schema/resolvers/rooms.ts @@ -32,6 +32,9 @@ export default { const { user: { id: currentUserId }, } = context + if (userId === currentUserId) { + throw new Error('Cannot create a room with self') + } const session = context.driver.session() const writeTxResultPromise = session.writeTransaction(async (transaction) => { const createRoomCypher = ` diff --git a/cypress/cypress.config.js b/cypress/cypress.config.js index 2d2cefc47..b169c0ce0 100644 --- a/cypress/cypress.config.js +++ b/cypress/cypress.config.js @@ -42,10 +42,7 @@ module.exports = defineConfig({ baseUrl: "http://localhost:3000", specPattern: "cypress/e2e/**/*.feature", supportFile: "cypress/support/e2e.js", - retries: { - runMode: 2, - openMode: 0, - }, + retries: 0, video: false, setupNodeEvents, }, diff --git a/deployment/TODO-next-update.md b/deployment/TODO-next-update.md index 8630275b7..8e30d1f47 100644 --- a/deployment/TODO-next-update.md +++ b/deployment/TODO-next-update.md @@ -2,6 +2,10 @@ When you overtake this deploy and rebrand repo to your network you have to recognize the following changes and doings: +## Version >= 2.7.0 with 'ocelotDockerVersionTag' 2.7.0-470 + +- You have to rename all `.js` files to `.ts` in `branding/constants` + ## Version >= 2.4.0 with 'ocelotDockerVersionTag' 2.4.0-298 - You have to set `SHOW_CONTENT_FILTER_HEADER_MENU` and `SHOW_CONTENT_FILTER_MASONRY_GRID` in `branding/constants/filter.js` originally in main code file `webapp/constants/filter.js` to your preferred value. diff --git a/webapp/layouts/default.spec.js b/webapp/layouts/default.spec.js index 1b83491d7..cce8c2eca 100644 --- a/webapp/layouts/default.spec.js +++ b/webapp/layouts/default.spec.js @@ -37,7 +37,7 @@ describe('default.vue', () => { getters: { 'auth/isLoggedIn': () => true, 'chat/showChat': () => { - return { showChat: false, roomID: 'u0' } + return { showChat: false, roomID: null } }, }, }) diff --git a/webapp/layouts/default.vue b/webapp/layouts/default.vue index 967bd44cf..ab8abcbee 100644 --- a/webapp/layouts/default.vue +++ b/webapp/layouts/default.vue @@ -41,6 +41,9 @@ export default { closeSingleRoom() { this.$store.commit('chat/SET_OPEN_CHAT', { showChat: false, roomID: 'u0' }) }, + } + beforeCreate() { + this.$store.commit('chat/SET_OPEN_CHAT', { showChat: false, roomID: null }) }, } diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 09a03a84c..51fc07501 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -594,7 +594,7 @@ "moreInfo": "Was ist {APPLICATION_NAME}?", "moreInfoHint": "zur Präsentationsseite", "no-account": "Du hast noch kein Nutzerkonto?", - "no-cookie": "Es kann kein Cookie angelegt werden. Du must Cookies akzeptieren.", + "no-cookie": "Es kann kein Cookie angelegt werden. Du musst Cookies akzeptieren.", "password": "Dein Passwort", "register": "Nutzerkonto erstellen", "success": "Du bist eingeloggt!" @@ -773,9 +773,9 @@ "viewEvent": { "eventEnd": "Ende", "eventIsOnline": "Online", - "eventLocationName": "Stadt", + "eventLocationName": "Stadt - z.B. Musterstraße 1, 12345 Musterstadt", "eventStart": "Beginn", - "eventVenue": "Veranstaltungsort", + "eventVenue": "Veranstaltungsort - z.B. Hinterhof, 1. OG, ...", "title": "Veranstaltung" }, "viewPost": { diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 1c1136faf..21c0721a7 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -773,9 +773,9 @@ "viewEvent": { "eventEnd": "End", "eventIsOnline": "Online", - "eventLocationName": "City", + "eventLocationName": "City - e.g. Example street 1, 12345 City", "eventStart": "Start", - "eventVenue": "Venue", + "eventVenue": "Venue - e.g. Backyard, 1st Floor, ...", "title": "Event" }, "viewPost": { diff --git a/webapp/store/chat.js b/webapp/store/chat.js index 2ee8a47ad..be4ddaec0 100644 --- a/webapp/store/chat.js +++ b/webapp/store/chat.js @@ -1,14 +1,14 @@ export const state = () => { return { showChat: false, - roomID: 'u0', + roomID: null, } } export const mutations = { SET_OPEN_CHAT(state, ctx) { state.showChat = ctx.showChat || false - state.roomID = ctx.roomID || 'u0' + state.roomID = ctx.roomID || null }, }