Skip to content

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

Add create org CTA for authorize route if no org found (#47760)

Joshen Lim644fe0821bed
diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx
index 26a0b03bd98..1789962add4 100644
--- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx
+++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Error.tsx
@@ -18,13 +18,11 @@ export function ApiAuthorizationErrorScreen({
<div className="flex flex-col gap-3 px-6 pb-6">
<Admonition
type="warning"
+ title="Retry the authorization request from the requesting app."
description={
- <>
- Retry the authorization request from the requesting app.
- {error && (
- <span className="mt-1 block text-foreground-lighter">Error: {error.message}</span>
- )}
- </>
+ error && (
+ <span className="mt-1 block text-foreground-lighter">Error: {error.message}</span>
+ )
}
/>
<Button variant="default" block asChild>
diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx
index 047cc72cf01..79ce50981dd 100644
--- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx
+++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Form.tsx
@@ -1,4 +1,5 @@
import dayjs from 'dayjs'
+import Link from 'next/link'
import { type ReactNode } from 'react'
import type { UseFormReturn } from 'react-hook-form'
import {
@@ -194,6 +195,12 @@ function OrganizationsEmptyState(): ReactNode {
type="warning"
title="No organizations found"
description="Create an organization before authorizing this request."
+ actions={[
+ // [Joshen] JFYI this is a short term solution to guide users with creating an org from here
+ <Button asChild key="new-org" variant="default">
+ <Link href="/new">Create an organization</Link>
+ </Button>,
+ ]}
/>
)
}
diff --git a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Invalid.tsx b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Invalid.tsx
index df6e42f282e..66c2f0c7c51 100644
--- a/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Invalid.tsx
+++ b/apps/studio/components/interfaces/ApiAuthorization/ApiAuthorization.Invalid.tsx
@@ -23,7 +23,8 @@ export function ApiAuthorizationInvalidScreen({
<div className="flex flex-col gap-3 px-6 pb-6">
<Admonition
type="warning"
- description={`Retry the authorization request from the requesting app. The URL is missing parameter${
+ title="Retry the authorization request from the requesting app. "
+ description={`The URL is missing parameter${
isPlural ? 's' : ''
}: ${missingParameters.join(', ')}.`}
/>