diff --git a/apps/docs/content/guides/platform/credits.mdx b/apps/docs/content/guides/platform/credits.mdx index 04ced3dae40e8..a71d1574de0c7 100644 --- a/apps/docs/content/guides/platform/credits.mdx +++ b/apps/docs/content/guides/platform/credits.mdx @@ -29,6 +29,8 @@ As an example, if you start a Pro Plan subscription on January 1 and downgrade t You can top up credits at any time, with a maximum of per top-up. These credits do not expire and are non-refundable. +If you have any outstanding invoices, we’ll automatically use your credits to pay them off. Any remaining credits will be applied to future invoices. + You may want to consider this option to avoid issues with recurring payments, gain more control over how often your credit card is charged, and potentially make things easier for your accounting department. diff --git a/apps/docs/public/humans.txt b/apps/docs/public/humans.txt index c4c3855972b6b..4aa7b3c146983 100644 --- a/apps/docs/public/humans.txt +++ b/apps/docs/public/humans.txt @@ -32,6 +32,7 @@ Danny White Darren Cunningham Dave Wilson David A. Ventimiglia +Deepthi Sigireddi Deji I Div Arora Divit D @@ -72,9 +73,11 @@ Lakshan Perera Laura C Laurence Isla Lenny Urbanowski +Leonardo Santiago Long Hoang Luca Forstner Łukasz Niemier +Manan Gupta Margarita Sandomirskaia Mark Burggraf Monica Khoury diff --git a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx index 93c82251740c0..a23bf75eb81ed 100644 --- a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx +++ b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx @@ -22,6 +22,7 @@ import { useCheckGithubBranchValidity } from 'data/integrations/github-branch-ch import { useGitHubConnectionsQuery } from 'data/integrations/github-connections-query' import { projectKeys } from 'data/projects/keys' import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query' +import { useSendEventMutation } from 'data/telemetry/send-event-mutation' import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' import { useSelectedProject } from 'hooks/misc/useSelectedProject' import { BASE_PATH, IS_PLATFORM } from 'lib/constants' @@ -83,12 +84,26 @@ export const CreateBranchModal = () => { onError: () => {}, }) + const { mutate: sendEvent } = useSendEventMutation() + const { mutate: createBranch, isLoading: isCreating } = useBranchCreateMutation({ onSuccess: async (data) => { toast.success(`Successfully created preview branch "${data.name}"`) if (projectRef) { await Promise.all([queryClient.invalidateQueries(projectKeys.detail(projectRef))]) } + sendEvent({ + action: 'branch_create_button_clicked', + properties: { + branchType: data.persistent ? 'persistent' : 'preview', + gitlessBranching, + }, + groups: { + project: ref ?? 'Unknown', + organization: selectedOrg?.slug ?? 'Unknown', + }, + }) + setShowCreateBranchModal(false) router.push(`/project/${data.project_ref}`) }, diff --git a/apps/studio/components/interfaces/BranchManagement/OutOfDateNotice.tsx b/apps/studio/components/interfaces/BranchManagement/OutOfDateNotice.tsx index 73444da1e93ec..c90b7f991662a 100644 --- a/apps/studio/components/interfaces/BranchManagement/OutOfDateNotice.tsx +++ b/apps/studio/components/interfaces/BranchManagement/OutOfDateNotice.tsx @@ -13,6 +13,9 @@ import { } from 'ui' import { GitBranchIcon } from 'lucide-react' import { Admonition } from 'ui-patterns' +import { useSendEventMutation } from 'data/telemetry/send-event-mutation' +import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' +import { useSelectedProject } from 'hooks/misc/useSelectedProject' interface OutOfDateNoticeProps { isBranchOutOfDateMigrations: boolean @@ -41,6 +44,12 @@ export const OutOfDateNotice = ({ }: OutOfDateNoticeProps) => { const [isDialogOpen, setIsDialogOpen] = useState(false) const hasOutdatedMigrations = isBranchOutOfDateMigrations && missingMigrationsCount > 0 + const selectedOrg = useSelectedOrganization() + const project = useSelectedProject() + const { mutate: sendEvent } = useSendEventMutation() + + const isBranch = project?.parent_project_ref !== undefined + const parentProjectRef = isBranch ? project?.parent_project_ref : project?.ref const getTitle = () => { if (hasOutdatedMigrations && (hasMissingFunctions || hasOutOfDateFunctions)) { @@ -57,12 +66,24 @@ export const OutOfDateNotice = ({ return 'Update this branch to get the latest changes from the production branch.' } - const handleUpdateClick = () => { - onPush() - } + const handleUpdate = (shouldCloseDialog = false) => { + if (shouldCloseDialog) { + setIsDialogOpen(false) + } + + // Track branch update + sendEvent({ + action: 'branch_updated', + properties: { + modifiedEdgeFunctions: hasEdgeFunctionModifications, + source: 'out_of_date_notice', + }, + groups: { + project: parentProjectRef ?? 'Unknown', + organization: selectedOrg?.slug ?? 'Unknown', + }, + }) - const handleConfirmUpdate = () => { - setIsDialogOpen(false) onPush() } @@ -98,7 +119,9 @@ export const OutOfDateNotice = ({ Cancel - Update anyway + handleUpdate(true)}> + Update anyway + @@ -106,7 +129,7 @@ export const OutOfDateNotice = ({