mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## Problem Studio relies on repeated classes to style inline code. Bare `<code>` elements can miss those styles. ## Solution Import the shared styles from #51980 and remove the repeated classes. Keep Markdown renderer behaviour and existing size overrides. Use `data-code-style="plain"` for webhook headers, CLI and upgrade commands, configuration comparisons and connected-resource labels that have their own layout. ## Review instructions Dashboard review: this PR changes Studio only. 1. Open [Database > Extensions](https://studio-staging-git-dnywh-depr-707-code-studio-supabase.vercel.app/dashboard/project/_/database/extensions). Search for `pg_trgm` or another disabled extension and turn on its toggle to open the Enable dialog. Check the Extension and Schema values and the help text under “Install in a different schema”. The SQL block should keep its highlighting and copy control. Close without installing. 2. Open [Edge Functions > Secrets](https://studio-staging-git-dnywh-depr-707-code-studio-supabase.vercel.app/dashboard/project/_/functions/secrets). Scroll to “Default secrets” and check `SUPABASE_URL` and `SUPABASE_DB_URL`: both should use the bordered inline-code style. Hover a name to see “Click to copy”, then click it and confirm the name is copied. No custom secret or deployed function is needed. 3. Compare light and dark themes at narrow and desktop widths. | Before | After | | --- | --- | | <img width="812" height="1066" alt="CleanShot 2026-10-19 at 15 35 10@2x" src="https://github.com/user-attachments/assets/e4a21310-1fac-4143-9ee6-d2452ab4f314" /> | <img width="812" height="1068" alt="CleanShot 2026-10-20 at 15 39 20@2x" src="https://github.com/user-attachments/assets/d2c91ef6-7836-4c71-8f15-d0c0df8e969d" /> |
171 lines
6.1 KiB
TypeScript
171 lines
6.1 KiB
TypeScript
import { SchemaInstallationStatus } from '@stripe/sync-engine/supabase'
|
|
import { EdgeFunctions } from 'icons'
|
|
import { LayersIcon, Loader2Icon, TableIcon } from 'lucide-react'
|
|
import { Card, CardContent, cn } from 'ui'
|
|
|
|
import {
|
|
hasInstallError,
|
|
hasUninstallError,
|
|
isInstallDone,
|
|
isInstalled,
|
|
isInstalling,
|
|
isUninstallDone,
|
|
isUninstalling,
|
|
} from './stripe-sync-status'
|
|
|
|
type StripeSyncChangesCardProps = {
|
|
installationStatus: SchemaInstallationStatus
|
|
className?: string
|
|
isUpgrade?: boolean
|
|
}
|
|
|
|
const ListItemClassName = 'flex items-center gap-x-3 py-2 px-3 border-b'
|
|
|
|
export const StripeSyncChangesCard = ({
|
|
installationStatus,
|
|
className,
|
|
isUpgrade,
|
|
}: StripeSyncChangesCardProps) => {
|
|
const installed = isInstalled(installationStatus)
|
|
const installError = hasInstallError(installationStatus)
|
|
const uninstallError = hasUninstallError(installationStatus)
|
|
const installInProgress = isInstalling(installationStatus)
|
|
const uninstallInProgress = isUninstalling(installationStatus)
|
|
const installDone = isInstallDone(installationStatus)
|
|
const uninstallDone = isUninstallDone(installationStatus)
|
|
|
|
// Special case: installed integration with upgrade available (shown in sheet context)
|
|
const isInProgress = installInProgress || uninstallInProgress
|
|
const isInstalledWithUpgrade = installed && isUpgrade
|
|
|
|
const title = isInstalledWithUpgrade
|
|
? 'This integration will upgrade your Supabase project:'
|
|
: uninstallDone || installError
|
|
? 'This integration will modify your Supabase project:'
|
|
: isInProgress
|
|
? 'This integration is modifying your Supabase project:'
|
|
: installDone || installed || uninstallError
|
|
? 'This integration has modified your Supabase project:'
|
|
: ''
|
|
|
|
const dbLine = isInstalledWithUpgrade
|
|
? 'Upgrades the database schema named'
|
|
: uninstallDone || installError
|
|
? 'Creates a new database schema named'
|
|
: installInProgress
|
|
? isUpgrade
|
|
? 'Upgrading database schema named'
|
|
: 'Creating a new database schema named'
|
|
: installDone || installed || uninstallError
|
|
? 'Created a new database schema named'
|
|
: uninstallInProgress
|
|
? 'Dropping database schema named'
|
|
: ''
|
|
|
|
const tableAndViewLine = isInstalledWithUpgrade
|
|
? 'Upgrades tables and views in the'
|
|
: uninstallDone || installError
|
|
? 'Creates tables and views in the'
|
|
: installInProgress
|
|
? isUpgrade
|
|
? 'Upgrading tables and views in the'
|
|
: 'Creating tables and views in the'
|
|
: installDone || installed || uninstallError
|
|
? 'Created tables and views in the'
|
|
: uninstallInProgress
|
|
? 'Dropping tables and views in the'
|
|
: ''
|
|
|
|
const edgeFunctionsLine = isInstalledWithUpgrade
|
|
? 'Upgrades Edge Functions to handle incoming webhooks from Stripe'
|
|
: uninstallDone || installError
|
|
? 'Deploys Edge Functions to handle incoming webhooks from Stripe'
|
|
: installInProgress
|
|
? isUpgrade
|
|
? 'Upgrading Edge Functions to handle incoming webhooks from Stripe'
|
|
: 'Deploying Edge Functions to handle incoming webhooks from Stripe'
|
|
: installDone || installed || uninstallError
|
|
? 'Deployed Edge Functions to handle incoming webhooks from Stripe'
|
|
: uninstallInProgress
|
|
? 'Undeploying Edge Functions to handle incoming webhooks from Stripe'
|
|
: ''
|
|
|
|
const scheduleLine = isInstalledWithUpgrade
|
|
? 'Upgrades automatic Stripe data syncs using Supabase Queues'
|
|
: uninstallDone || installError
|
|
? 'Schedules automatic Stripe data syncs using Supabase Queues'
|
|
: installInProgress
|
|
? isUpgrade
|
|
? 'Upgrading automatic Stripe data syncs using Supabase Queues'
|
|
: 'Scheduling automatic Stripe data syncs using Supabase Queues'
|
|
: installDone || installed || uninstallError
|
|
? 'Scheduled automatic Stripe data syncs using Supabase Queues'
|
|
: uninstallInProgress
|
|
? 'Unscheduling automatic Stripe data syncs using Supabase Queues'
|
|
: ''
|
|
|
|
return (
|
|
<div className="flex flex-col gap-y-4">
|
|
<h4>{title}</h4>
|
|
<Card className={cn(className)}>
|
|
<CardContent className="p-0">
|
|
<ul className="text-foreground-light text-sm">
|
|
<li className={ListItemClassName}>
|
|
{isInProgress ? (
|
|
<Loader2Icon size={16} className="animate-spin" />
|
|
) : (
|
|
<TableIcon
|
|
size={16}
|
|
strokeWidth={1.5}
|
|
className="text-foreground-lighter shrink-0"
|
|
/>
|
|
)}
|
|
<span>
|
|
{dbLine} <code>stripe</code>
|
|
</span>
|
|
</li>
|
|
<li className={ListItemClassName}>
|
|
{isInProgress ? (
|
|
<Loader2Icon size={16} className="animate-spin" />
|
|
) : (
|
|
<TableIcon
|
|
size={16}
|
|
strokeWidth={1.5}
|
|
className="text-foreground-lighter shrink-0"
|
|
/>
|
|
)}
|
|
<span>
|
|
{tableAndViewLine} <code>stripe</code> schema for synced Stripe data
|
|
</span>
|
|
</li>
|
|
<li className={ListItemClassName}>
|
|
{isInProgress ? (
|
|
<Loader2Icon size={16} className="animate-spin" />
|
|
) : (
|
|
<EdgeFunctions
|
|
size={16}
|
|
strokeWidth={1.5}
|
|
className="text-foreground-lighter shrink-0"
|
|
/>
|
|
)}
|
|
<span>{edgeFunctionsLine}</span>
|
|
</li>
|
|
<li className="flex items-center gap-x-3 py-2 px-3">
|
|
{isInProgress ? (
|
|
<Loader2Icon size={16} className="animate-spin" />
|
|
) : (
|
|
<LayersIcon
|
|
size={16}
|
|
strokeWidth={1.5}
|
|
className="text-foreground-lighter shrink-0"
|
|
/>
|
|
)}
|
|
<span>{scheduleLine}</span>
|
|
</li>
|
|
</ul>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
)
|
|
}
|