From 8bbc5498bee6995fe6ad4399d0fe377d7d9ef0a1 Mon Sep 17 00:00:00 2001 From: hoeppner-dataport <106819770+hoeppner-dataport@users.noreply.github.com> Date: Tue, 7 May 2024 17:01:00 +0200 Subject: [PATCH] BC-7101 - collaboration service deployment (#3234) Implement a deployment for the BoardCollaboration-WebSocket-Server. * add configuration for board collaboration websocket uri --- src/modules/data/board/socket/socket.ts | 16 ++++++---------- src/serverApi/v3/api.ts | 6 ++++++ src/store/env-config-defaults.ts | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/modules/data/board/socket/socket.ts b/src/modules/data/board/socket/socket.ts index 94e0968b92..c9800ff78f 100644 --- a/src/modules/data/board/socket/socket.ts +++ b/src/modules/data/board/socket/socket.ts @@ -1,17 +1,13 @@ import { io } from "socket.io-client"; import { Action } from "@/types/board/ActionFactory"; +import { envConfigModule } from "@/store"; export const useBoardSocketApi = (dispatch: (action: Action) => void) => { - // implement socket.io here - const socket = io( - // "https://bc-6683-poc-board-collaboration-server.dbc.dbildungscloud.dev", - "ws://localhost:4450", - { - path: "/collaboration", - withCredentials: true, - } - // { path: "/collaboration", transports: ["polling"] } - ); + const socket = io(envConfigModule.getEnv.BOARD_COLLABORATION_URI, { + path: "/board-collaboration", + withCredentials: true, + }); + socket.on("connect", function () { console.log("connected"); }); diff --git a/src/serverApi/v3/api.ts b/src/serverApi/v3/api.ts index eb4a261dca..387386c884 100644 --- a/src/serverApi/v3/api.ts +++ b/src/serverApi/v3/api.ts @@ -1005,6 +1005,12 @@ export interface ConfigResponse { * @memberof ConfigResponse */ FEATURE_MEDIA_SHELF_ENABLED: boolean; + /** + * + * @type {string} + * @memberof ConfigResponse + */ + BOARD_COLLABORATION_URI: string; /** * * @type {boolean} diff --git a/src/store/env-config-defaults.ts b/src/store/env-config-defaults.ts index 250e44126a..b8852a87e9 100644 --- a/src/store/env-config-defaults.ts +++ b/src/store/env-config-defaults.ts @@ -68,5 +68,6 @@ export const defaultConfigEnvs: ConfigResponse = { FEATURE_SCHULCONNEX_COURSE_SYNC_ENABLED: false, CTL_TOOLS_RELOAD_TIME_MS: 299000, FEATURE_MEDIA_SHELF_ENABLED: false, + BOARD_COLLABORATION_URI: "ws://localhost:4450", FEATURE_NEW_LAYOUT_ENABLED: true, };