Skip to content

Commit b5a79f9

Browse files
Saerisjoshenlim
andauthored
Replace deprecated components on /authorize page (supabase#37965)
* replace deprecated components on `/authorize` route * Minor clean ups --------- Co-authored-by: Joshen Lim <[email protected]>
1 parent 4a96c4b commit b5a79f9

File tree

2 files changed

+189
-148
lines changed

2 files changed

+189
-148
lines changed

apps/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface AuthorizeRequesterDetailsProps {
88
name: string
99
domain: string
1010
scopes: OAuthScope[]
11+
showOnlyScopes?: boolean
1112
}
1213

1314
export const ScopeSection = ({
@@ -55,31 +56,43 @@ export const AuthorizeRequesterDetails = ({
5556
name,
5657
domain,
5758
scopes,
59+
showOnlyScopes = false,
5860
}: AuthorizeRequesterDetailsProps) => {
5961
return (
6062
<div className="flex gap-y-4 flex-col">
61-
<div className="flex flex-row gap-x-4 items-center">
62-
<div className="flex items-center">
63-
<div
64-
className="w-14 h-14 md:w-16 md:h-16 bg-center bg-no-repeat bg-cover flex items-center justify-center rounded-md border border-control"
65-
style={{
66-
backgroundImage: !!icon ? `url('${icon}')` : 'none',
67-
}}
68-
>
69-
{!icon && <p className="text-foreground-light text-lg">{name[0]}</p>}
63+
{!showOnlyScopes && (
64+
<div className="flex flex-row gap-x-4 items-center">
65+
<div className="flex items-center">
66+
<div
67+
className="w-12 h-12 md:w-14 md:h-14 bg-center bg-no-repeat bg-cover flex items-center justify-center rounded-md border border-control"
68+
style={{
69+
backgroundImage: !!icon ? `url('${icon}')` : 'none',
70+
}}
71+
>
72+
{!icon && <p className="text-foreground-light text-lg">{name[0]}</p>}
73+
</div>
7074
</div>
75+
<p className="text-foreground">
76+
{name} ({domain}) is requesting API access to an organization.
77+
</p>
7178
</div>
72-
<p className="text-foreground">
73-
{name} ({domain}) is requesting API access to an organization.
74-
</p>
75-
</div>
79+
)}
7680
<div>
77-
<h2>Permissions</h2>
78-
<p className="text-sm text-foreground-light">
79-
The following scopes will apply for the{' '}
80-
<span className="text-amber-900">selected organization and all of its projects.</span>
81-
</p>
81+
{!showOnlyScopes && (
82+
<>
83+
<h3>Permissions</h3>
84+
<p className="text-sm text-foreground-light">
85+
The following scopes will apply for the{' '}
86+
<span className="text-amber-900">selected organization and all of its projects.</span>
87+
</p>
88+
</>
89+
)}
8290
<div className="pt-2">
91+
{scopes.length === 0 && (
92+
<p className="text-foreground-lighter text-sm">
93+
No permissions requested, {name} will not have access to your organization or projects
94+
</p>
95+
)}
8396
<ScopeSection
8497
description={PERMISSIONS_DESCRIPTIONS.ANALYTICS}
8598
hasReadScope={scopes.includes(OAuthScope.ANALYTICS_READ)}

0 commit comments

Comments
 (0)