🚚(collaboration) change the websocket url name
We will have 2 urls targeting the server, better to improve the naming to avoid confusion.
This commit is contained in:
@@ -19,6 +19,7 @@ and this project adheres to
|
|||||||
- 🔨(frontend) encapsulated title to its own component #474
|
- 🔨(frontend) encapsulated title to its own component #474
|
||||||
- 🐛(frontend) Fix hidden menu on Firefox #468
|
- 🐛(frontend) Fix hidden menu on Firefox #468
|
||||||
- ⚡️(backend) optimize number of queries on document list view #411
|
- ⚡️(backend) optimize number of queries on document list view #411
|
||||||
|
- 🚚(collaboration) change the websocket key name #480
|
||||||
|
|
||||||
|
|
||||||
## [1.8.2] - 2024-11-28
|
## [1.8.2] - 2024-11-28
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ AI_API_KEY=password
|
|||||||
AI_MODEL=llama
|
AI_MODEL=llama
|
||||||
|
|
||||||
# Collaboration
|
# Collaboration
|
||||||
COLLABORATION_SERVER_URL=ws://localhost:4444
|
COLLABORATION_WS_URL=ws://localhost:4444
|
||||||
|
|
||||||
# Frontend
|
# Frontend
|
||||||
FRONTEND_THEME=dsfr
|
FRONTEND_THEME=dsfr
|
||||||
|
|||||||
@@ -1002,7 +1002,7 @@ class ConfigView(views.APIView):
|
|||||||
Return a dictionary of public settings.
|
Return a dictionary of public settings.
|
||||||
"""
|
"""
|
||||||
array_settings = [
|
array_settings = [
|
||||||
"COLLABORATION_SERVER_URL",
|
"COLLABORATION_WS_URL",
|
||||||
"CRISP_WEBSITE_ID",
|
"CRISP_WEBSITE_ID",
|
||||||
"ENVIRONMENT",
|
"ENVIRONMENT",
|
||||||
"FRONTEND_THEME",
|
"FRONTEND_THEME",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ pytestmark = pytest.mark.django_db
|
|||||||
|
|
||||||
|
|
||||||
@override_settings(
|
@override_settings(
|
||||||
COLLABORATION_SERVER_URL="http://testcollab/",
|
COLLABORATION_WS_URL="http://testcollab/",
|
||||||
CRISP_WEBSITE_ID="123",
|
CRISP_WEBSITE_ID="123",
|
||||||
FRONTEND_THEME="test-theme",
|
FRONTEND_THEME="test-theme",
|
||||||
MEDIA_BASE_URL="http://testserver/",
|
MEDIA_BASE_URL="http://testserver/",
|
||||||
@@ -34,7 +34,7 @@ def test_api_config(is_authenticated):
|
|||||||
response = client.get("/api/v1.0/config/")
|
response = client.get("/api/v1.0/config/")
|
||||||
assert response.status_code == HTTP_200_OK
|
assert response.status_code == HTTP_200_OK
|
||||||
assert response.json() == {
|
assert response.json() == {
|
||||||
"COLLABORATION_SERVER_URL": "http://testcollab/",
|
"COLLABORATION_WS_URL": "http://testcollab/",
|
||||||
"CRISP_WEBSITE_ID": "123",
|
"CRISP_WEBSITE_ID": "123",
|
||||||
"ENVIRONMENT": "test",
|
"ENVIRONMENT": "test",
|
||||||
"FRONTEND_THEME": "test-theme",
|
"FRONTEND_THEME": "test-theme",
|
||||||
|
|||||||
@@ -372,8 +372,8 @@ class Base(Configuration):
|
|||||||
SENTRY_DSN = values.Value(None, environ_name="SENTRY_DSN", environ_prefix=None)
|
SENTRY_DSN = values.Value(None, environ_name="SENTRY_DSN", environ_prefix=None)
|
||||||
|
|
||||||
# Collaboration
|
# Collaboration
|
||||||
COLLABORATION_SERVER_URL = values.Value(
|
COLLABORATION_WS_URL = values.Value(
|
||||||
None, environ_name="COLLABORATION_SERVER_URL", environ_prefix=None
|
None, environ_name="COLLABORATION_WS_URL", environ_prefix=None
|
||||||
)
|
)
|
||||||
|
|
||||||
# Frontend
|
# Frontend
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { createDoc } from './common';
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
CRISP_WEBSITE_ID: null,
|
CRISP_WEBSITE_ID: null,
|
||||||
COLLABORATION_SERVER_URL: 'ws://localhost:4444',
|
COLLABORATION_WS_URL: 'ws://localhost:4444',
|
||||||
ENVIRONMENT: 'development',
|
ENVIRONMENT: 'development',
|
||||||
FRONTEND_THEME: 'dsfr',
|
FRONTEND_THEME: 'dsfr',
|
||||||
MEDIA_BASE_URL: 'http://localhost:8083',
|
MEDIA_BASE_URL: 'http://localhost:8083',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ interface ConfigResponse {
|
|||||||
LANGUAGES: [string, string][];
|
LANGUAGES: [string, string][];
|
||||||
LANGUAGE_CODE: string;
|
LANGUAGE_CODE: string;
|
||||||
ENVIRONMENT: string;
|
ENVIRONMENT: string;
|
||||||
COLLABORATION_SERVER_URL?: string;
|
COLLABORATION_WS_URL?: string;
|
||||||
CRISP_WEBSITE_ID?: string;
|
CRISP_WEBSITE_ID?: string;
|
||||||
FRONTEND_THEME?: Theme;
|
FRONTEND_THEME?: Theme;
|
||||||
MEDIA_BASE_URL?: string;
|
MEDIA_BASE_URL?: string;
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ export const useCollaborationUrl = (room?: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const base =
|
const base =
|
||||||
conf?.COLLABORATION_SERVER_URL ||
|
conf?.COLLABORATION_WS_URL ||
|
||||||
(typeof window !== 'undefined' ? `wss://${window.location.host}/ws` : '');
|
(typeof window !== 'undefined'
|
||||||
|
? `wss://${window.location.host}/collaboration/ws/`
|
||||||
|
: '');
|
||||||
|
|
||||||
return `${base}/${room}`;
|
return `${base}?room=${room}`;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user