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
4 changes: 2 additions & 2 deletions apps/docs/content/guides/auth/auth-anonymous.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ await supabase.auth.updateUser(UserAttributes(email: 'valid.email@supabase.io'))
<$Show if="sdk:swift">
<TabPanel id="swift" label="Swift">

You can use the [`updateUser()`](/docs/reference/swift/auth-updateuser) method to link an email or phone identity to the anonymous user.
You can use the [`update(user:)`](/docs/reference/swift/auth-updateuser) method to link an email or phone identity to the anonymous user.

```swift
try await supabase.auth.updateUser(
try await supabase.auth.update(
user: UserAttributes(email: "valid.email@supabase.io")
)
```
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/auth/quickstarts/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hideToc: true
<StepHikeCompact.Details title="Create a Next.js app">

Use the `create-next-app` command and the `with-supabase` template, to create a Next.js app pre-configured with:
- [Cookie-based Auth](docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server)
- [Cookie-based Auth](/docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hideToc: true
<StepHikeCompact.Details title="Create a Next.js app">

Use the `create-next-app` command and the `with-supabase` template, to create a Next.js app pre-configured with:
- [Cookie-based Auth](docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server)
- [Cookie-based Auth](/docs/guides/auth/server-side/creating-a-client?queryGroups=package-manager&package-manager=npm&queryGroups=framework&framework=nextjs&queryGroups=environment&environment=server)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ Now, create the associated `src/routes/account/+page.server.ts` file that handle
and handle all form actions through the `actions` object.

<$CodeSample
path="/user-management/sveltekit-user-management/src/routes/+page.server.ts"
path="/user-management/sveltekit-user-management/src/routes/account/+page.server.ts"
lines={[[1, -1]]}
meta="name=src/routes/+page.server.ts"
meta="name=src/routes/account/+page.server.ts"
/>

### Launch!
Expand Down
16 changes: 5 additions & 11 deletions apps/docs/features/docs/Troubleshooting.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { cache } from 'react'
import { z } from 'zod'

import { cache_fullProcess_withDevCacheBust } from '~/features/helpers.fs'
import { IS_PLATFORM } from '~/lib/constants'
import { supabaseAdmin } from '~/lib/supabaseAdmin'
import { supabase } from '~/lib/supabase'
import {
getAllTroubleshootingEntriesInternal,
getArticleSlug as getArticleSlugInternal,
Expand All @@ -27,10 +26,9 @@ export interface ITroubleshootingEntry {
export const getArticleSlug = getArticleSlugInternal

async function getAllTroubleshootingEntriesTyped() {
const result: ITroubleshootingEntry[] = (
IS_PLATFORM ? await getAllTroubleshootingEntriesInternal() : []
) as ITroubleshootingEntry[]
return result
const result: ITroubleshootingEntry[] =
(await getAllTroubleshootingEntriesInternal()) as ITroubleshootingEntry[]
return result ?? []
}
export const getAllTroubleshootingEntries = cache_fullProcess_withDevCacheBust(
getAllTroubleshootingEntriesTyped,
Expand Down Expand Up @@ -91,15 +89,11 @@ export async function getAllTroubleshootingErrors() {
}

async function getTroubleshootingUpdatedDatesInternal() {
if (!IS_PLATFORM) {
return new Map<string, Date>()
}

const databaseIds = (await getAllTroubleshootingEntries())
.map((entry) => entry.data.database_id)
.filter((id) => !id.startsWith('pseudo-'))

const { data, error } = await supabaseAdmin()
const { data, error } = await supabase()
.from('troubleshooting_entries')
.select('id, date_updated')
.in('id', databaseIds)
Expand Down
1 change: 1 addition & 0 deletions apps/docs/lib/supabase.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createClient, type SupabaseClient } from '@supabase/supabase-js'

import { type Database as DatabaseGenerated } from 'common'

export type Database = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ export const OverviewMonitoring = () => {
{
key: 'actions',
header: '',
className: 'text-right flex-shrink-0',
className: 'w-6',
render: (row) => (
<div>
<div className="flex justify-end">
<LogsLink href={`/project/${ref}/logs/edge-logs?s=${row.path}`} />
</div>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function OverviewTable<T>({ columns, data, isLoading, emptyMessage }: Ove
(data as unknown as T[]).map((row, idx) => (
<TableRow key={idx}>
{columns.map((col) => (
<TableCell key={String(col.key)} className={cn('py-1.5 px-6', col.className)}>
<TableCell key={String(col.key)} className={cn('py-1.5 pl-6 pr-4', col.className)}>
{col.render ? col.render(row) : (row as any)[col.key as string]}
</TableCell>
))}
Expand Down
33 changes: 29 additions & 4 deletions apps/studio/components/interfaces/Auth/Overview/OverviewUsage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@ import {
ScaffoldSectionTitle,
ScaffoldSectionContent,
} from 'components/layouts/Scaffold'
import { Card, CardContent, CardHeader, CardTitle, cn, Skeleton } from 'ui'
import {
Card,
CardContent,
CardHeader,
CardTitle,
cn,
Skeleton,
Tooltip,
TooltipContent,
TooltipTrigger,
} from 'ui'
import Link from 'next/link'
import { useParams } from 'common'
import { ChevronRight, ExternalLink } from 'lucide-react'
import { ChevronRight, ExternalLink, HelpCircle } from 'lucide-react'
import { Reports } from 'icons'
import {
getChangeColor,
Expand All @@ -28,6 +38,7 @@ export const StatCard = ({
suffix = '',
invert = false,
href,
tooltip,
}: {
title: string
current: number
Expand All @@ -36,6 +47,7 @@ export const StatCard = ({
suffix?: string
invert?: boolean
href?: string
tooltip?: string
}) => {
const router = useRouter()
const isZeroChange = previous === 0
Expand All @@ -53,7 +65,19 @@ export const StatCard = ({
return (
<Card className={cn(href, 'mb-0 flex flex-col')}>
<CardHeader className="flex flex-row items-center justify-between gap-2 space-y-0 pb-0 border-b-0 relative">
<CardTitle className="text-foreground-light">{title}</CardTitle>
<CardTitle className="text-foreground-light flex items-center gap-2">
{title}
{tooltip && (
<Tooltip>
<TooltipTrigger>
<HelpCircle className="text-foreground-light" size={14} strokeWidth={1.5} />
</TooltipTrigger>
<TooltipContent className="w-[300px]">
<p>{tooltip}</p>
</TooltipContent>
</Tooltip>
)}
</CardTitle>
<ButtonTooltip
type="text"
size="tiny"
Expand Down Expand Up @@ -160,11 +184,12 @@ export const OverviewUsage = () => {
<ScaffoldSectionContent className="gap-4">
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
<StatCard
title="Active users"
title="Auth Activity" // https://supabase.slack.com/archives/C08N7894QTG/p1761210058358439?thread_ts=1761147906.491599&cid=C08N7894QTG
current={metrics.current.activeUsers}
previous={activeUsersChange}
loading={isLoading}
href={`/project/${ref}/reports/auth?its=${startDate}&ite=${endDate}#usage`}
tooltip="Users who generated any Auth event in this period. This metric tracks authentication activity, not total product usage. Some active users won't appear here if their session stayed valid."
/>
<StatCard
title="Sign ups"
Expand Down
37 changes: 27 additions & 10 deletions apps/studio/components/interfaces/HomeNew/AdvisorSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ import {
import { Row } from 'ui-patterns'
import ShimmeringLoader from 'ui-patterns/ShimmeringLoader'

export const AdvisorSection = () => {
export const AdvisorSection = ({ showEmptyState = false }: { showEmptyState?: boolean }) => {
const { ref: projectRef } = useParams()
const { data: lints, isLoading: isLoadingLints } = useProjectLintsQuery({ projectRef })
const { data: lints, isLoading: isLoadingLints } = useProjectLintsQuery(
{
projectRef,
},
{
enabled: !showEmptyState,
}
)
const snap = useAiAssistantStateSnapshot()
const { mutate: sendEvent } = useSendEventMutation()
const { data: organization } = useSelectedOrganizationQuery()
Expand Down Expand Up @@ -93,6 +100,10 @@ export const AdvisorSection = () => {
[sendEvent, projectRef, organization]
)

if (showEmptyState) {
return <EmptyState />
}

return (
<div>
{isLoadingLints ? (
Expand Down Expand Up @@ -199,15 +210,21 @@ export const AdvisorSection = () => {
</Sheet>
</>
) : (
<Card className="bg-transparent">
<CardContent className="flex flex-col items-center justify-center gap-2 p-16">
<Shield size={20} strokeWidth={1.5} className="text-foreground-muted" />
<p className="text-sm text-foreground-light text-center">
No security or performance errors found
</p>
</CardContent>
</Card>
<EmptyState />
)}
</div>
)
}

function EmptyState() {
return (
<Card className="bg-transparent">
<CardContent className="flex flex-col items-center justify-center gap-2 p-16">
<Shield size={20} strokeWidth={1.5} className="text-foreground-muted" />
<p className="text-sm text-foreground-light text-center">
No security or performance errors found
</p>
</CardContent>
</Card>
)
}
25 changes: 16 additions & 9 deletions apps/studio/components/interfaces/HomeNew/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const HomeV2 = () => {

const hasShownEnableBranchingModalRef = useRef(false)
const isPaused = project?.status === PROJECT_STATUS.INACTIVE
const isComingUp = project?.status === PROJECT_STATUS.COMING_UP

const [sectionOrder, setSectionOrder] = useLocalStorage<string[]>(
`home-section-order-${project?.ref || 'default'}`,
Expand Down Expand Up @@ -101,9 +102,11 @@ export const HomeV2 = () => {
{sectionOrder.map((id) => {
if (IS_PLATFORM && id === 'usage') {
return (
<SortableSection key={id} id={id}>
<ProjectUsageSection />
</SortableSection>
<div key={id} className={cn(isComingUp && 'opacity-60 pointer-events-none')}>
<SortableSection id={id}>
<ProjectUsageSection />
</SortableSection>
</div>
)
}
if (
Expand All @@ -123,16 +126,20 @@ export const HomeV2 = () => {
}
if (id === 'advisor') {
return (
<SortableSection key={id} id={id}>
<AdvisorSection />
</SortableSection>
<div key={id} className={cn(isComingUp && 'opacity-60 pointer-events-none')}>
<SortableSection id={id}>
<AdvisorSection showEmptyState={isComingUp} />
</SortableSection>
</div>
)
}
if (id === 'custom-report') {
return (
<SortableSection key={id} id={id}>
<CustomReportSection />
</SortableSection>
<div key={id} className={cn(isComingUp && 'opacity-60 pointer-events-none')}>
<SortableSection id={id}>
<CustomReportSection />
</SortableSection>
</div>
)
}
})}
Expand Down
56 changes: 32 additions & 24 deletions apps/studio/components/interfaces/HomeNew/ServiceStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,36 +254,44 @@ export const ServiceStatus = () => {
(service) => !service.isHealthy && service.status !== 'COMING_UP'
)
const anyComingUp = services.some((service) => service.status === 'COMING_UP')
const overallStatusLabel = isLoadingChecks
? 'Checking...'
: anyUnhealthy && !isProjectNew
? 'Unhealthy'
: anyComingUp || isMigrationLoading || (isProjectNew && !allServicesOperational)
? 'Coming up...'
: 'Healthy'
// Spinner only while the overall project is in COMING_UP; otherwise show 6-dot grid
const showSpinnerIcon = project?.status === 'COMING_UP'

const getOverallStatusLabel = (): string => {
if (isLoadingChecks) return 'Checking...'
if (anyComingUp) return 'Coming up...'
if (anyUnhealthy) return 'Unhealthy'
return 'Healthy'
}

const overallStatusLabel = getOverallStatusLabel()

return (
<Popover_Shadcn_>
<PopoverTrigger_Shadcn_>
<SingleStat
icon={
<div className="grid grid-cols-3 gap-1">
{services.map((service, index) => (
<div
key={`${service.name}-${index}`}
className={cn(
'w-1.5 h-1.5 rounded-full',
service.isLoading ||
service.status === 'COMING_UP' ||
(isProjectNew && !service.isHealthy)
? 'bg-foreground-lighter animate-pulse'
: service.isHealthy
? 'bg-brand'
: 'bg-selection'
)}
/>
))}
</div>
showSpinnerIcon ? (
<Loader2 className="animate-spin" size={18} />
) : (
<div className="grid grid-cols-3 gap-1">
{services.map((service, index) => (
<div
key={`${service.name}-${index}`}
className={cn(
'w-1.5 h-1.5 rounded-full',
service.isLoading ||
service.status === 'COMING_UP' ||
(isProjectNew && !service.isHealthy)
? 'bg-foreground-lighter animate-pulse'
: service.isHealthy
? 'bg-brand'
: 'bg-selection'
)}
/>
))}
</div>
)
}
label={<span>Status</span>}
value={<span>{overallStatusLabel}</span>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ const AwsMarketplaceCreateNewOrg = ({ onboardingInfo }: Props) => {

return (
<>
{onboardingInfo && !onboardingInfo.aws_contract_auto_renewal && (
<AwsMarketplaceAutoRenewalWarning
awsContractEndDate={onboardingInfo.aws_contract_end_date}
awsContractSettingsUrl={onboardingInfo.aws_contract_settings_url}
/>
)}
{onboardingInfo &&
!onboardingInfo.aws_contract_auto_renewal &&
!onboardingInfo.aws_contract_is_private_offer && (
<AwsMarketplaceAutoRenewalWarning
awsContractEndDate={onboardingInfo.aws_contract_end_date}
awsContractSettingsUrl={onboardingInfo.aws_contract_settings_url}
/>
)}
<ScaffoldSection>
<ScaffoldSectionDetail className="text-base">
<p>
Expand All @@ -62,8 +64,11 @@ const AwsMarketplaceCreateNewOrg = ({ onboardingInfo }: Props) => {
</p>
<p>
You can read more on billing through AWS in our {''}
{/*TODO(thomas): Update docs link once the new docs exist*/}
<Link href={`${DOCS_URL}/guides/platform`} target="_blank" className="underline">
<Link
href={`${DOCS_URL}/guides/platform/aws-marketplace`}
target="_blank"
className="underline"
>
Billing Docs.
</Link>
</p>
Expand Down
Loading
Loading