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

Merge pull request #13338 from Budibase/feature/nps-posthog

Feature/nps posthog
This commit is contained in:
Martin McKeaveney 2024-03-25 10:01:56 +00:00 committed by GitHub
commit 6bd6ee779b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

1
.gitignore vendored
View file

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

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
let lastOpened let lastOpened
$: filteredApps = $appsStore.apps.filter(app => app.devId === application) $: filteredApps = $appsStore.apps.filter(app => app.devId === application)
@ -98,6 +103,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)
@ -148,6 +154,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 -->
@ -345,6 +355,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);