switch feedback destination
This commit is contained in:
parent
bbddd6c2d2
commit
050708084b
6 changed files with 20 additions and 57 deletions
|
|
@ -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)
|
||||
|
|
|
|||
20
app/app.vue
20
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
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -21,7 +26,10 @@ const siteFeedbackConfig = JSON.stringify({
|
|||
<NuxtPage />
|
||||
</NuxtLayout>
|
||||
<ClientOnly>
|
||||
<div class="site-feedback-widget">
|
||||
<div
|
||||
v-if="feedbackEnabled"
|
||||
class="site-feedback-widget"
|
||||
>
|
||||
<feedback-web-component :profile-config="siteFeedbackConfig" />
|
||||
</div>
|
||||
</ClientOnly>
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
</script>
|
||||
|
||||
|
|
@ -96,9 +87,7 @@ useTextHighlight()
|
|||
data-highlight-color="primary"
|
||||
>{{ t('Adoption Progress') }}</h1>
|
||||
</div>
|
||||
<DoxaMapSlot map-id="adopt-map" :profile-config="adoptMapConfig" class="rounded-md">
|
||||
<FeedbackWidgetSlot :profile-config="adoptFeedbackConfig" />
|
||||
</DoxaMapSlot>
|
||||
<DoxaMapSlot map-id="adopt-map" :profile-config="adoptMapConfig" class="rounded-md" />
|
||||
<NuxtLink
|
||||
:to="localePath('/research')"
|
||||
class="research-map-link"
|
||||
|
|
|
|||
|
|
@ -48,15 +48,6 @@ const homeMapConfig = JSON.stringify({
|
|||
tabs: [{ id: 'engagement', colorStrategy: 'engagement', legend: 'engagement', popup: 'engagement' }]
|
||||
})
|
||||
|
||||
const homeFeedbackConfig = JSON.stringify({
|
||||
profile: 'chat-bubble',
|
||||
apiBase: 'https://support.gospelambition.org',
|
||||
enabled: true,
|
||||
showByDefault: false,
|
||||
instanceId: 'fb-home-map',
|
||||
projectId: '7bb8f5ba-eb45-4933-89de-bc93fcda09b2'
|
||||
})
|
||||
|
||||
useTextHighlight()
|
||||
</script>
|
||||
|
||||
|
|
@ -113,9 +104,7 @@ useTextHighlight()
|
|||
data-highlight-color="primary"
|
||||
>{{ t('DOXA people groups around the world') }}</h1>
|
||||
</div>
|
||||
<DoxaMapSlot map-id="home-map" :profile-config="homeMapConfig" class="rounded-xlg">
|
||||
<FeedbackWidgetSlot :profile-config="homeFeedbackConfig" />
|
||||
</DoxaMapSlot>
|
||||
<DoxaMapSlot map-id="home-map" :profile-config="homeMapConfig" class="rounded-xlg" />
|
||||
<NuxtLink
|
||||
:to="localePath('/research')"
|
||||
class="research-map-link"
|
||||
|
|
|
|||
|
|
@ -33,15 +33,6 @@ const prayMapConfig = JSON.stringify({
|
|||
tabs: [{ id: 'prayer', colorStrategy: 'prayer', legend: 'prayer', popup: 'prayer' }]
|
||||
})
|
||||
|
||||
const prayFeedbackConfig = JSON.stringify({
|
||||
profile: 'chat-bubble',
|
||||
apiBase: 'https://support.gospelambition.org',
|
||||
enabled: true,
|
||||
showByDefault: false,
|
||||
instanceId: 'fb-pray-map',
|
||||
projectId: '809ee16b-46e2-4bcd-a93d-b7ea0879d93d'
|
||||
})
|
||||
|
||||
const DEMO_PRAYER_COVERAGE = {
|
||||
enabled: false,
|
||||
complete: 100,
|
||||
|
|
@ -128,9 +119,7 @@ useTextHighlight()
|
|||
<section>
|
||||
<div class="container stack stack--lg">
|
||||
<h2>{{ t('Prayer Progress') }}</h2>
|
||||
<DoxaMapSlot map-id="pray-map" :profile-config="prayMapConfig" class="rounded-md">
|
||||
<FeedbackWidgetSlot :profile-config="prayFeedbackConfig" />
|
||||
</DoxaMapSlot>
|
||||
<DoxaMapSlot map-id="pray-map" :profile-config="prayMapConfig" class="rounded-md" />
|
||||
<NuxtLink
|
||||
:to="localePath('/research')"
|
||||
class="research-map-link"
|
||||
|
|
|
|||
|
|
@ -31,16 +31,6 @@ const researchProfileConfig = computed(() => 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()
|
||||
</script>
|
||||
|
||||
|
|
@ -59,9 +49,7 @@ useTextHighlight()
|
|||
bundle="research-map"
|
||||
:profile-config="researchProfileConfig"
|
||||
class="rounded-xlg"
|
||||
>
|
||||
<FeedbackWidgetSlot :profile-config="researchFeedbackConfig" />
|
||||
</DoxaMapSlot>
|
||||
/>
|
||||
|
||||
<UupgsList
|
||||
:language-code="locale"
|
||||
|
|
|
|||
Loading…
Reference in a new issue