From 86bd65763b4d9d62c256d9f71428261068822c81 Mon Sep 17 00:00:00 2001 From: Nicolas Oudard Date: Tue, 21 Jan 2025 15:17:28 +0100 Subject: [PATCH] Revert "Conserver le mode iframe durant la navigation (#1215)" This reverts commit c23b8ca38dc582d55bd35445e8d5c4b22d9dba9a. --- core/context_processors.py | 2 +- qfdmd/views.py | 9 --------- .../to_compile/js/controllers/assistant/analytics.ts | 5 ----- templates/qfdmd/base.html | 10 ---------- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/core/context_processors.py b/core/context_processors.py index ae3ec21cb..aea8943fe 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -22,8 +22,8 @@ def content(request): def assistant(request) -> dict: return { "assistant": { + "is_iframe": "iframe" in request.GET, "is_home": request.path == reverse("qfdmd:home"), - "is_iframe": request.session.get("iframe"), "POSTHOG_KEY": settings.ASSISTANT["POSTHOG_KEY"], "MATOMO_ID": settings.ASSISTANT["MATOMO_ID"], }, diff --git a/qfdmd/views.py b/qfdmd/views.py index 49c58d7b2..92b5eb832 100644 --- a/qfdmd/views.py +++ b/qfdmd/views.py @@ -72,15 +72,6 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]: ) return context - def setup(self, request, *args, **kwargs): - if "iframe" not in request.session: - request.session["iframe"] = "iframe" in request.GET - if not request.user.is_authenticated: - request.session.set_expiry( - 0 - ) # set to 0 expires when the users closes its browser - super().setup(request, *args, **kwargs) - class HomeView(BaseView, ListView): template_name = "qfdmd/home.html" diff --git a/static/to_compile/js/controllers/assistant/analytics.ts b/static/to_compile/js/controllers/assistant/analytics.ts index 109b2cb1f..09bc9d2c4 100644 --- a/static/to_compile/js/controllers/assistant/analytics.ts +++ b/static/to_compile/js/controllers/assistant/analytics.ts @@ -118,11 +118,6 @@ export default class extends Controller { conversionScore, }, }) - - const posthogBannerConversionScore = document.querySelector("#posthog-banner-conversion-score") - if (posthogBannerConversionScore) { - posthogBannerConversionScore.textContent = conversionScore.toString() - } }, 1000) } diff --git a/templates/qfdmd/base.html b/templates/qfdmd/base.html index 11a5c505d..365a8bcd0 100644 --- a/templates/qfdmd/base.html +++ b/templates/qfdmd/base.html @@ -72,15 +72,5 @@ {% endif %} data-analytics-action-value="{% block analytics_action %}{% endblock %}" > - {% if assistant.is_iframe and request.user.is_authenticated %} -
- Le mode iframe de l'assistant est actif -
- {% endif %} - {% if "posthog" in request.GET %} -
- Identifiant PostHog : {{ assistant.POSTHOG_KEY }} | Score de conversion : -
- {% endif %}