The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
first pass on introducing new UI. although added a rogue new thing to mobx store
Jonathan Summers-Muir178697eed700
diff --git a/studio/components/interfaces/Integrations/IntegrationPanels.tsx b/studio/components/interfaces/Integrations/IntegrationPanels.tsxnew file mode 100644index 00000000000..5d301ecc747--- /dev/null+++ b/studio/components/interfaces/Integrations/IntegrationPanels.tsx@@ -0,0 +1,233 @@+import { Integration, IntegrationProjectConnection } from 'data/integrations/integrations-query'+import dayjs from 'dayjs'+import React from 'react'+import {+ Button,+ IconArrowRight,+ IconCloudLightning,+ IconGitHub,+ IconSquare,+ IconTriangle,+} from 'ui'+import { cn } from 'ui/src/utils/cn'++var relativeTime = require('dayjs/plugin/relativeTime')+dayjs.extend(relativeTime)++const ICON_STROKE_WIDTH = 2+const ICON_SIZE = 14+export interface IntegrationInstallationProps extends React.HTMLAttributes<HTMLLIElement> {+ title: string+ orgName: string+ connection: Integration+}++type HandleIconType = Integration['type'] | 'SUPABASE'++const HandleIcon = ({ type }: { type: HandleIconType }) => {+ switch (type) {+ case 'GITHUB':+ return <IconGitHub strokeWidth={ICON_STROKE_WIDTH} size={ICON_SIZE} />+ break+ case 'NETLIFY':+ return <IconSquare strokeWidth={ICON_STROKE_WIDTH} size={ICON_SIZE} />+ break+ case 'VERCEL':+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="var(--colors-scale12)"+ viewBox="0 0 512 512"+ className="w-3.5"+ >+ <path fill-rule="evenodd" d="M256,48,496,464H16Z" />+ </svg>+ )++ // <IconTriangle strokeWidth={ICON_STROKE_WIDTH} size={ICON_SIZE} />+ break+ case 'SUPABASE':+ return (+ <img+ src="/img/supabase-logo.svg"+ alt="Supabase"+ className="mx-auto w-3.5 cursor-pointer rounded"+ ></img>+ )+ // <IconCloudLightning strokeWidth={ICON_STROKE_WIDTH} size={ICON_SIZE} />+ break++ default:+ return <></>+ break+ }+}++const IntegrationInstallation = React.forwardRef<HTMLLIElement, IntegrationInstallationProps>(+ ({ className, title, orgName, connection, ...props }, ref) => {+ const IntegrationIconBlock = () => {+ return (+ <div className="bg-scale-100 w-8 h-8 rounded flex items-center justify-center">+ <HandleIcon type={connection.type} />+ </div>+ )+ }++ return (+ <li+ key={connection.id}+ className="bg border shadow-sm flex justify-between items-center px-8 py-4 rounded-lg"+ >+ <div className="flex gap-6 items-center">+ <div className="flex gap-3 items-center">+ <span className="relative flex h-3 w-3">+ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-brand-1100 opacity-75"></span>+ <span className="relative inline-flex rounded-full h-3 w-3 bg-brand-900"></span>+ </span>+ <IntegrationIconBlock />+ </div>+ <div className="flex flex-col gap-0">+ <span className="text-scale-1200 font-medium">+ {title} integration connection •{' '}+ {connection.metadata?.vercelTeam || connection.metadata?.gitHubConnectionOwner}+ </span>+ <div className="flex gap-3 items-center">+ <span className="text-scale-900 text-sm">+ Created {dayjs(connection.createdAt).fromNow()}+ </span>+ <span className="text-scale-900 text-sm">Added by {connection.createdBy}</span>+ </div>+ </div>+ </div>++ <Button type="default">Manage</Button>+ </li>+ )+ }+)++export interface IntegrationConnectionProps extends React.HTMLAttributes<HTMLLIElement> {+ connection: IntegrationProjectConnection+ type: Integration['type']+}++const IntegrationConnection = React.forwardRef<HTMLLIElement, IntegrationConnectionProps>(+ ({ className, connection, type, ...props }, ref) => {+ return (+ <li+ ref={ref}+ key={connection.id}+ {...props}+ className={cn(+ 'ml-6 pl-8 pb-2 border-l',+ // 'last:border-l-transparent',+ 'relative'+ )}+ >+ <div className="absolute w-8 rounded-bl-full border-b border-l h-10 -left-px"></div>+ <div className="bg border shadow-sm flex justify-between items-center px-8 py-4 rounded-lg">+ <div className="flex flex-col gap-1">+ <div className="flex gap-2 items-center">+ <HandleIcon type={'SUPABASE'} />+ <span>{connection.from.name}</span>+ <IconArrowRight size={14} className="text-scale-900" strokeWidth={1.5} />+ <HandleIcon type={type} />+ <span>{connection.to.name}</span>+ </div>++ <span className="text-scale-900 text-sm">+ Connected {dayjs(connection.createdAt).fromNow()}+ </span>+ </div>++ <div>+ <Button type="default">Disconnect</Button>+ </div>+ </div>+ </li>+ )+ }+)++const IntegrationConnectionOption = React.forwardRef<HTMLLIElement, IntegrationConnectionProps>(+ ({ className, connection, type, ...props }, ref) => {+ return (+ <li+ ref={ref}+ key={connection.id}+ {...props}+ className={cn('bg border shadow-sm flex justify-between items-center px-8 py-4 rounded-lg')}+ >+ <div className="flex flex-col gap-1">+ <div className="flex gap-2 items-center">+ <HandleIcon type={'SUPABASE'} />+ <span>{connection.from.name}</span>+ <IconArrowRight size={14} className="text-scale-900" strokeWidth={1.5} />+ <HandleIcon type={type} />+ <span>{connection.to.name}</span>+ </div>++ <span className="text-scale-900 text-sm">+ Connected {dayjs(connection.createdAt).fromNow()}+ </span>+ </div>++ <Button type="default">Connect</Button>+ </li>+ )+ }+)++const EmptyIntegrationConnection = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => {+ return (+ <div ref={ref} {...props} className={cn('mt-0 ml-14', className)}>+ <div+ {...props}+ ref={ref}+ className={cn(+ 'w-full',+ 'border border-dashed',+ '',+ 'flex h-20 px-10 rounded-lg justify-center items-center',+ className+ )}+ >+ <Button type="default">Add new project connection</Button>+ </div>+ </div>+ )+})++interface IntegrationConnectionHeader extends React.HTMLAttributes<HTMLDivElement> {+ name?: string+}++const IntegrationConnectionHeader = React.forwardRef<HTMLDivElement, IntegrationConnectionHeader>(+ ({ className, name, ...props }, ref) => {+ return (+ <div {...props} ref={ref} className={cn('border-l ml-6 pl-8 pt-6 pb-2', className)}>+ <h3>{props.title}</h3>+ <p className="text-scale-1100 text-sm">+ Repository connections for <span className="capitalize">{name?.toLowerCase()}</span>+ </p>+ </div>+ )+ }+)++IntegrationInstallation.displayName = 'IntegrationInstallation'+IntegrationConnection.displayName = 'IntegrationConnection'+IntegrationConnectionHeader.displayName = 'IntegrationConnectionHeader'+EmptyIntegrationConnection.displayName = 'EmptyIntegrationConnection'+IntegrationConnectionOption.displayName = 'IntegrationConnectionOption'++export {+ EmptyIntegrationConnection,+ IntegrationConnection,+ IntegrationConnectionHeader,+ IntegrationInstallation,+ IntegrationConnectionOption,+}diff --git a/studio/components/interfaces/Markdown.tsx b/studio/components/interfaces/Markdown.tsxnew file mode 100644index 00000000000..db85f97f4f3--- /dev/null+++ b/studio/components/interfaces/Markdown.tsx@@ -0,0 +1,18 @@+import { ReactMarkdownProps } from 'react-markdown/lib/complex-types'+import { ReactMarkdown } from 'react-markdown/lib/react-markdown'+import { cn } from 'ui/src/utils/cn'++interface Props extends Omit<ReactMarkdownProps, 'children' | 'node'> {+ className?: string+ content: string+}++const Markdown = ({ className, content, ...props }: Props) => {+ return (+ <ReactMarkdown {...props} className={cn('prose text-sm', className)}>+ {content}+ </ReactMarkdown>+ )+}++export { Markdown }diff --git a/studio/components/interfaces/Organization/IntegrationSettings/GitHubRepoSelection.tsx b/studio/components/interfaces/Organization/IntegrationSettings/GitHubRepoSelection.tsxnew file mode 100644index 00000000000..fb036c6cabc--- /dev/null+++ b/studio/components/interfaces/Organization/IntegrationSettings/GitHubRepoSelection.tsx@@ -0,0 +1,57 @@+import { useParams } from 'common'+import { IntegrationConnectionOption } from 'components/interfaces/Integrations/IntegrationPanels'+import { Markdown } from 'components/interfaces/Markdown'+import { useIntegrationsQuery } from 'data/integrations/integrations-query'+import { useStore } from 'hooks'+import { observer } from 'mobx-react-lite'+import { IconGitHub, IconSearch, Input, Select, SidePanel } from 'ui'++const GitHubRepoSelection = () => {+ const { ui } = useStore()+ const { slug } = useParams()+ const { data } = useIntegrationsQuery({ orgSlug: slug })++ const visible = ui.showGitHubRepoSelectionPanel++ const githubIntegrations = data?.filter((integration) => integration.type === 'GITHUB')++ return (+ <SidePanel+ header={'Add GitHub repository'}+ size="large"+ visible={visible}+ onCancel={() => ui.setShowGitHubRepoSelectionPanel(false)}+ >+ <div className="my-10 flex flex-col gap-6">+ <SidePanel.Content>+ <Markdown+ content={`+### Choose repository to connect to++Check the details below before proceeding+ `}+ />+ </SidePanel.Content>+ <SidePanel.Content className="flex flex-col gap-2">+ <label className="text-sm text-scale-900">GitHub scope / organisation</label>+ <div className="flex gap-3 w-full">+ <Select icon={<IconGitHub />} className="w-full">+ <Select.Option value="mildtomato">MildTomato</Select.Option>+ <Select.Option value="supabase">Supabase</Select.Option>+ </Select>+ <Input autoFocus icon={<IconSearch />} className="w-full" placeholder="Search..." />+ </div>+ </SidePanel.Content>+ <SidePanel.Content>+ <ul>+ <li className="border px-10">+ {/* <IntegrationConnectionOption connection={githubIntegrations[0]} /> */}+ </li>+ </ul>+ </SidePanel.Content>+ </div>+ </SidePanel>+ )+}++export default observer(GitHubRepoSelection)diff --git a/studio/components/interfaces/Organization/IntegrationSettings/Integration.tsx b/studio/components/interfaces/Organization/IntegrationSettings/Integration.tsxindex 835d58a42ff..4e8bfc3739e 100644--- a/studio/components/interfaces/Organization/IntegrationSettings/Integration.tsx+++ b/studio/components/interfaces/Organization/IntegrationSettings/Integration.tsx@@ -1,14 +1,28 @@+import {+ EmptyIntegrationConnection,+ IntegrationConnection,+ IntegrationConnectionHeader,+ IntegrationInstallation,+} from 'components/interfaces/Integrations/IntegrationPanels'+import { Markdown } from 'components/interfaces/Markdown'+import {+ ScaffoldContainer,+ ScaffoldSection,+ ScaffoldSectionContent,+ ScaffoldSectionDetail,+} from 'components/layouts/Scaffold'import { Integration as TIntegration } from 'data/integrations/integrations-query'-import dayjs from 'dayjs'+import { useStore } from 'hooks'import { pluralize } from 'lib/helpers'import { EMPTY_ARR } from 'lib/void'import { useMemo } from 'react'-import { Button, IconArrowRight } from 'ui'+export interface IntegrationProps {title: stringorgName?: stringdescription?: stringnote?: string+ detail?: stringintegrations?: TIntegration[]}@@ -17,8 +31,11 @@ const Integration = ({orgName,description,note,+ detail,integrations = EMPTY_ARR,}: IntegrationProps) => {+ const { ui } = useStore()+const projectConnections = useMemo(() => integrations.flatMap((integration) => integration.connections),[integrations]@@ -26,81 +43,80 @@ const Integration = ({return (<>- <div>- <h2 className="text-2xl text-scale-1200">{title}</h2>- </div>-- <div className="flex flex-col gap-8">- {description !== undefined && (- <div className="flex flex-col gap-1">- <h3>How does the {title} integration work?</h3>- <p className="text-scale-900 text-sm">{description}</p>- </div>- )}-- {integrations.length > 0 && (- <ul className="flex flex-col gap-2">- {integrations.map((connection) => (- <li- key={connection.id}- className="flex justify-between items-center px-6 py-4 rounded-lg border border-scale-500 bg-panel-body-light dark:bg-panel-body-dark"- >- <div className="flex flex-col gap-1">- <span className="text-scale-1200 font-medium">- {title} integration connection | {orgName}- </span>- <span className="text-scale-900 text-sm">Added by {connection.createdBy}</span>- </div>-- <div>- <Button type="outline">Manage</Button>- </div>- </li>- ))}- </ul>- )}+ <ScaffoldContainer>+ <ScaffoldSection>+ <ScaffoldSectionDetail>+ {detail && <Markdown content={detail} />}+ <img+ className="border rounded-lg shadow w-48 mt-6 border-body"+ src={`/img/integrations/covers/${title.toLowerCase()}-cover.png?v=3`}+ alt="cover"+ />+ </ScaffoldSectionDetail>+ <ScaffoldSectionContent>+ <div>+ <Markdown content={`${description}`} />+ </div>+ <div className="flex flex-col gap-12">+ {integrations.length > 0 &&+ integrations.map((integration, i) => {+ return (+ <div key={i}>+ <IntegrationInstallation+ title={title}+ key={i}+ orgName={orgName}+ connection={integration}+ />+ {integration.connections.length > 0 ? (+ <>+ <IntegrationConnectionHeader+ title={`${integration.connections.length} project+ ${pluralize(integration.connections.length, 'connection')}`}+ name={+ integration.type ++ ' • ' ++ (integration.metadata?.gitHubConnectionOwner ??+ integration.metadata?.vercelTeam)+ }+ />- <hr className="h-px bg-scale-500" role="separator" />-- {projectConnections.length > 0 && (- <div className="flex flex-col gap-4">- <h4>- {projectConnections.length} project{' '}- {pluralize(projectConnections.length, 'connection')}- </h4>-- <ul className="flex flex-col gap-2">- {projectConnections.map((connection) => (- <li- key={connection.id}- className="flex justify-between items-center px-6 py-4 rounded-lg border border-scale-500 bg-panel-body-light dark:bg-panel-body-dark"- >- <div className="flex flex-col gap-1">- <div className="flex gap-2">- <span>{connection.from.name}</span>- <IconArrowRight />- <span>{connection.to.name}</span>+ <ul className="flex flex-col">+ {integration.connections.map((connection, i) => (+ <IntegrationConnection+ key={i}+ connection={connection}+ type={integration.type}+ />+ ))}+ </ul>+ </>+ ) : (+ <IntegrationConnectionHeader+ title={`${integration.connections.length} project+ ${pluralize(integration.connections.length, 'connection')}`}+ name={+ integration.type ++ ' • ' ++ (integration.metadata?.gitHubConnectionOwner ??+ integration.metadata?.vercelTeam)+ }+ />+ )}+ <EmptyIntegrationConnection+ onClick={() => ui.setShowGitHubRepoSelectionPanel(true)}+ >+ Add new project connection+ </EmptyIntegrationConnection></div>+ )+ })}+ </div>- <span className="text-scale-900 text-sm">- Connected {dayjs(connection.createdAt).fromNow()}- </span>- </div>-- <div>- <Button type="outline">Disconnect</Button>- </div>- </li>- ))}- </ul>-- <Button type="outline" className="self-start">- Add new project connection- </Button>- {note !== undefined && <p className="text-scale-900 text-sm">{note}</p>}- </div>- )}- </div>+ <Markdown content={`${note}`} className="text-scale-900" />+ </ScaffoldSectionContent>+ </ScaffoldSection>+ </ScaffoldContainer></>)}diff --git a/studio/components/interfaces/Organization/IntegrationSettings/IntegrationGitHub.tsx b/studio/components/interfaces/Organization/IntegrationSettings/IntegrationGitHub.tsxnew file mode 100644index 00000000000..11ff03fdf45--- /dev/null+++ b/studio/components/interfaces/Organization/IntegrationSettings/IntegrationGitHub.tsx@@ -0,0 +1,95 @@+import {+ EmptyIntegrationConnection,+ IntegrationConnection,+ IntegrationConnectionHeader,+ IntegrationInstallation,+} from 'components/interfaces/Integrations/IntegrationPanels'+import { Markdown } from 'components/interfaces/Markdown'+import {+ ScaffoldContainer,+ ScaffoldSection,+ ScaffoldSectionContent,+ ScaffoldSectionDetail,+} from 'components/layouts/Scaffold'+import { Integration as TIntegration } from 'data/integrations/integrations-query'+import { pluralize } from 'lib/helpers'+import { EMPTY_ARR } from 'lib/void'+import { useMemo } from 'react'++export interface IntegrationProps {+ title: string+ orgName?: string+ description?: string+ note?: string+ integrations?: TIntegration[]+}++const Integration = ({+ title,+ orgName,+ description,+ note,+ integrations = EMPTY_ARR,+}: IntegrationProps) => {+ const projectConnections = useMemo(+ () => integrations.flatMap((integration) => integration.connections),+ [integrations]+ )++ return (+ <>+ <ScaffoldContainer>+ <ScaffoldSection>+ <ScaffoldSectionDetail>+ <h2 className="text-2xl text-scale-1200">{title}</h2>+ </ScaffoldSectionDetail>+ <ScaffoldSectionContent>+ {description !== undefined && (+ <Markdown+ content={`### How does the ${title} integration work?+${description}`}+ />+ )}+ <div className="flex flex-col gap-12">+ {integrations.length > 0 &&+ integrations.map((integraton, i) => {+ return (+ <div key={i}>+ <IntegrationInstallation+ title={title}+ key={i}+ orgName={orgName}+ connection={integraton}+ />+ {integraton.connections.length > 0 && (+ <>+ <IntegrationConnectionHeader+ title={`${integraton.connections.length} project+ ${pluralize(integraton.connections.length, 'connection')}`}+ />++ <ul className="flex flex-col">+ {integraton.connections.map((connection, i) => (+ <IntegrationConnection key={i} connection={connection} />+ ))}+ </ul>++ <EmptyIntegrationConnection>+ Add new project connection+ </EmptyIntegrationConnection>+ </>+ )}+ </div>+ )+ })}+ </div>++ <Markdown content={`${note}`} className="text-scale-900" />+ </ScaffoldSectionContent>+ </ScaffoldSection>+ </ScaffoldContainer>+ </>+ )+}++export default Integrationdiff --git a/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx b/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsxindex 154a869bf6c..a5e423fc918 100644--- a/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx+++ b/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx@@ -1,8 +1,9 @@-import { observer } from 'mobx-react-lite'-import { useParams } from 'common'+import { ScaffoldDivider } from 'components/layouts/Scaffold'import { useIntegrationsQuery } from 'data/integrations/integrations-query'import { useStore } from 'hooks'+import { observer } from 'mobx-react-lite'+import GitHubRepoSelection from './GitHubRepoSelection'import Integration from './Integration'const IntegrationSettings = () => {@@ -13,17 +14,54 @@ const IntegrationSettings = () => {const org = ui.selectedOrganizationconst vercelIntegrations = data?.filter((integration) => integration.type === 'VERCEL')+ const githubIntegrations = data?.filter((integration) => integration.type === 'GITHUB')return (- <div className="grid grid-cols-2 gap-y-8 mt-8">+ <><Integrationtitle="Vercel"orgName={org?.name}- description="Supabase will keep the right environment variables up to date in each of the projects you assign to a Supabase project. You can also link multiple Vercel Projects to the same Supabase project."- note="Your Vercel connection has access to 7 Vercel Projects. You can change the scope of the access for Supabase by configuring here."+ detail={`+## Vercel Integration++Connect your Vercel teams to your Supabase organization.++`}+ description={`+### How does the Vercel integration work?++Supabase will keep the right environment variables up to date in each of the projects you assign to a Supabase project.+You can also link multiple Vercel Projects to the same Supabase project.+`}+ note={`+Your Vercel connection has access to 7 Vercel Projects.+You can change the scope of the access for Supabase by configuring here.+`}integrations={vercelIntegrations}/>- </div>+ <ScaffoldDivider />+ <Integration+ title="GitHub"+ orgName={org?.name}+ detail={`+## GitHub Connections++Conect any of your GitHub repositories to a project.+`}+ description={`+### How do GitHub connections work?++Supabase will keep the right environment variables up to date in each of the projects you assign to a Supabase project.+You can also link multiple Vercel Projects to the same Supabase project.+`}+ note={`+Your Vercel connection has access to 7 Vercel Projects.+You can change the scope of the access for Supabase by configuring here.+`}+ integrations={githubIntegrations}+ />+ <GitHubRepoSelection />+ </>)}diff --git a/studio/components/layouts/OrganizationLayout.tsx b/studio/components/layouts/OrganizationLayout.tsxindex 7eac56171f3..35d35debe4f 100644--- a/studio/components/layouts/OrganizationLayout.tsx+++ b/studio/components/layouts/OrganizationLayout.tsx@@ -5,6 +5,7 @@ import { useRouter } from 'next/router'import { PropsWithChildren } from 'react'import { Tabs } from 'ui'import { AccountLayout } from './'+import { ScaffoldContainer, ScaffoldDivider, ScaffoldHeader, ScaffoldTitle } from './Scaffold'const OrganizationLayout = ({ children }: PropsWithChildren<{}>) => {const { ui } = useStore()@@ -17,14 +18,14 @@ const OrganizationLayout = ({ children }: PropsWithChildren<{}>) => {title={ui.selectedOrganization?.name ?? 'Supabase'}breadcrumbs={[{ key: `org-settings`, label: 'Settings' }]}>- <div className="mx-auto flex flex-col px-5 pt-6 pb-14 lg:pt-8 lg:px-14 1xl:px-28 2xl:px-32">- <div className="space-y-3">- <section className="mt-4">- <h1 className="text-3xl">{ui.selectedOrganization?.name ?? 'Organization'} settings</h1>- </section>-+ <ScaffoldHeader>+ <ScaffoldContainer>+ <ScaffoldTitle>{ui.selectedOrganization?.name ?? 'Organization'} settings</ScaffoldTitle>+ </ScaffoldContainer>+ <ScaffoldContainer><nav><Tabs+ listClassNames="border-none"size="small"type="underlined"activeId={id}@@ -32,17 +33,17 @@ const OrganizationLayout = ({ children }: PropsWithChildren<{}>) => {router.push(`/org/${slug}/${id}`)}}>- <Tabs.Panel id="general" label="General" />- <Tabs.Panel id="team" label="Team" />- <Tabs.Panel id="integrations" label="Integrations" />- <Tabs.Panel id="billing" label="Billing" />- <Tabs.Panel id="invoices" label="Invoices" />+ <Tabs.Panel id="general" label="General" className="!my-0" />+ <Tabs.Panel id="team" label="Team" className="!my-0" />+ <Tabs.Panel id="integrations" label="Integrations" className="!my-0" />+ <Tabs.Panel id="billing" label="Billing" className="!my-0" />+ <Tabs.Panel id="invoices" label="Invoices" className="!my-0" /></Tabs></nav>- </div>-- <div className="mb-8">{children}</div>- </div>+ </ScaffoldContainer>+ </ScaffoldHeader>+ <ScaffoldDivider />+ {children}</AccountLayout>)}diff --git a/studio/components/layouts/Scaffold.tsx b/studio/components/layouts/Scaffold.tsxnew file mode 100644index 00000000000..e69a4a44cd0--- /dev/null+++ b/studio/components/layouts/Scaffold.tsx@@ -0,0 +1,84 @@+import React from 'react'+import { cn } from 'ui/src/utils/cn'++const maxWdithClasses = 'mx-auto w-full max-w-[1600px]'+const paddingClasses = 'px-6 lg:px-14 xl:px-28 2xl:px-32'++// lg: pt - 8++const ScaffoldHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(+ ({ className, ...props }, ref) => {+ return (+ <header {...props} ref={ref} className={cn('w-full', 'flex-col gap-3', className)}></header>+ )+ }+)++const ScaffoldTitle = React.forwardRef<+ HTMLHeadingElement,+ React.HTMLAttributes<HTMLHeadingElement>+>(({ className, ...props }, ref) => {+ return <h1 ref={ref} {...props} className={cn('text-3xl pt-6 pb-4', className)} />+})++const ScaffoldContainer = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(+ ({ className, ...props }, ref) => {+ return <div ref={ref} {...props} className={cn(maxWdithClasses, paddingClasses, className)} />+ }+)++const ScaffoldDivider = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(+ ({ className, ...props }, ref) => {+ return <div ref={ref} {...props} className={cn('w-full h-px bg-scale-400', className)} />+ }+)++const ScaffoldSection = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(+ ({ className, ...props }, ref) => {+ return (+ <div+ ref={ref}+ {...props}+ className={cn('flex flex-col gap-3 py-6', 'lg:grid md:grid-cols-12 lg:py-12', className)}+ />+ )+ }+)++const ScaffoldSectionDetail = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => {+ return <div ref={ref} {...props} className={cn('col-span-4 xl:col-span-5', className)} />+})++const ScaffoldSectionContent = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => {+ return (+ <div+ ref={ref}+ {...props}+ className={cn('col-span-8 xl:col-span-7', 'flex flex-col gap-6', className)}+ />+ )+})++ScaffoldHeader.displayName = 'ScaffoldHeader'+ScaffoldTitle.displayName = 'ScaffoldTitle'+ScaffoldContainer.displayName = 'ScaffoldContainer'+ScaffoldDivider.displayName = 'ScaffoldDivider'+ScaffoldSection.displayName = 'ScaffoldSection'+ScaffoldSectionDetail.displayName = 'ScaffoldSectionDetail'+ScaffoldSectionContent.displayName = 'ScaffoldSectionContent'++export {+ ScaffoldHeader,+ ScaffoldTitle,+ ScaffoldContainer,+ ScaffoldDivider,+ ScaffoldSection,+ ScaffoldSectionDetail,+ ScaffoldSectionContent,+}diff --git a/studio/data/integrations/integrations-query.ts b/studio/data/integrations/integrations-query.tsindex a15a6c0d55d..bb3e7e91015 100644--- a/studio/data/integrations/integrations-query.ts+++ b/studio/data/integrations/integrations-query.ts@@ -24,6 +24,10 @@ export type Integration = {createdBy: stringcreatedAt: stringconnections: IntegrationProjectConnection[]+ metadata?: {+ vercelTeam?: string+ gitHubConnectionOwner?: string+ }}export type IntegrationsResponse = Integration[]@@ -37,17 +41,71 @@ export async function getIntegrations({ orgSlug }: IntegrationsVariables, signal{id: '1',type: 'VERCEL',- createdBy: 'Alaister',+ createdBy: '[email protected]',createdAt: '2023-06-05T06:56:25.565Z',+ metadata: {+ vercelTeam: 'alaister-team',+ },connections: [+ {+ id: '1.0',+ createdAt: '2023-06-05T01:56:25.565Z',+ to: {+ name: 'www prod',+ },+ from: {+ name: 'alaister project prod',+ },+ },{id: '1.1',- createdAt: '2023-06-05T06:56:25.565Z',+ createdAt: '2023-06-14T06:56:25.565Z',+ to: {+ name: 'www staging',+ },from: {- name: 'supabase-vercel',+ name: 'alaister project staging',},+ },+ {+ id: '1.1',+ createdAt: '2023-06-02T21:56:25.565Z',to: {- name: 'alaister',+ name: 'bees knees',+ },+ from: {+ name: 'jonny bee project',+ },+ },+ ],+ },+ {+ id: '1.5',+ type: 'VERCEL',+ createdBy: '[email protected]',+ createdAt: '2023-06-05T06:56:25.565Z',+ metadata: {+ vercelTeam: 'alaister-team',+ },+ connections: [],+ },+ {+ id: '2',+ type: 'GITHUB',+ createdBy: 'Alaister',+ createdAt: '2023-06-05T06:56:25.565Z',+ metadata: {+ gitHubConnectionOwner: 'alaister',+ },+ connections: [+ {+ id: '1.2',+ createdAt: '2023-06-05T06:56:25.565Z',+ to: {+ name: 'supabase/supabase',+ },+ from: {+ name: 'alaister project',},},],diff --git a/studio/public/img/integrations/covers/github-cover.png b/studio/public/img/integrations/covers/github-cover.pngnew file mode 100644index 00000000000..853f5322db5Binary files /dev/null and b/studio/public/img/integrations/covers/github-cover.png differdiff --git a/studio/public/img/integrations/covers/vercel-cover.png b/studio/public/img/integrations/covers/vercel-cover.pngnew file mode 100644index 00000000000..d2965eefdc6Binary files /dev/null and b/studio/public/img/integrations/covers/vercel-cover.png differdiff --git a/studio/stores/UiStore.ts b/studio/stores/UiStore.tsindex 0e7b35339f9..0780d0f475e 100644--- a/studio/stores/UiStore.ts+++ b/studio/stores/UiStore.ts@@ -11,11 +11,13 @@ export interface IUiStore {selectedOrganization?: Organizationnotification?: Notificationpermissions?: Permission[]+ showGitHubRepoSelectionPanel: booleanload: () => voidsetProjectRef: (ref?: string) => voidsetOrganizationSlug: (slug?: string) => voidsetNotification: (notification: Notification) => stringsetPermissions: (permissions?: Permission[]) => void+ setShowGitHubRepoSelectionPanel: (visible?: boolean) => void}export default class UiStore implements IUiStore {rootStore: IRootStore@@ -24,6 +26,7 @@ export default class UiStore implements IUiStore {selectedOrganizationSlug?: stringnotification?: Notificationpermissions?: Permission[] = []+ showGitHubRepoSelectionPanel: boolean = falseconstructor(rootStore: IRootStore) {this.rootStore = rootStore@@ -101,4 +104,8 @@ export default class UiStore implements IUiStore {setPermissions(permissions?: any) {this.permissions = permissions}++ setShowGitHubRepoSelectionPanel(visible: boolean) {+ this.showGitHubRepoSelectionPanel = visible+ }}