Skip to content

Commit

Permalink
moving to organization whitelisting (#262)
Browse files Browse the repository at this point in the history
* moving to organization whitelisting

* adding missing veriticals to docs
  • Loading branch information
pellicceama authored Feb 13, 2025
1 parent 3e6fe17 commit 1b8d7c2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import {useUser} from '@clerk/nextjs'
import {useOrganization, useUser} from '@clerk/nextjs'
import {Loader2, Lock, Pencil, Plus} from 'lucide-react'
import Image from 'next/image'
import React, {useState} from 'react'
Expand Down Expand Up @@ -58,14 +58,19 @@ export default function ConnectorConfigsPage({
open: false,
})
const {user} = useUser()
const {organization} = useOrganization()

const orgPublicMetadata = organization?.publicMetadata
const isWhitelisted = orgPublicMetadata?.['whitelisted'] === true

const connectorConfigsRes = _trpcReact.adminListConnectorConfigs.useQuery()

useRefetchOnSwitch(connectorConfigsRes.refetch)

// either if whitelisted or already has a connector other than default postgres
const canAddNewConnectors =
!isProd ||
user?.publicMetadata?.['whitelisted'] === true ||
isWhitelisted ||
connectorConfigsRes.data?.some(
(c) => c.connectorName !== 'default_postgres',
)
Expand Down Expand Up @@ -264,7 +269,7 @@ export default function ConnectorConfigsPage({
) : (
<Card
key={`${vertical}-request-access`}
className="m-3 size-[150px] border border-border bg-gray-100 cursor-pointer hover:bg-gray-50 transition-colors duration-150 group">
className="group m-3 size-[150px] cursor-pointer border border-border bg-gray-100 transition-colors duration-150 hover:bg-gray-50">
<CardContent
className="flex size-full flex-1 flex-col items-center justify-center pt-4"
onClick={() => {
Expand All @@ -275,7 +280,7 @@ export default function ConnectorConfigsPage({
})
setOpenCalendar(true)
}}>
<p className="text-center text-sm font-semibold text-gray-600 group-hover:text-gray-400 transition-colors duration-150">
<p className="text-center text-sm font-semibold text-gray-600 transition-colors duration-150 group-hover:text-gray-400">
Request {parseCategory(vertical)} Integration
</p>
</CardContent>
Expand Down
8 changes: 6 additions & 2 deletions kits/sdk/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,9 @@
"calendar",
"ats",
"email",
"messaging"
"messaging",
"communication",
"wiki"
]
}
},
Expand Down Expand Up @@ -8571,7 +8573,9 @@
"calendar",
"ats",
"email",
"messaging"
"messaging",
"communication",
"wiki"
]
}
},
Expand Down
4 changes: 4 additions & 0 deletions kits/sdk/openapi.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@ export interface components {
| 'ats'
| 'email'
| 'messaging'
| 'communication'
| 'wiki'
)[]
| null
connector_name: string
Expand Down Expand Up @@ -2343,6 +2345,8 @@ export interface operations {
| 'ats'
| 'email'
| 'messaging'
| 'communication'
| 'wiki'
)[]
integrations: string[]
}[]
Expand Down

0 comments on commit 1b8d7c2

Please sign in to comment.