Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

build errors

Jonathan Summers-Muird75e945b8916
diff --git a/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx b/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx
index a3839628f1c..b5d7d410eb7 100644
--- a/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx
+++ b/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx
@@ -287,10 +287,10 @@ You can change the scope of the access for Supabase by configuring
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
defaultValues: {
- environmentVariablesProduction: config.environmentVariables?.production ?? false,
- environmentVariablesPreview: config.environmentVariables?.preview ?? false,
- authRedirectUrisProduction: config.authRedirectUris?.production ?? false,
- authRedirectUrisPreview: config.authRedirectUris?.preview ?? false,
+ environmentVariablesProduction: config?.environmentVariables?.production ?? false,
+ environmentVariablesPreview: config?.environmentVariables?.preview ?? false,
+ authRedirectUrisProduction: config?.authRedirectUris?.production ?? false,
+ authRedirectUrisPreview: config?.authRedirectUris?.preview ?? false,
},
})
@@ -305,7 +305,6 @@ You can change the scope of the access for Supabase by configuring
})
function onSubmit(data: z.infer<typeof FormSchema>) {
- console.log('submitting')
const metadata = {
...connection.metadata,
}
@@ -518,15 +517,6 @@ These connections will be part of a GitHub workflow that is currently in develop
integration={integration}
/>
</div>
- {/* <Alert_Shadcn_ className="!border-t-transparent rounded-t-none [&>svg]:left-8 !px-10">
- <AlertTitle_Shadcn_>
- Only 1 GitHub connection per project
- </AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_>
- Due to the nature of how GitHub connections work, only 1 connection
- can be made per project to avoid migration conflicts.
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_> */}
</div>
))}
</ul>
@@ -558,11 +548,6 @@ These connections will be part of a GitHub workflow that is currently in develop
const comboBoxRef = useRef<HTMLButtonElement>(null)
const projectContext = useProjectContext()
- console.log(
- 'connection.metadata.supabaseConfig?.supabaseDirectory',
- connection.metadata.supabaseConfig?.supabaseDirectory
- )
-
const githubProjectIntegration = integration?.connections.find(
(connection) => connection.supabase_project_ref === projectContext.project?.ref
)
@@ -615,12 +600,14 @@ These connections will be part of a GitHub workflow that is currently in develop
}
const FormSchema = z.object({
- supabaseDirectory: z.string().default(connection.metadata.supabaseConfig.supabaseDirectory),
+ supabaseDirectory: z
+ .string()
+ .default(connection.metadata?.supabaseConfig?.supabaseDirectory ?? ''),
})
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
defaultValues: {
- supabaseDirectory: connection.metadata.supabaseConfig.supabaseDirectory,
+ supabaseDirectory: connection?.metadata?.supabaseConfig?.supabaseDirectory,
},
})
@@ -642,8 +629,11 @@ These connections will be part of a GitHub workflow that is currently in develop
function onSubmit(data: z.infer<typeof FormSchema>) {
const metadata = {
...connection.metadata,
+ supabaseConfig: {
+ ...connection.metadata?.supabaseConfig,
+ supabaseDirectory: data.supabaseDirectory,
+ },
}
- metadata.supabaseConfig.supabaseDirectory = data.supabaseDirectory
updateGithubConnection({
id: connection.id,
diff --git a/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx b/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
index a25064e2241..e1aa1f34fc1 100644
--- a/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
+++ b/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
@@ -125,12 +125,8 @@ const EnableBranchingButton = () => {
selectedBranch={selectedBranch}
hasGithubIntegrationInstalled={hasGithubIntegrationInstalled}
setSelectedBranch={setSelectedBranch}
- onSelectConnectRepo={() => setAddConnectionType('GitHub')}
/>
-
{/* <VercelProjectSelection integration={vercelIntegration} /> */}
-
- {/* <Modal.Separator /> */}
</>
)}
@@ -183,12 +179,7 @@ const EnableBranchingButton = () => {
</Modal.Content>
</Modal>
- <SidePanelGitHubRepoLinker
- isOpen={addConnectionType === 'GitHub'}
- projectRef={ref}
- organizationIntegrationId={githubIntegration?.id}
- onClose={() => setAddConnectionType(undefined)}
- />
+ <SidePanelGitHubRepoLinker projectRef={ref} />
</>
)
}
diff --git a/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx b/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
index b966cb1d4e7..b18a2df1053 100644
--- a/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
+++ b/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
@@ -27,13 +27,13 @@ import AlertError from 'components/ui/AlertError'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { useGithubBranchesQuery } from 'data/integrations/integrations-github-branches-query'
import { Integration } from 'data/integrations/integrations.types'
+import { useSidePanelsStateSnapshot } from 'state/side-panels'
interface GithubRepositorySelectionProps {
integration?: Integration
selectedBranch?: string
hasGithubIntegrationInstalled: boolean
setSelectedBranch: (name: string) => void
- onSelectConnectRepo: () => void
}
const GithubRepositorySelection = ({
@@ -41,7 +41,6 @@ const GithubRepositorySelection = ({
selectedBranch,
hasGithubIntegrationInstalled,
setSelectedBranch,
- onSelectConnectRepo,
}: GithubRepositorySelectionProps) => {
const { ref } = useParams()
const [open, setOpen] = useState(false)
@@ -52,6 +51,8 @@ const GithubRepositorySelection = ({
)
const [repoOwner, repoName] = githubConnection?.metadata.name.split('/') ?? []
+ const sidePanels = useSidePanelsStateSnapshot()
+
const {
data: githubBranches,
error: githubBranchesError,
@@ -64,6 +65,13 @@ const GithubRepositorySelection = ({
repoName,
})
+ function onSelectConnectRepo() {
+ if (integration) {
+ sidePanels.setGithubConnectionsOpen(true)
+ sidePanels.setGithubConnectionsIntegrationId(integration.id)
+ }
+ }
+
return (
<div
className={clsx(
diff --git a/studio/data/integrations/github-connection-update-mutate.ts b/studio/data/integrations/github-connection-update-mutate.ts
index a6e02dade79..1db6d359638 100644
--- a/studio/data/integrations/github-connection-update-mutate.ts
+++ b/studio/data/integrations/github-connection-update-mutate.ts
@@ -3,20 +3,23 @@ import { toast } from 'react-hot-toast'
import { patch } from 'data/fetchers'
import { ResponseError } from 'types'
-import { UpdateConnection } from './integrations.types'
+import { UpdateConnectionPayload } from './integrations.types'
import { integrationKeys } from './keys'
export async function updateGithubConnection({
id,
metadata,
organizationIntegrationId,
-}: UpdateConnection) {
+}: UpdateConnectionPayload) {
const { data, error } = await patch('/platform/integrations/github/connections/{connection_id}', {
params: {
path: { connection_id: id },
},
body: {
- metadata,
+ // @ts-expect-error
+ metadata: {
+ ...metadata,
+ },
},
})
@@ -31,11 +34,11 @@ export const useGithubConnectionUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UpdateGithubConnectionData, ResponseError, UpdateConnection>,
+ UseMutationOptions<UpdateGithubConnectionData, ResponseError, UpdateConnectionPayload>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
- return useMutation<UpdateGithubConnectionData, ResponseError, UpdateConnection>(
+ return useMutation<UpdateGithubConnectionData, ResponseError, UpdateConnectionPayload>(
(vars) => updateGithubConnection(vars),
{
async onSuccess(data, variables, context) {
diff --git a/studio/data/integrations/integrations-vercel-connections-create-mutation.ts b/studio/data/integrations/integrations-vercel-connections-create-mutation.ts
index 9ea64f86836..d608951e715 100644
--- a/studio/data/integrations/integrations-vercel-connections-create-mutation.ts
+++ b/studio/data/integrations/integrations-vercel-connections-create-mutation.ts
@@ -4,7 +4,7 @@ import { toast } from 'react-hot-toast'
import { post } from 'data/fetchers'
import { ResponseError } from 'types'
import { integrationKeys } from './keys'
-import { IntegrationConnectionsCreateVariables } from './types'
+import { IntegrationConnectionsCreateVariables } from './integrations.types'
export async function createIntegrationVercelConnections({
organizationIntegrationId,
diff --git a/studio/data/integrations/integrations.types.ts b/studio/data/integrations/integrations.types.ts
index 404b9699658..d6f75557236 100644
--- a/studio/data/integrations/integrations.types.ts
+++ b/studio/data/integrations/integrations.types.ts
@@ -127,16 +127,16 @@ export type SupabaseConfigVercel = {
export type Imetadata = {
id: string
- supabaseConfig: {
- environmentVariables: {
+ supabaseConfig?: {
+ environmentVariables?: {
production: boolean
preview: boolean
}
- authRedirectUris: {
+ authRedirectUris?: {
production: boolean
preview: boolean
}
- supabaseDirectory: string
+ supabaseDirectory?: string
}
link?: VercelGitLink
name: string
@@ -250,7 +250,7 @@ export type IntegrationConnectionsCreateVariables = {
orgSlug: string | undefined
}
-export type UpdateConnection = {
+export type UpdateConnectionPayload = {
id: string
organizationIntegrationId: string
metadata: Imetadata
diff --git a/studio/data/integrations/vercel-connection-update-mutate.ts b/studio/data/integrations/vercel-connection-update-mutate.ts
index b8888eb7a76..92f134e38fb 100644
--- a/studio/data/integrations/vercel-connection-update-mutate.ts
+++ b/studio/data/integrations/vercel-connection-update-mutate.ts
@@ -3,19 +3,20 @@ import { toast } from 'react-hot-toast'
import { patch } from 'data/fetchers'
import { ResponseError } from 'types'
-import { UpdateConnection } from './integrations.types'
+import { UpdateConnectionPayload } from './integrations.types'
import { integrationKeys } from './keys'
export async function updateVercelConnection({
id,
metadata,
organizationIntegrationId,
-}: UpdateConnection) {
+}: UpdateConnectionPayload) {
const { data, error } = await patch('/platform/integrations/vercel/connections/{connection_id}', {
params: {
path: { connection_id: id },
},
body: {
+ // @ts-expect-error
metadata,
},
})
@@ -31,11 +32,11 @@ export const useVercelConnectionUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UpdateVercelConnectionData, ResponseError, UpdateConnection>,
+ UseMutationOptions<UpdateVercelConnectionData, ResponseError, UpdateConnectionPayload>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
- return useMutation<UpdateVercelConnectionData, ResponseError, UpdateConnection>(
+ return useMutation<UpdateVercelConnectionData, ResponseError, UpdateConnectionPayload>(
(vars) => updateVercelConnection(vars),
{
async onSuccess(data, variables, context) {