Merge branch 'master' of github.com:Budibase/budibase into labday/sqs
This commit is contained in:
commit
fbcc4b83a1
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.22.17",
|
||||
"version": "2.22.18",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 532c4db35cecd346b5c24f0b89ab7b397a122a36
|
||||
Subproject commit a0ee9cad8cefb8f9f40228705711be174f018fa9
|
|
@ -72,7 +72,7 @@
|
|||
"fast-json-patch": "^3.1.1",
|
||||
"json-format-highlight": "^1.0.4",
|
||||
"lodash": "4.17.21",
|
||||
"posthog-js": "^1.116.6",
|
||||
"posthog-js": "^1.118.0",
|
||||
"remixicon": "2.5.0",
|
||||
"sanitize-html": "^2.7.0",
|
||||
"shortid": "2.2.15",
|
||||
|
|
|
@ -38,6 +38,10 @@ class AnalyticsHub {
|
|||
intercom.show(user)
|
||||
}
|
||||
|
||||
initPosthog() {
|
||||
posthog.init()
|
||||
}
|
||||
|
||||
async logout() {
|
||||
posthog.logout()
|
||||
intercom.logout()
|
||||
|
|
|
@ -33,13 +33,10 @@
|
|||
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
|
||||
|
@ -156,7 +153,7 @@
|
|||
}
|
||||
|
||||
onMount(() => {
|
||||
posthog.init()
|
||||
analytics.initPosthog()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -5,29 +5,29 @@
|
|||
import Provider from "./context/Provider.svelte"
|
||||
import { onMount, getContext } from "svelte"
|
||||
import { enrichButtonActions } from "../utils/buttonActions.js"
|
||||
import { memo } from "@budibase/frontend-core"
|
||||
|
||||
export let params = {}
|
||||
|
||||
const context = getContext("context")
|
||||
const onLoadActions = memo()
|
||||
|
||||
// Get the screen definition for the current route
|
||||
$: screenDefinition = $screenStore.activeScreen?.props
|
||||
|
||||
$: runOnLoadActions(params)
|
||||
$: onLoadActions.set($screenStore.activeScreen?.onLoad)
|
||||
$: runOnLoadActions($onLoadActions, params)
|
||||
|
||||
// Enrich and execute any on load actions.
|
||||
// We manually construct the full context here as this component is the
|
||||
// one that provides the url context, so it is not available in $context yet
|
||||
const runOnLoadActions = params => {
|
||||
const screenState = get(screenStore)
|
||||
|
||||
if (screenState.activeScreen?.onLoad && !get(builderStore).inBuilder) {
|
||||
const actions = enrichButtonActions(screenState.activeScreen.onLoad, {
|
||||
const runOnLoadActions = (actions, params) => {
|
||||
if (actions?.length && !get(builderStore).inBuilder) {
|
||||
const enrichedActions = enrichButtonActions(actions, {
|
||||
...get(context),
|
||||
url: params,
|
||||
})
|
||||
if (actions != null) {
|
||||
actions()
|
||||
if (enrichedActions != null) {
|
||||
enrichedActions()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue