Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/docs/content/guides/platform/credits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Price price="999" /> 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.

<Admonition type="note">
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/public/humans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Danny White
Darren Cunningham
Dave Wilson
David A. Ventimiglia
Deepthi Sigireddi
Deji I
Div Arora
Divit D
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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}`)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand All @@ -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()
}

Expand Down Expand Up @@ -98,15 +119,17 @@ export const OutOfDateNotice = ({
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction onClick={handleConfirmUpdate}>Update anyway</AlertDialogAction>
<AlertDialogAction onClick={() => handleUpdate(true)}>
Update anyway
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
) : (
<Button
type="default"
loading={isPushing}
onClick={handleUpdateClick}
onClick={() => handleUpdate()}
icon={<GitBranchIcon size={16} strokeWidth={1.5} />}
className="shrink-0"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import { Branch } from 'data/branches/branches-query'
import { tablesToSQL } from 'lib/helpers'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'

interface ReviewWithAIProps {
currentBranch?: Branch
Expand All @@ -22,6 +24,8 @@ export const ReviewWithAI = ({
disabled = false,
}: ReviewWithAIProps) => {
const aiSnap = useAiAssistantStateSnapshot()
const selectedOrg = useSelectedOrganization()
const { mutate: sendEvent } = useSendEventMutation()

// Get parent project for production schema
const parentProject = useProjectByRef(parentProjectRef)
Expand All @@ -40,6 +44,15 @@ export const ReviewWithAI = ({
const handleReviewWithAssistant = () => {
if (!currentBranch || !mainBranch) return

// Track review with assistant button pressed
sendEvent({
action: 'branch_review_with_assistant_clicked',
groups: {
project: parentProjectRef ?? 'Unknown',
organization: selectedOrg?.slug ?? 'Unknown',
},
})

// Prepare diff content for the assistant
const sqlSnippets = []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ export const CreditTopUp = ({ slug }: { slug: string | undefined }) => {
<DialogTitle>Top Up Credits</DialogTitle>
<DialogDescription>
On successful payment, an invoice will be issued and you'll be granted credits.
Credits will be applied to future invoices only and are not refundable. The topped up
credits do not expire.
Credits will be applied to outstanding and future invoices and are not refundable. The
topped up credits do not expire.
</DialogDescription>
</DialogHeader>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ const CustomDomainActivate = ({ projectRef, customDomain }: CustomDomainActivate
},
}
)
const { mutate: deleteCustomDomain, isLoading: isDeleting } = useCustomDomainDeleteMutation()
const { mutate: deleteCustomDomain, isLoading: isDeleting } = useCustomDomainDeleteMutation({
onSuccess: () => {
toast.success(
'Custom domain setup cancelled successfully. It may take a few seconds before your custom domain is fully removed, so you may need to refresh your browser.'
)
},
})

const endpoint = settings?.app_config?.endpoint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const CustomDomainConfig = () => {
const hasCustomDomainAddon = !!addons?.selected_addons.find((x) => x.type === 'custom_domain')

const {
data: customDomainData,
isLoading: isCustomDomainsLoading,
isError,
isSuccess,
data,
} = useCustomDomainsQuery(
{ projectRef: ref },
{
Expand All @@ -45,6 +45,8 @@ const CustomDomainConfig = () => {
}
)

const { status, customDomain } = customDomainData || {}

return (
<section id="custom-domains">
<FormHeader title="Custom Domains" description="Present a branded experience to your users" />
Expand Down Expand Up @@ -94,24 +96,25 @@ const CustomDomainConfig = () => {
</div>
</Panel.Content>
</Panel>
) : data?.status === '0_no_hostname_configured' ? (
) : status === '0_no_hostname_configured' ? (
<CustomDomainsConfigureHostname />
) : (
<Panel>
{isSuccess && (
<div className="flex flex-col">
{(data.status === '1_not_started' ||
data.status === '2_initiated' ||
data.status === '3_challenge_verified') && (
<CustomDomainVerify customDomain={data.customDomain} />
)}
{(status === '1_not_started' ||
status === '2_initiated' ||
status === '3_challenge_verified') && <CustomDomainVerify />}

{data.status === '4_origin_setup_completed' && (
<CustomDomainActivate projectRef={ref} customDomain={data.customDomain} />
{customDomainData.status === '4_origin_setup_completed' && (
<CustomDomainActivate
projectRef={ref}
customDomain={customDomainData.customDomain}
/>
)}

{data.status === '5_services_reconfigured' && (
<CustomDomainDelete projectRef={ref} customDomain={data.customDomain} />
{customDomainData.status === '5_services_reconfigured' && (
<CustomDomainDelete projectRef={ref} customDomain={customDomainData.customDomain} />
)}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const CustomDomainDelete = ({ projectRef, customDomain }: CustomDomainDeleteProp
const [isDeleteConfirmModalVisible, setIsDeleteConfirmModalVisible] = useState(false)
const { mutate: deleteCustomDomain } = useCustomDomainDeleteMutation({
onSuccess: () => {
toast.success(`Successfully deleted custom domain`)
toast.success(
`Successfully deleted custom domain. It may take a few seconds before your custom domain is fully removed, hence you may need to refresh your browser.`
)
setIsDeleteConfirmModalVisible(false)
},
})
Expand Down
Loading
Loading