Skip to content

Commit aff036d

Browse files
committed
🚚(collaboration) change the websocket url name
We will have 2 urls targeting the server, better to improve the naming to avoid confusion.
1 parent 57ed089 commit aff036d

File tree

8 files changed

+14
-11
lines changed

8 files changed

+14
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to
1919
- 🔨(frontend) encapsulated title to its own component #474
2020
- 🐛(frontend) Fix hidden menu on Firefox #468
2121
- ⚡️(backend) optimize number of queries on document list view #411
22+
- 🚚(collaboration) change the websocket key name #480
2223

2324

2425
## [1.8.2] - 2024-11-28

env.d/development/common.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ AI_API_KEY=password
5353
AI_MODEL=llama
5454

5555
# Collaboration
56-
COLLABORATION_SERVER_URL=ws://localhost:4444
56+
COLLABORATION_WS_URL=ws://localhost:4444
5757

5858
# Frontend
5959
FRONTEND_THEME=dsfr

src/backend/core/api/viewsets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ def get(self, request):
10021002
Return a dictionary of public settings.
10031003
"""
10041004
array_settings = [
1005-
"COLLABORATION_SERVER_URL",
1005+
"COLLABORATION_WS_URL",
10061006
"CRISP_WEBSITE_ID",
10071007
"ENVIRONMENT",
10081008
"FRONTEND_THEME",

src/backend/core/tests/test_api_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
@override_settings(
19-
COLLABORATION_SERVER_URL="http://testcollab/",
19+
COLLABORATION_WS_URL="http://testcollab/",
2020
CRISP_WEBSITE_ID="123",
2121
FRONTEND_THEME="test-theme",
2222
MEDIA_BASE_URL="http://testserver/",
@@ -34,7 +34,7 @@ def test_api_config(is_authenticated):
3434
response = client.get("/api/v1.0/config/")
3535
assert response.status_code == HTTP_200_OK
3636
assert response.json() == {
37-
"COLLABORATION_SERVER_URL": "http://testcollab/",
37+
"COLLABORATION_WS_URL": "http://testcollab/",
3838
"CRISP_WEBSITE_ID": "123",
3939
"ENVIRONMENT": "test",
4040
"FRONTEND_THEME": "test-theme",

src/backend/impress/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ class Base(Configuration):
372372
SENTRY_DSN = values.Value(None, environ_name="SENTRY_DSN", environ_prefix=None)
373373

374374
# Collaboration
375-
COLLABORATION_SERVER_URL = values.Value(
376-
None, environ_name="COLLABORATION_SERVER_URL", environ_prefix=None
375+
COLLABORATION_WS_URL = values.Value(
376+
None, environ_name="COLLABORATION_WS_URL", environ_prefix=None
377377
)
378378

379379
# Frontend

src/frontend/apps/e2e/__tests__/app-impress/config.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createDoc } from './common';
66

77
const config = {
88
CRISP_WEBSITE_ID: null,
9-
COLLABORATION_SERVER_URL: 'ws://localhost:4444',
9+
COLLABORATION_WS_URL: 'ws://localhost:4444',
1010
ENVIRONMENT: 'development',
1111
FRONTEND_THEME: 'dsfr',
1212
MEDIA_BASE_URL: 'http://localhost:8083',

src/frontend/apps/impress/src/core/config/api/useConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface ConfigResponse {
77
LANGUAGES: [string, string][];
88
LANGUAGE_CODE: string;
99
ENVIRONMENT: string;
10-
COLLABORATION_SERVER_URL?: string;
10+
COLLABORATION_WS_URL?: string;
1111
CRISP_WEBSITE_ID?: string;
1212
FRONTEND_THEME?: Theme;
1313
MEDIA_BASE_URL?: string;

src/frontend/apps/impress/src/core/config/hooks/useCollaborationUrl.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ export const useCollaborationUrl = (room?: string) => {
88
}
99

1010
const base =
11-
conf?.COLLABORATION_SERVER_URL ||
12-
(typeof window !== 'undefined' ? `wss://${window.location.host}/ws` : '');
11+
conf?.COLLABORATION_WS_URL ||
12+
(typeof window !== 'undefined'
13+
? `wss://${window.location.host}/collaboration/ws/`
14+
: '');
1315

14-
return `${base}/${room}`;
16+
return `${base}?room=${room}`;
1517
};

0 commit comments

Comments
 (0)