diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.test.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.test.tsx index d457a95b4fe..8270b7061ce 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.test.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.test.tsx @@ -19,20 +19,14 @@ describe('OAuthAppsAuthorizeScreen', () => { expect(screen.getByText('Must select at least one project to authorize.')).toBeInTheDocument() }) - test('shows the over-role warning only for the read-only fixture', async () => { - const { unmount } = customRender( - - ) + test('shows no upfront over-role warning, even for the read-only fixture', async () => { + customRender() + await screen.findByText('Permissions requested') expect( screen.queryByText('Some requested permissions exceed your role') ).not.toBeInTheDocument() - unmount() - - customRender() - expect( - await screen.findByText('Some requested permissions exceed your role') - ).toBeInTheDocument() + expect(screen.queryByText('Read-only for your role')).not.toBeInTheDocument() }) test('renders the empty-org notice, hides permissions, and shows the cancel footer', async () => { diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.tsx index 17e75dfd624..e09c8bd1923 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/Consent/OAuthAppsAuthorizeScreen.tsx @@ -1,12 +1,11 @@ import { BadgeCheck } from 'lucide-react' -import { useMemo, useState } from 'react' +import { useState } from 'react' import { Button } from 'ui' import { Admonition } from 'ui-patterns/Admonition' import { AuthorizingAsCard } from './AuthorizingAsCard' import { NoProjectsNotice } from './NoProjectsNotice' import { EMPTY_ORG_MOCK_SLUG, getMockScenarioId } from './OAuthAppsAuthorizeScreen.utils' -import { isScopeGroupOverRole } from './OverRoleAnnotation.utils' import { ProjectMultiSelect } from './ProjectMultiSelect' import { ScopeGroupCard } from './ScopeGroupCard' import { @@ -70,14 +69,6 @@ export const OAuthAppsAuthorizeScreen = ({ const isSubmitting = approveMutation.isPending const hasProjects = (projects?.length ?? 0) > 0 - const overRoleGroups = useMemo( - () => - (request?.scope_groups ?? []).filter((group) => - isScopeGroupOverRole(group.level, memberOrg?.role ?? '') - ), - [request?.scope_groups, memberOrg?.role] - ) - if (!request || !identity || !orgSlug || !memberOrg) return null const handleSignOut = async () => { @@ -172,19 +163,7 @@ export const OAuthAppsAuthorizeScreen = ({ {hasProjects && ( <> - - - {overRoleGroups.length > 0 && ( - - )} +