mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Problem - Token access confirmations use stilted copy. - The SSL prerequisite notice sits outside the Token access card, repeats “enabled”, and includes an unnecessary project reference. - SSL configuration also shows enforcement as off when the latest update failed, and its dependency tooltip needs clearer guidance. ## Solution - Rewrite the token access and SSL confirmations, keeping the connection warnings. - Group prerequisite notices inside the Token access card with one divider, remove the project reference, and simplify their descriptions. - Keep the SSL switch tied to the fetched configuration independently of update success. - Explain the token access dependency in the disabled switch’s tooltip: “Database token access requires SSL enforcement.” Leave the existing SSL failure warning unchanged apart from its final full stop. | Before | After | | --- | --- | | <img width="727" height="501" alt="CleanShot 2026-12-03 at 11 21 35" src="https://github.com/user-attachments/assets/9fd18a91-528a-47dd-82e8-7349e26a8daa" /> | <img width="736" height="506" alt="CleanShot 2026-12-03 at 12 05 57" src="https://github.com/user-attachments/assets/8263303a-49d8-4910-9c88-e2fe5ecc1c34" /> | | <img width="362" height="236" alt="CleanShot 2026-12-03 at 11 21 54" src="https://github.com/user-attachments/assets/026852d4-9c1b-4a9d-9833-02e047794199" /> | <img width="421" height="229" alt="CleanShot 2026-12-03 at 12 06 24" src="https://github.com/user-attachments/assets/9a53c459-c7ca-4c18-8567-499d67a9c068" /> | | <img width="420" height="206" alt="CleanShot 2026-12-03 at 11 22 36" src="https://github.com/user-attachments/assets/4d2f8711-fd75-4730-832f-ac9e2e3d85ad" /> | <img width="420" height="207" alt="CleanShot 2026-12-03 at 11 52 51" src="https://github.com/user-attachments/assets/2fce238e-c8d7-4087-8402-05c2122f92f0" /> | | <img width="420" height="208" alt="CleanShot 2026-12-03 at 11 32 11" src="https://github.com/user-attachments/assets/f081e782-0a6c-499a-947d-0da149311218" /> | <img width="417" height="219" alt="CleanShot 2026-12-03 at 11 52 05" src="https://github.com/user-attachments/assets/6b6cfcf5-2c54-4f38-9b16-bcc0cdd500a0" /> | | <img width="809" height="255" alt="CleanShot 2026-12-03 at 12 28 47" src="https://github.com/user-attachments/assets/19cffa41-691f-4f60-96b5-7ba1ebcfb78e" /> | <img width="804" height="246" alt="CleanShot 2026-12-03 at 12 44 39" src="https://github.com/user-attachments/assets/2c3f2b74-21a8-41e7-b25e-ea2293350fcc" /> | ## Review instructions 1. Open Project → Database → Settings in the preview for a project that requires SSL enforcement before token access. 2. Check that SSL enforcement required sits inside Token access, separated by one divider, with no project reference in its description. 3. Select Enable SSL enforcement and review the confirmation copy. Cancel without applying the change. 4. On a project where token access is available, toggle it on and off to review both confirmations. Cancel each dialog. 5. With token access on, check that SSL enforcement stays on and locked, with a tooltip explaining that database token access requires SSL enforcement. Check that the tooltip also opens on keyboard focus. 6. If the API reports an unsuccessful SSL update, check that the switch still reflects `currentConfig.database` and the existing warning remains visible.
522 lines
19 KiB
TypeScript
522 lines
19 KiB
TypeScript
import { SupportCategories } from '@supabase/shared-types/out/constants'
|
||
import { useParams } from 'common'
|
||
import { Loader2Icon } from 'lucide-react'
|
||
import { parseAsBoolean, parseAsString, useQueryState } from 'nuqs'
|
||
import { useEffect, useMemo, useState } from 'react'
|
||
import { toast } from 'sonner'
|
||
import { Button, Card, CardContent, Switch } from 'ui'
|
||
import { Admonition } from 'ui-patterns/Admonition'
|
||
|
||
import type { JitUserRule, SheetMode } from './JitDbAccess.types'
|
||
import {
|
||
getAssignableJitRoleOptions,
|
||
getJitMemberOptions,
|
||
mapJitMembersToUserRules,
|
||
} from './JitDbAccess.utils'
|
||
import { JitDbAccessApps } from './JitDbAccessApps'
|
||
import { JitDbAccessDeleteDialog } from './JitDbAccessDeleteDialog'
|
||
import { JitDbAccessRuleSheet } from './JitDbAccessRuleSheet'
|
||
import { JitDbAccessRulesTable } from './JitDbAccessRulesTable'
|
||
import { JitDbAccessToggleDialog } from './JitDbAccessToggleDialog'
|
||
import { useAuthorizedAppsReview } from './useAuthorizedAppsReview'
|
||
import { SSLEnforcementConfirmDialog } from '@/components/interfaces/Settings/Database/SSLEnforcementConfirmDialog'
|
||
import { getServiceVersionsPath } from '@/components/interfaces/Settings/General/ServiceVersions/ServiceVersions.utils'
|
||
import { SupportLink } from '@/components/interfaces/Support/SupportLink'
|
||
import { AlertError } from '@/components/ui/AlertError'
|
||
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
|
||
import { DynamicLink } from '@/components/ui/DynamicLink'
|
||
import { InlineLink, InlineLinkClassName } from '@/components/ui/InlineLink'
|
||
import { useDatabaseRolesQuery } from '@/data/database-roles/database-roles-query'
|
||
import { useJitDbAccessMembersQuery } from '@/data/jit-db-access/jit-db-access-members-query'
|
||
import { useJitDbAccessQuery } from '@/data/jit-db-access/jit-db-access-query'
|
||
import { useJitDbAccessRevokeMutation } from '@/data/jit-db-access/jit-db-access-revoke-mutation'
|
||
import { useJitDbAccessUpdateMutation } from '@/data/jit-db-access/jit-db-access-update-mutation'
|
||
import { useOrganizationMembersQuery } from '@/data/organizations/organization-members-query'
|
||
import { useProjectMembersQuery } from '@/data/projects/project-members-query'
|
||
import { useSSLEnforcementUpdateMutation } from '@/data/ssl-enforcement/ssl-enforcement-update-mutation'
|
||
import { FGA_PERMISSIONS, useAsyncCheckPermissionsV2 } from '@/hooks/misc/useCheckPermissionsV2'
|
||
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
|
||
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
|
||
import { DOCS_URL, IS_PLATFORM } from '@/lib/constants'
|
||
|
||
export const JitDbAccessConfiguration = () => {
|
||
const { ref } = useParams()
|
||
const { data: project } = useSelectedProjectQuery()
|
||
const { data: organization } = useSelectedOrganizationQuery()
|
||
const parentProjectRef = project?.parent_project_ref
|
||
|
||
const {
|
||
apps,
|
||
error: appsError,
|
||
isError: isErrorApps,
|
||
canReadApps,
|
||
isCheckingApps,
|
||
} = useAuthorizedAppsReview({
|
||
slug: organization?.slug,
|
||
projectRef: ref,
|
||
parentProjectRef,
|
||
})
|
||
|
||
const [enabled, setEnabled] = useState(false)
|
||
const [, setShowCreateRuleSheet] = useQueryState('jit_new', parseAsBoolean.withDefault(false))
|
||
const [ruleIdToEdit, setRuleIdToEdit] = useQueryState('jit_edit', parseAsString)
|
||
const [pendingJitEnabled, setPendingJitEnabled] = useState<boolean | null>(null)
|
||
const [toggleJitError, setToggleJitError] = useState<string | null>(null)
|
||
const [selectedUserToDelete, setSelectedUserToDelete] = useState<JitUserRule | null>(null)
|
||
const [deleteRuleError, setDeleteRuleError] = useState<string | null>(null)
|
||
|
||
const { can: canUpdateSSLEnforcement } = useAsyncCheckPermissionsV2(
|
||
FGA_PERMISSIONS.PROJECT.DATABASE_SSL_CONFIG_WRITE
|
||
)
|
||
|
||
const { can: canUpdateJitDbAccess } = useAsyncCheckPermissionsV2(
|
||
FGA_PERMISSIONS.PROJECT.DATABASE_JIT_WRITE
|
||
)
|
||
|
||
const {
|
||
data: jitDbAccessConfiguration,
|
||
error: jitDbAccessConfigurationError,
|
||
isError: isErrorJitDbAccessConfiguration,
|
||
isLoading: isLoadingConfiguration,
|
||
isSuccess: isSuccessConfiguration,
|
||
} = useJitDbAccessQuery({ projectRef: ref }, { enabled: canUpdateJitDbAccess })
|
||
|
||
const {
|
||
data: jitMembers,
|
||
error: jitMembersError,
|
||
isError: isErrorJitMembers,
|
||
isLoading: isLoadingJitMembers,
|
||
} = useJitDbAccessMembersQuery({ projectRef: ref }, { enabled: canUpdateJitDbAccess })
|
||
|
||
const { data: projectMembers, isLoading: isLoadingProjectMembers } = useProjectMembersQuery({
|
||
projectRef: ref,
|
||
})
|
||
|
||
const { data: organizationMembers, isLoading: isLoadingOrganizationMembers } =
|
||
useOrganizationMembersQuery({ slug: organization?.slug })
|
||
|
||
const { data: databaseRoles, isLoading: isLoadingDatabaseRoles } = useDatabaseRolesQuery({
|
||
projectRef: ref,
|
||
connectionString: project?.connectionString,
|
||
})
|
||
|
||
const { mutateAsync: updateJitDbAccess, isPending: isUpdatingJitDbAccess } =
|
||
useJitDbAccessUpdateMutation({
|
||
onSuccess: (_, variables) => {
|
||
const nextEnabled = variables.requestedConfig.state === 'enabled'
|
||
|
||
if (nextEnabled) {
|
||
toast.success('Database token access enabled')
|
||
} else {
|
||
toast.success(
|
||
activeRuleCount > 0
|
||
? `Database token access disabled. ${activeRuleCount} member${activeRuleCount === 1 ? '' : 's'} with existing rules can no longer connect to this database using access tokens.`
|
||
: 'Database token access disabled'
|
||
)
|
||
}
|
||
},
|
||
onError: () => {},
|
||
})
|
||
|
||
const { mutateAsync: enableSSLEnforcement, isPending: isEnablingSSLEnforcement } =
|
||
useSSLEnforcementUpdateMutation({
|
||
onSuccess: () => {
|
||
toast.success('Successfully enabled SSL enforcement')
|
||
},
|
||
onError: (error) => {
|
||
toast.error(`Failed to enable SSL enforcement: ${error.message}`)
|
||
},
|
||
})
|
||
|
||
const handleEnableSSLEnforcement = async () => {
|
||
if (!ref) return console.error('Project ref is required')
|
||
await enableSSLEnforcement({ projectRef: ref, requestedConfig: { database: true } })
|
||
}
|
||
|
||
const { mutateAsync: revokeUserAccess, isPending: isRevokingAccess } =
|
||
useJitDbAccessRevokeMutation({
|
||
onSuccess: (_, variables) => {
|
||
toast.success('Member access rule deleted')
|
||
setSelectedUserToDelete(null)
|
||
if (ruleIdToEdit === variables.userId) resetSheetState()
|
||
},
|
||
onError: () => {},
|
||
})
|
||
|
||
const isMutating = isUpdatingJitDbAccess || isRevokingAccess
|
||
const disableRuleActions = isMutating || isLoadingDatabaseRoles || isLoadingOrganizationMembers
|
||
const isRulesLoading = isLoadingJitMembers || isLoadingProjectMembers
|
||
|
||
const initialIsEnabled =
|
||
jitDbAccessConfiguration?.state === 'enabled'
|
||
? jitDbAccessConfiguration?.appliedSuccessfully
|
||
: false
|
||
const isJitDbAccessUnavailable = jitDbAccessConfiguration?.state === 'unavailable'
|
||
const unavailableReason = isJitDbAccessUnavailable
|
||
? jitDbAccessConfiguration.unavailableReason
|
||
: undefined
|
||
|
||
const roleOptions = useMemo(() => getAssignableJitRoleOptions(databaseRoles), [databaseRoles])
|
||
|
||
const users = useMemo(
|
||
() => mapJitMembersToUserRules(jitMembers, projectMembers, roleOptions),
|
||
[jitMembers, projectMembers, roleOptions]
|
||
)
|
||
|
||
const allMembers = useMemo(
|
||
() => getJitMemberOptions(organizationMembers, projectMembers),
|
||
[organizationMembers, projectMembers]
|
||
)
|
||
|
||
const editingUser = useMemo(
|
||
() => users.find((user) => user.id === ruleIdToEdit) ?? null,
|
||
[users, ruleIdToEdit]
|
||
)
|
||
|
||
const sheetMode: SheetMode = ruleIdToEdit ? 'edit' : 'add'
|
||
|
||
const membersWithRules = useMemo(() => new Set(users.map((user) => user.memberId)), [users])
|
||
|
||
const availableMembersForAdd = useMemo(
|
||
() => allMembers.filter((member) => !membersWithRules.has(member.id)),
|
||
[allMembers, membersWithRules]
|
||
)
|
||
|
||
const memberOptionsForSheet = useMemo(() => {
|
||
if (sheetMode !== 'edit') return availableMembersForAdd
|
||
if (!editingUser) return allMembers
|
||
|
||
if (allMembers.some((member) => member.id === editingUser.memberId)) return allMembers
|
||
|
||
return [
|
||
{
|
||
id: editingUser.memberId,
|
||
email: editingUser.email,
|
||
name: editingUser.name,
|
||
},
|
||
...allMembers,
|
||
]
|
||
}, [sheetMode, availableMembersForAdd, allMembers, editingUser])
|
||
|
||
const activeUsers = users.filter((user) => user.status.active > 0)
|
||
const activeRuleCount = activeUsers.length
|
||
|
||
const resetSheetState = () => {
|
||
setShowCreateRuleSheet(false)
|
||
setRuleIdToEdit(null)
|
||
}
|
||
|
||
const getErrorMessage = (error: unknown) =>
|
||
error instanceof Error ? error.message : 'An unknown error occurred'
|
||
|
||
const submitJitToggle = async (nextEnabled: boolean) => {
|
||
if (!ref) throw new Error('Project ref is required')
|
||
|
||
setEnabled(nextEnabled)
|
||
|
||
try {
|
||
await updateJitDbAccess({
|
||
projectRef: ref,
|
||
requestedConfig: { state: nextEnabled ? 'enabled' : 'disabled' },
|
||
})
|
||
} catch (error) {
|
||
setEnabled(initialIsEnabled ?? false)
|
||
throw error
|
||
}
|
||
}
|
||
|
||
const handleJitToggleChange = (checked: boolean) => {
|
||
if (isJitDbAccessUnavailable || !canUpdateJitDbAccess || isCheckingApps) return
|
||
setToggleJitError(null)
|
||
setPendingJitEnabled(checked)
|
||
}
|
||
|
||
const handleConfirmJitToggle = async () => {
|
||
if (pendingJitEnabled === null) return
|
||
if (isCheckingApps) throw new Error('Wait until authorized app access has been checked.')
|
||
setToggleJitError(null)
|
||
|
||
try {
|
||
await submitJitToggle(pendingJitEnabled)
|
||
} catch (error) {
|
||
setToggleJitError(getErrorMessage(error))
|
||
throw error
|
||
}
|
||
}
|
||
|
||
const openAddRuleSheet = () => {
|
||
if (!canUpdateJitDbAccess) return
|
||
setRuleIdToEdit(null)
|
||
setShowCreateRuleSheet(true)
|
||
}
|
||
|
||
const openEditRuleSheet = (user: JitUserRule) => {
|
||
if (!canUpdateJitDbAccess) return
|
||
setShowCreateRuleSheet(false)
|
||
setRuleIdToEdit(user.id)
|
||
}
|
||
|
||
const openDeleteDialog = (user: JitUserRule) => {
|
||
if (!canUpdateJitDbAccess) return
|
||
setDeleteRuleError(null)
|
||
setSelectedUserToDelete(user)
|
||
}
|
||
|
||
const handleConfirmDelete = async () => {
|
||
setDeleteRuleError(null)
|
||
|
||
try {
|
||
if (!ref) throw new Error('Project ref is required')
|
||
if (!selectedUserToDelete) throw new Error('User is required')
|
||
|
||
await revokeUserAccess({ projectRef: ref, userId: selectedUserToDelete.memberId })
|
||
} catch (error) {
|
||
setDeleteRuleError(getErrorMessage(error))
|
||
throw error
|
||
}
|
||
}
|
||
|
||
const switchDisabled =
|
||
isLoadingConfiguration ||
|
||
isRulesLoading ||
|
||
isUpdatingJitDbAccess ||
|
||
isErrorJitMembers ||
|
||
isCheckingApps ||
|
||
!canUpdateJitDbAccess
|
||
const showTokenAccessSwitch =
|
||
!parentProjectRef &&
|
||
!isErrorJitDbAccessConfiguration &&
|
||
!isJitDbAccessUnavailable &&
|
||
canUpdateJitDbAccess
|
||
|
||
const showToggleFailedWarning =
|
||
isSuccessConfiguration &&
|
||
jitDbAccessConfiguration?.state !== 'unavailable' &&
|
||
!jitDbAccessConfiguration.appliedSuccessfully
|
||
|
||
const getUnavailableNotice = () => {
|
||
if (unavailableReason === 'postgres_upgrade_required') {
|
||
return {
|
||
title: 'Postgres upgrade required',
|
||
description: 'Upgrade to Postgres 17 or later to use token access.',
|
||
}
|
||
}
|
||
if (unavailableReason === 'ssl_enforcement_required') {
|
||
return {
|
||
title: 'SSL enforcement required',
|
||
description:
|
||
'Token access requires SSL enforcement so that database connections are encrypted.',
|
||
}
|
||
}
|
||
return {
|
||
title: 'Database token access unavailable',
|
||
description:
|
||
'This feature is currently unavailable for this project. Contact support if you need help enabling it.',
|
||
}
|
||
}
|
||
const unavailableNotice = getUnavailableNotice()
|
||
|
||
useEffect(() => {
|
||
if (!isLoadingConfiguration && jitDbAccessConfiguration) {
|
||
setEnabled(initialIsEnabled ?? false)
|
||
}
|
||
}, [initialIsEnabled, isLoadingConfiguration, jitDbAccessConfiguration])
|
||
|
||
return (
|
||
<>
|
||
<div id="jit-db-access-configuration" className="space-y-4">
|
||
<Card>
|
||
<CardContent className="flex items-center justify-between gap-2">
|
||
<div className="space-y-0.5">
|
||
<h3 id="token-access-title" className="text-sm text-foreground">
|
||
Token access
|
||
</h3>
|
||
<p id="token-access-description" className="text-sm text-foreground-lighter">
|
||
Allow members and approved apps to connect using{' '}
|
||
<InlineLink href={`${DOCS_URL}/guides/platform/token-access`}>
|
||
access tokens
|
||
</InlineLink>
|
||
.
|
||
</p>
|
||
</div>
|
||
{showTokenAccessSwitch && (
|
||
<div className="flex w-fit shrink-0 items-center justify-end gap-2">
|
||
{(isLoadingConfiguration || isUpdatingJitDbAccess) && (
|
||
<Loader2Icon
|
||
className="animate-spin text-foreground-muted/50"
|
||
strokeWidth={2}
|
||
size={16}
|
||
/>
|
||
)}
|
||
<Switch
|
||
aria-labelledby="token-access-title"
|
||
aria-describedby="token-access-description"
|
||
aria-busy={isLoadingConfiguration || isRulesLoading || isCheckingApps}
|
||
size="large"
|
||
checked={enabled}
|
||
onCheckedChange={handleJitToggleChange}
|
||
disabled={switchDisabled}
|
||
/>
|
||
</div>
|
||
)}
|
||
</CardContent>
|
||
{showTokenAccessSwitch && showToggleFailedWarning && (
|
||
<Admonition
|
||
type="warning"
|
||
layout="horizontal"
|
||
title="Database token access update didn’t apply"
|
||
description={
|
||
<>
|
||
The change didn’t apply. Try enabling or disabling database token access again, or{' '}
|
||
<SupportLink
|
||
queryParams={{
|
||
category: SupportCategories.DASHBOARD_BUG,
|
||
subject: 'Database token access update didn’t apply',
|
||
}}
|
||
className={InlineLinkClassName}
|
||
>
|
||
contact support
|
||
</SupportLink>{' '}
|
||
if the issue persists.
|
||
</>
|
||
}
|
||
className="mb-0 rounded-none border-0"
|
||
/>
|
||
)}
|
||
{!parentProjectRef && !isJitDbAccessUnavailable && isErrorJitMembers && (
|
||
<AlertError
|
||
projectRef={ref}
|
||
subject="Failed to load member access rules"
|
||
error={jitMembersError}
|
||
className="rounded-none border-x-0 border-t-0"
|
||
/>
|
||
)}
|
||
|
||
{!parentProjectRef && enabled && !isJitDbAccessUnavailable && !isUpdatingJitDbAccess && (
|
||
<JitDbAccessRulesTable
|
||
users={users}
|
||
isLoading={isRulesLoading}
|
||
canUpdate={!!canUpdateJitDbAccess}
|
||
disableActions={disableRuleActions}
|
||
allProjectMembersHaveRules={availableMembersForAdd.length === 0}
|
||
onAddRule={openAddRuleSheet}
|
||
onEditRule={openEditRuleSheet}
|
||
onDeleteRule={openDeleteDialog}
|
||
/>
|
||
)}
|
||
{IS_PLATFORM && !parentProjectRef && !isJitDbAccessUnavailable && enabled && (
|
||
<JitDbAccessApps
|
||
apps={apps}
|
||
organizationSlug={organization?.slug}
|
||
isPending={isCheckingApps && !isErrorApps}
|
||
canRead={canReadApps}
|
||
error={appsError}
|
||
/>
|
||
)}
|
||
{!parentProjectRef && !isErrorJitDbAccessConfiguration && isJitDbAccessUnavailable && (
|
||
<Admonition
|
||
type="note"
|
||
layout="responsive"
|
||
title={unavailableNotice.title}
|
||
description={unavailableNotice.description}
|
||
className="mb-0 rounded-none border-0"
|
||
actions={
|
||
unavailableReason === 'postgres_upgrade_required' && ref ? (
|
||
<Button asChild>
|
||
<DynamicLink href={getServiceVersionsPath(ref)}>Upgrade Postgres</DynamicLink>
|
||
</Button>
|
||
) : unavailableReason === 'ssl_enforcement_required' && ref ? (
|
||
<SSLEnforcementConfirmDialog
|
||
isSubmitting={isEnablingSSLEnforcement}
|
||
onConfirm={handleEnableSSLEnforcement}
|
||
>
|
||
<ButtonTooltip
|
||
disabled={!canUpdateSSLEnforcement}
|
||
loading={isEnablingSSLEnforcement}
|
||
tooltip={{
|
||
content: {
|
||
side: 'bottom',
|
||
text: 'You need additional permissions to enable SSL enforcement',
|
||
},
|
||
}}
|
||
>
|
||
Enable SSL enforcement
|
||
</ButtonTooltip>
|
||
</SSLEnforcementConfirmDialog>
|
||
) : (
|
||
<Button asChild>
|
||
<SupportLink
|
||
queryParams={{
|
||
category: SupportCategories.PROBLEM,
|
||
projectRef: ref,
|
||
subject: unavailableNotice.title,
|
||
}}
|
||
>
|
||
Contact support
|
||
</SupportLink>
|
||
</Button>
|
||
)
|
||
}
|
||
/>
|
||
)}
|
||
</Card>
|
||
|
||
{parentProjectRef && (
|
||
<Admonition
|
||
type="note"
|
||
title="Managed in the main branch"
|
||
description={
|
||
<>
|
||
Member access rules are configured in the main branch and apply across all preview
|
||
branches. Return to the{' '}
|
||
<InlineLink href={`/project/${parentProjectRef}/settings/database`}>
|
||
main branch
|
||
</InlineLink>{' '}
|
||
to manage member access rules.
|
||
</>
|
||
}
|
||
/>
|
||
)}
|
||
|
||
{!parentProjectRef && isErrorJitDbAccessConfiguration && (
|
||
<AlertError
|
||
projectRef={ref}
|
||
subject="Failed to load database token access"
|
||
error={jitDbAccessConfigurationError as { message: string } | null}
|
||
showInstructions={false}
|
||
/>
|
||
)}
|
||
</div>
|
||
|
||
<JitDbAccessRuleSheet
|
||
memberOptions={memberOptionsForSheet}
|
||
membersWithRules={membersWithRules}
|
||
availableMembersForAddCount={availableMembersForAdd.length}
|
||
/>
|
||
|
||
<JitDbAccessDeleteDialog
|
||
user={selectedUserToDelete}
|
||
isDeleting={isRevokingAccess}
|
||
error={deleteRuleError}
|
||
onClose={() => {
|
||
setDeleteRuleError(null)
|
||
setSelectedUserToDelete(null)
|
||
}}
|
||
onConfirm={handleConfirmDelete}
|
||
/>
|
||
|
||
<JitDbAccessToggleDialog
|
||
nextEnabled={pendingJitEnabled}
|
||
users={activeUsers}
|
||
apps={apps}
|
||
canConfirm={!isCheckingApps}
|
||
canListApps={canReadApps && !isErrorApps}
|
||
isSubmitting={isUpdatingJitDbAccess}
|
||
error={toggleJitError}
|
||
onClose={() => setPendingJitEnabled(null)}
|
||
onConfirm={handleConfirmJitToggle}
|
||
/>
|
||
</>
|
||
)
|
||
}
|