From db1f2b4c4e0d44c36b030e465c7f987bc80ce761 Mon Sep 17 00:00:00 2001
From: Pamela Chia
Date: Wed, 19 Mar 2025 10:10:45 +0100
Subject: [PATCH] feat: track new functions behaviour (#34239)
---
.../Functions/FunctionsEmptyState.tsx | 46 ++++++-
.../EdgeFunctionBlock/EdgeFunctionBlock.tsx | 10 ++
.../pages/project/[ref]/functions/index.tsx | 22 +++-
.../pages/project/[ref]/functions/new.tsx | 19 +++
packages/common/telemetry-constants.ts | 114 ++++++++++++++++++
5 files changed, 203 insertions(+), 8 deletions(-)
diff --git a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
index 38044e82868..5ac058fbd3b 100644
--- a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
+++ b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
@@ -2,6 +2,8 @@ import { useParams } from 'common'
import { ScaffoldSectionTitle } from 'components/layouts/Scaffold'
import { ResourceItem } from 'components/ui/Resource/ResourceItem'
import { ResourceList } from 'components/ui/Resource/ResourceList'
+import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
+import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useFlag } from 'hooks/ui/useFlag'
import { Code, Terminal } from 'lucide-react'
import Link from 'next/link'
@@ -28,6 +30,9 @@ export const FunctionsEmptyState = () => {
const { setAiAssistantPanel } = useAppStateSnapshot()
const edgeFunctionCreate = useFlag('edgeFunctionCreate')
+ const { mutate: sendEvent } = useSendEventMutation()
+ const org = useSelectedOrganization()
+
return (
<>
@@ -48,7 +53,17 @@ export const FunctionsEmptyState = () => {
@@ -99,7 +119,17 @@ export const FunctionsEmptyState = () => {
Create and edit functions directly in the browser. Download to local at any time.
-