Skip to content

Commit f6af311

Browse files
committed
improvement(org): wire the member Integrations UI to real data
Replaces the member list, provider detail and tool permissions with the design system views, driven by the existing hooks through pure adapters. Providers get /integrations/[provider]; old ?integration= links redirect. Personal Generic Secrets keeps its editor, since the read-only view would lose editing. Moves the inventory to lib/credential-groups/member-integrations.ts, which narrower permission groups read unchanged.
1 parent 3019c8e commit f6af311

41 files changed

Lines changed: 2308 additions & 986 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { Metadata } from 'next'
2+
import { requireIntegrationsViewer } from '@/app/o/[organizationId]/integrations/access'
3+
import { OrganizationIntegrations } from '@/app/o/[organizationId]/integrations/integrations'
4+
import { integrationPath } from '@/platform/lib/integrations/model'
5+
6+
export const metadata: Metadata = {
7+
title: 'Integrations',
8+
referrer: 'no-referrer',
9+
}
10+
11+
interface IntegrationProviderPageProps {
12+
params: Promise<{ organizationId: string; provider: string }>
13+
}
14+
15+
export default async function IntegrationProviderPage({ params }: IntegrationProviderPageProps) {
16+
const { organizationId, provider } = await params
17+
await requireIntegrationsViewer(organizationId, integrationPath(organizationId, provider))
18+
return <OrganizationIntegrations section={provider} />
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { notFound, redirect } from 'next/navigation'
2+
import { getSession } from '@/lib/auth'
3+
import { getOrganizationSurfaceContext } from '@/lib/organizations/surface'
4+
import { buildAuthCrossLink } from '@/app/(auth)/auth-redirect'
5+
6+
/**
7+
* The gate the integrations index and provider pages share. `callbackUrl` is the page to come back to after
8+
* sign-in, carrying whatever connection or Slack context the visit arrived with.
9+
*/
10+
export async function requireIntegrationsViewer(organizationId: string, callbackUrl: string) {
11+
const session = await getSession()
12+
if (!session?.user) redirect(buildAuthCrossLink('/login', { callbackUrl, isInviteFlow: false }))
13+
const context = await getOrganizationSurfaceContext(organizationId, session.user.id)
14+
if (!context?.searchAccess.memberScoped) notFound()
15+
return session.user.id
16+
}

‎apps/sim/app/o/[organizationId]/integrations/account-connection-actions.tsx‎

Lines changed: 0 additions & 93 deletions
This file was deleted.

‎apps/sim/app/o/[organizationId]/integrations/accounts/[credentialId]/page.tsx‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { Suspense } from 'react'
22
import type { Metadata } from 'next'
3+
import { organizationRoutes } from '@/lib/navigation/paths'
34
import Loading from '@/app/o/[organizationId]/integrations/accounts/[credentialId]/loading'
4-
import { AccountToolPermissions } from '@/app/o/[organizationId]/integrations/accounts/[credentialId]/tool-permissions'
5+
import { IntegrationsHost } from '@/app/o/[organizationId]/integrations/integrations-host'
6+
import { IntegrationsPage } from '@/platform/app/(shell)/integrations/_components/integrations-page/integrations-page'
7+
import { ToolPermissionsPanel } from '@/platform/app/(shell)/integrations/_components/tool-permissions/tool-permissions-panel'
58

69
export const metadata: Metadata = { title: 'Tool permissions', referrer: 'no-referrer' }
710

@@ -12,9 +15,20 @@ interface AccountToolPermissionsPageProps {
1215
export default async function AccountToolPermissionsPage({
1316
params,
1417
}: AccountToolPermissionsPageProps) {
18+
const { organizationId, credentialId } = await params
1519
return (
1620
<Suspense fallback={<Loading />}>
17-
<AccountToolPermissions {...(await params)} />
21+
<IntegrationsHost>
22+
<IntegrationsPage
23+
back={{ href: organizationRoutes(organizationId).integrations, label: 'Integrations' }}
24+
>
25+
<ToolPermissionsPanel
26+
organizationId={organizationId}
27+
credentialId={credentialId}
28+
showHeading
29+
/>
30+
</IntegrationsPage>
31+
</IntegrationsHost>
1832
</Suspense>
1933
)
2034
}

0 commit comments

Comments
 (0)