From 050708084bb22a6ba06130d9e01b272abe44c37b Mon Sep 17 00:00:00 2001 From: corsacca Date: Mon, 7 Sep 2026 13:25:04 +0100 Subject: [PATCH] switch feedback destination --- .env.example | 4 ++-- app/app.vue | 20 ++++++++++++++------ app/pages/adopt/index.vue | 13 +------------ app/pages/index.vue | 13 +------------ app/pages/pray.vue | 13 +------------ app/pages/research/index.vue | 14 +------------- 6 files changed, 20 insertions(+), 57 deletions(-) diff --git a/.env.example b/.env.example index 8cc9cc70..b749caef 100644 --- a/.env.example +++ b/.env.example @@ -33,8 +33,8 @@ NUXT_PUBLIC_MAPBOX_TOKEN=your-mapbox-public-token NUXT_TURNSTILE_SITE_KEY=your-turnstile-site-key NUXT_TURNSTILE_SECRET_KEY=your-turnstile-secret-key -# Feedback widget (global chat bubble → support.gospelambition.org) -NUXT_PUBLIC_FEEDBACK_API_BASE=https://support.gospelambition.org +# Feedback widget (site-wide chat bubble). No PROJECT_ID = widget not rendered. +NUXT_PUBLIC_FEEDBACK_API_BASE=https://support.example.org NUXT_PUBLIC_FEEDBACK_PROJECT_ID=your-feedback-project-id # Statinator analytics (self-hosted tracking-server) diff --git a/app/app.vue b/app/app.vue index ca2ace15..f93fb729 100644 --- a/app/app.vue +++ b/app/app.vue @@ -3,16 +3,21 @@ // on every layout — public, admin and auth. It stays opted out by default and // surfaces only when the visitor opts in: via ?feedback=true or by logging in. // Both set the component's `show-feedback-widget` localStorage flag (login is -// wired in useAuth). The per-page map widgets are separate (FeedbackWidgetSlot, -// anchored inside each map). -useFeedbackScript() +// wired in useAuth). This is the only feedback widget on the site. +// Destination comes from NUXT_PUBLIC_FEEDBACK_API_BASE / _PROJECT_ID. With no +// project id there is nowhere to post, so the widget and its bundle are skipped. +const { public: pub } = useRuntimeConfig() +const feedbackEnabled = Boolean(pub.feedbackProjectId) + +if (feedbackEnabled) useFeedbackScript() + const siteFeedbackConfig = JSON.stringify({ profile: 'chat-bubble', - apiBase: 'https://support.gospelambition.org', + apiBase: pub.feedbackApiBase, enabled: true, showByDefault: false, instanceId: 'fb-site', - projectId: '3c0e8534-f593-4222-8315-31dda4514760' + projectId: pub.feedbackProjectId }) @@ -21,7 +26,10 @@ const siteFeedbackConfig = JSON.stringify({ -
+
diff --git a/app/pages/adopt/index.vue b/app/pages/adopt/index.vue index e6f35900..5bd09258 100644 --- a/app/pages/adopt/index.vue +++ b/app/pages/adopt/index.vue @@ -36,15 +36,6 @@ const adoptMapConfig = JSON.stringify({ tabs: [{ id: 'adoption', colorStrategy: 'adoption', legend: 'adoption', popup: 'adoption' }] }) -const adoptFeedbackConfig = JSON.stringify({ - profile: 'chat-bubble', - apiBase: 'https://support.gospelambition.org', - enabled: true, - showByDefault: false, - instanceId: 'fb-adopt-map', - projectId: 'dd1d9144-3da9-4a3b-87e8-7c17d9e94af0' -}) - useTextHighlight() @@ -96,9 +87,7 @@ useTextHighlight() data-highlight-color="primary" >{{ t('Adoption Progress') }}
- - - + @@ -113,9 +104,7 @@ useTextHighlight() data-highlight-color="primary" >{{ t('DOXA people groups around the world') }} - - - +

{{ t('Prayer Progress') }}

- - - + JSON.stringify({ instanceId: 'research-page' })) -// Feedback widget — mirrors the pray.vue pattern (qa.md R5 status flag). -const researchFeedbackConfig = JSON.stringify({ - profile: 'chat-bubble', - apiBase: 'https://support.gospelambition.org', - enabled: true, - showByDefault: false, - instanceId: 'fb-research-map', - projectId: '1be56abd-60fd-4366-ad4f-178dddef657d' -}) - useTextHighlight() @@ -59,9 +49,7 @@ useTextHighlight() bundle="research-map" :profile-config="researchProfileConfig" class="rounded-xlg" - > - - + />