1
0
Fork 0
mirror of synced 2024-09-30 17:18:14 +13: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 budibase-datasource
*.iml *.iml
.nx

View file

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

View file

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