1
0
Fork 0
mirror of synced 2024-07-07 23:35:49 +12:00

Analytics - record screen template used

This commit is contained in:
Michael Shanks 2020-10-12 15:51:03 +01:00
parent 4a32c7981a
commit cc8a53f40b

View file

@ -3,6 +3,7 @@
import { Input, Button, Spacer, Select, ModalContent } from "@budibase/bbui"
import getTemplates from "builderStore/store/screenTemplates"
import { some } from "lodash/fp"
import analytics from "analytics"
const CONTAINER = "@budibase/standard-components/container"
@ -29,7 +30,7 @@
const templateChanged = newTemplateIndex => {
if (newTemplateIndex === undefined) return
const template = templates[newTemplateIndex]
draftScreen = templates[newTemplateIndex].create()
if (draftScreen.props._instanceName) {
name = draftScreen.props._instanceName
@ -63,6 +64,13 @@
store.createScreen(draftScreen)
if (templateIndex !== undefined) {
const template = templates[templateIndex]
analytics.captureEvent("Screen Created", {
template: template.id || template.name,
})
}
finished()
}