Skip to content

Commit

Permalink
Revert "Conserver le mode iframe durant la navigation (#1215)"
Browse files Browse the repository at this point in the history
This reverts commit c23b8ca.
  • Loading branch information
kolok committed Jan 21, 2025
1 parent 52751db commit 56f443a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
Expand Down
9 changes: 0 additions & 9 deletions qfdmd/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions static/to_compile/js/controllers/assistant/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ export default class extends Controller<HTMLElement> {
conversionScore,
},
})

const posthogBannerConversionScore = document.querySelector("#posthog-banner-conversion-score")
if (posthogBannerConversionScore) {
posthogBannerConversionScore.textContent = conversionScore.toString()
}
}, 1000)
}

Expand Down
10 changes: 0 additions & 10 deletions templates/qfdmd/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,5 @@
{% endif %}
data-analytics-action-value="{% block analytics_action %}{% endblock %}"
></script>
{% if assistant.is_iframe and request.user.is_authenticated %}
<div class="qf-bg-warning-425-625-hover qf-text-white qf-text-center qf-w-screen qf-py-1v qf-text-xs">
Le mode iframe de l'assistant est actif
</div>
{% endif %}
{% if "posthog" in request.GET %}
<div class="qf-bg-green-bourgeon-main-640 qf-text-white qf-text-center qf-w-screen qf-py-1v qf-text-xs">
Identifiant PostHog : {{ assistant.POSTHOG_KEY }} | Score de conversion : <span id="posthog-banner-conversion-score"></span>
</div>
{% endif %}
</body>
</html>

0 comments on commit 56f443a

Please sign in to comment.