Skip to content

Commit

Permalink
Assistant v2 - 3ème vague de retours (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienheureux authored Jan 7, 2025
1 parent a0424fe commit 5910731
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 5 deletions.
6 changes: 5 additions & 1 deletion static/to_compile/js/controllers/assistant/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default class extends Controller<HTMLElement> {
api_host: "https://eu.posthog.com",
autocapture: false,
capture_pageview: false,
person_profiles: 'always',
persistence: "memory",
}

Expand All @@ -47,6 +48,10 @@ export default class extends Controller<HTMLElement> {
this.#fillSessionStorageWithAction()
this.#setupIntersectionObserverForPageView()
this.#captureUserConversionScore()

if (this.posthogDebugValue) {
posthog.debug()
}
}

#fillSessionStorageWithAction() {
Expand Down Expand Up @@ -85,7 +90,6 @@ export default class extends Controller<HTMLElement> {
propertiesToSendToPostHog.iframe = true
}


posthog.capture("$set", {
$set: propertiesToSendToPostHog
})
Expand Down
2 changes: 1 addition & 1 deletion templates/components/produit/_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class="qf-flex qf-flex-col qf-gap-5w"
>
<section id="qu-est-ce-que-j-en-fais">
<p class="qf-text-sm md:qf-text-lg">
<p class="qf-text-base md:qf-text-lg">
{{ content|default:produit.qu_est_ce_que_j_en_fais|safe }}
</p>
</section>
Expand Down
3 changes: 3 additions & 0 deletions templates/components/search/_search_result.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
target="_top"
style="background-image: none;"
class="
focus:!no-underline
focus:!bg-none
focus:!qf-bg-grey-1000-50-hover
hover:!no-underline
hover:!bg-none
hover:!qf-bg-grey-1000-50-hover
Expand Down
60 changes: 59 additions & 1 deletion templates/components/sidebar/share/action.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,65 @@
{% endblock modal_title %}

{% block modal_content %}
Bouton de partage
<div class="fr-share" role="toolbar">
<ul class="fr-btns-group">
<li>
<a class="fr-btn--facebook fr-btn"
target="_blank"
rel="noreferrer"
title="partager cette page sur Facebook - nouvelle fenêtre"
href="https://www.facebook.com/sharer.php?u={{ request.build_absolute_uri|urlencode }}"
tabindex="-1"
>
Partager sur Facebook
</a>
</li>
<li>
{# Les paramètres de la reqûete doivent être URI-encodés (ex: encodeURIComponent() en js) #}
<a class="fr-btn--twitter-x fr-btn"
target="_blank"
rel="noreferrer"
title="partager cette page sur X - nouvelle fenêtre"
href="https://twitter.com/intent/tweet?url={{ request.build_absolute_uri|urlencode }}&text=Super object trouvée grâce à l'ADEME&via=Longue+vie+aux+objets&hashtags=longuevieauxobjets,ademe"
tabindex="-1"
>
Partager sur X (anciennement Twitter)
</a>
</li>
<li>
<a class="fr-btn--linkedin fr-btn"
target="_blank"
rel="noreferrer"
title="partager cette page sur LinkedIn - nouvelle fenêtre"
onclick="window.open(this.href,'Partager sur LinkedIn','toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=550'); event.preventDefault();"
href="https://www.linkedin.com/shareArticle?url={{ request.build_absolute_uri|urlencode }}&title=Super object trouvée grâce à l'ADEME"
tabindex="-1"
>
Partager sur LinkedIn
</a>
</li>
<li>
<a class="fr-btn--mail fr-btn"
target="_blank"
rel="noreferrer"
title="partager cette page par email - nouvelle fenêtre"
href="mailto:?subject=Super object trouvée grâce à l'ADEME&body=Super object trouvée grâce à l'ADEME : {{ request.build_absolute_uri|urlencode }}"
tabindex="-1"
>
Partager par email
</a>
</li>
<li>
<button class="fr-btn--copy fr-btn"
onclick="navigator.clipboard.writeText('{{ request.build_absolute_uri }}').then(function() {alert('Adresse copiée dans le presse papier.')});"
type="button"
tabindex="-1"
>
Copier dans le presse-papier
</button>
</li>
</ul>
</div>
{% endblock modal_content %}

{# TODO: documenter #}
Expand Down
2 changes: 1 addition & 1 deletion templates/qfdmd/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<script
data-controller="analytics"
data-analytics-posthog-key-value="{{ assistant.POSTHOG_KEY }}"
data-analytics-posthog-debug-value="{{ POSTHOG_DEBUG }}"
data-analytics-posthog-debug-value="{{ POSTHOG_DEBUG|lower }}"
{% if request.user.is_authenticated %}
data-analytics-user-username-value="{{ request.user.username }}"
data-analytics-user-email-value="{{ request.user.email }}"
Expand Down
2 changes: 1 addition & 1 deletion templates/qfdmd/synonyme_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% with object.produit as produit %}
<article
class="qf-flex qf-flex-col
qf-gap-4w max-xl:qf-pr-6w"
qf-gap-4w max-lg:qf-pr-0 max-xl:qf-pr-6w"
>
<header class="qf-mt-3w md:qf-mt-5w">
<h1 class="qf-m-0">
Expand Down

0 comments on commit 5910731

Please sign in to comment.