1
0
Fork 0
mirror of synced 2024-06-27 02:20:35 +12:00

NPS survey

This commit is contained in:
Mel O'Hagan 2024-03-21 17:00:12 +00:00
parent e7c2f629b6
commit 3c979b81bb
3 changed files with 16 additions and 0 deletions

1
.gitignore vendored
View file

@ -107,3 +107,4 @@ budibase-component
budibase-datasource
*.iml
.nx

View file

@ -12,6 +12,7 @@ export default class PosthogClient {
posthog.init(this.token, {
autocapture: false,
capture_pageview: false,
advanced_disable_feature_flags_on_first_load: true,
})
posthog.set_config({ persistence: "cookie" })

View file

@ -32,10 +32,14 @@
import TourWrap from "components/portal/onboarding/TourWrap.svelte"
import { TOUR_STEP_KEYS } from "components/portal/onboarding/tours.js"
import { goto } from "@roxi/routify"
import { onMount } from "svelte"
import PosthogClient from "../../analytics/PosthogClient"
export let application
export let loaded
const posthog = new PosthogClient(process.env.POSTHOG_TOKEN)
let unpublishModal
let updateAppModal
let revertModal
@ -44,6 +48,7 @@
let appActionPopoverOpen = false
let appActionPopoverAnchor
let publishing = false
let showNpsSurvey = false
$: filteredApps = $appsStore.apps.filter(app => app.devId === application)
$: selectedApp = filteredApps?.length ? filteredApps[0] : null
@ -97,6 +102,7 @@
type: "success",
icon: "GlobeCheck",
})
showNpsSurvey = true
await completePublish()
} catch (error) {
console.error(error)
@ -147,6 +153,10 @@
notifications.error("Error refreshing app")
}
}
onMount(() => {
posthog.init()
})
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
@ -343,6 +353,10 @@
<RevertModal bind:this={revertModal} />
<VersionModal hideIcon bind:this={versionModal} />
{#if showNpsSurvey}
<div class="nps-survey" />
{/if}
<style>
.app-action-popover-content {
padding: var(--spacing-xl);