(frontend) add crisp script

add crisp chatbox to global layout
This commit is contained in:
Eléonore Voisin
2025-05-27 17:34:45 +02:00
committed by Marie
parent a8b08c4b6d
commit 485eb88dd1
8 changed files with 46 additions and 2 deletions

View File

@@ -586,7 +586,13 @@ class ConfigView(views.APIView):
GET /api/v1.0/config/
Return a dictionary of public settings.
"""
array_settings = ["LANGUAGES", "FEATURES", "RELEASE", "COMMIT"]
array_settings = [
"LANGUAGES",
"FEATURES",
"RELEASE",
"COMMIT",
"CRISP_WEBSITE_ID",
]
dict_settings = {}
for setting in array_settings:
dict_settings[setting] = getattr(settings, setting)

View File

@@ -19,6 +19,7 @@ def test_api_config_anonymous():
response = client.get("/api/v1.0/config/")
assert response.status_code == HTTP_200_OK
assert response.json() == {
"CRISP_WEBSITE_ID": None,
"LANGUAGES": [["en-us", "English"], ["fr-fr", "French"]],
"COMMIT": "NA",
"FEATURES": {
@@ -42,6 +43,7 @@ def test_api_config_authenticated():
response = client.get("/api/v1.0/config/")
assert response.status_code == HTTP_200_OK
assert response.json() == {
"CRISP_WEBSITE_ID": None,
"LANGUAGES": [["en-us", "English"], ["fr-fr", "French"]],
"COMMIT": "NA",
"FEATURES": {

View File

@@ -547,6 +547,13 @@ class Base(Configuration):
environ_prefix=None,
)
# SUPPORT
CRISP_WEBSITE_ID = values.Value(
default=None,
environ_name="CRISP_WEBSITE_ID",
environ_prefix=None,
)
# MAILBOX-PROVISIONING API
WEBMAIL_URL = values.Value(
default=None,