Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

use params instead of checking from url

Pamela Chiaf4902f8527d1
diff --git a/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx
index f6bdf2517a6..07a93e9bbbd 100644
--- a/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/AddOns/ComputeInstanceSidePanel.tsx
@@ -97,6 +97,7 @@ const ComputeInstanceSidePanel = () => {
title: 'Change project compute size',
section: 'Add ons',
},
+ projectRef,
},
router
)
@@ -199,6 +200,7 @@ const ComputeInstanceSidePanel = () => {
section: 'Add ons',
option: option.name,
},
+ projectRef,
},
router
)
diff --git a/studio/components/interfaces/BillingV2/Subscription/AddOns/CustomDomainSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/AddOns/CustomDomainSidePanel.tsx
index 3dc20f0aa3b..b753b2295df 100644
--- a/studio/components/interfaces/BillingV2/Subscription/AddOns/CustomDomainSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/AddOns/CustomDomainSidePanel.tsx
@@ -62,6 +62,7 @@ const CustomDomainSidePanel = () => {
title: 'Custom domains',
section: 'Add ons',
},
+ projectRef,
},
router
)
@@ -153,6 +154,7 @@ const CustomDomainSidePanel = () => {
section: 'Add ons',
option: event.target.label,
},
+ projectRef,
},
router
)
diff --git a/studio/components/interfaces/BillingV2/Subscription/AddOns/PITRSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/AddOns/PITRSidePanel.tsx
index 3fe86f26c81..0a61ae1d65f 100644
--- a/studio/components/interfaces/BillingV2/Subscription/AddOns/PITRSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/AddOns/PITRSidePanel.tsx
@@ -83,6 +83,7 @@ const PITRSidePanel = () => {
title: 'Point in Time Recovery',
section: 'Add ons',
},
+ projectRef,
},
router
)
@@ -175,6 +176,7 @@ const PITRSidePanel = () => {
section: 'Add ons',
option: option.name,
},
+ projectRef,
},
router
)
diff --git a/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
index 8e150368483..69612617741 100644
--- a/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/CostControl/SpendCapSidePanel.tsx
@@ -72,6 +72,7 @@ const SpendCapSidePanel = () => {
title: 'Spend cap',
section: 'Cost Control',
},
+ projectRef,
},
router
)
@@ -234,6 +235,7 @@ const SpendCapSidePanel = () => {
section: 'Cost Control',
option: option.name,
},
+ projectRef,
},
router
)
diff --git a/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx b/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx
index 5c6d5675bec..d55caee5da6 100644
--- a/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/Tier/TierUpdateSidePanel.tsx
@@ -71,6 +71,7 @@ const TierUpdateSidePanel = () => {
title: 'Change Subscription Plan',
section: 'Subscription plan',
},
+ projectRef,
},
router
)
@@ -220,6 +221,7 @@ const TierUpdateSidePanel = () => {
: 'Upgrade' + ' to ' + plan.name,
section: 'Subscription plan',
},
+ projectRef,
},
router
)
diff --git a/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx b/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx
index 3013c81b829..b1b9673dde4 100644
--- a/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx
+++ b/studio/components/interfaces/Organization/BillingSettingsV2/CostControl/SpendCapSidePanel.tsx
@@ -72,6 +72,7 @@ const SpendCapSidePanel = () => {
title: 'Spend cap',
section: 'Cost Control',
},
+ ...(slug && { orgSlug: slug }),
},
router
)
@@ -235,6 +236,7 @@ const SpendCapSidePanel = () => {
section: 'Cost Control',
option: option.name,
},
+ ...(slug && { orgSlug: slug }),
},
router
)
diff --git a/studio/components/interfaces/Organization/BillingSettingsV2/Subscription/PlanUpdateSidePanel.tsx b/studio/components/interfaces/Organization/BillingSettingsV2/Subscription/PlanUpdateSidePanel.tsx
index 0d9ffda0a02..251c3baaf05 100644
--- a/studio/components/interfaces/Organization/BillingSettingsV2/Subscription/PlanUpdateSidePanel.tsx
+++ b/studio/components/interfaces/Organization/BillingSettingsV2/Subscription/PlanUpdateSidePanel.tsx
@@ -69,6 +69,7 @@ const PlanUpdateSidePanel = () => {
title: 'Change Subscription Plan',
section: 'Subscription plan',
},
+ ...(slug && { orgSlug: slug }),
},
router
)
@@ -219,6 +220,7 @@ const PlanUpdateSidePanel = () => {
: 'Upgrade' + ' to ' + plan.name,
section: 'Subscription plan',
},
+ ...(slug && { orgSlug: slug }),
},
router
)
diff --git a/studio/lib/telemetry.ts b/studio/lib/telemetry.ts
index 5150ec8ad35..d4dc380411f 100644
--- a/studio/lib/telemetry.ts
+++ b/studio/lib/telemetry.ts
@@ -58,14 +58,14 @@ const sendActivity = (
activity: string
source: string
projectRef?: string
- orgId?: string
+ orgSlug?: string
data?: object
},
router: NextRouter
) => {
if (!IS_PLATFORM) return
- const { activity, source, projectRef, orgId, data } = event
+ const { activity, source, projectRef, orgSlug, data } = event
const properties = {
activity,
@@ -77,15 +77,8 @@ const sendActivity = (
title: document?.title || '',
},
...(data && { data }),
- // add if included, else estimate from path
...(projectRef && { projectRef }),
- ...(router.route.includes('/project/') &&
- !projectRef && {
- projectRef: router.asPath.split('/project/')[1].split('/')[0],
- }),
- ...(orgId && { orgId }),
- ...(router.route.includes('/org/') &&
- !orgId && { orgId: router.asPath.split('/org/')[1].split('/')[0] }),
+ ...(orgSlug && { orgSlug }),
}
return post(`${API_URL}/telemetry/activity`, properties)
}