Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: marketplace UI fixes (#46146)

Francesco Sansalvadorea2a43f7ec933
diff --git a/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx b/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx
index e5ef0d6c773..ca63108e40b 100644
--- a/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx
+++ b/apps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsx
@@ -480,6 +480,7 @@ const WRAPPER_INTEGRATIONS: Array<IntegrationDefinition> = WRAPPERS.map((w) => {
requiredExtensions: ['wrappers', 'supabase_vault'],
description: w.description,
docsUrl: w.docsUrl,
+ categories: w.categories,
meta: w,
author: authorSupabase,
navigation: [
@@ -640,12 +641,35 @@ const TEMPLATE_INTEGRATIONS: Array<IntegrationDefinition> = [
},
]
-export const INTEGRATIONS: Array<IntegrationDefinition> = [
+const INTEGRATIONS_WITH_CATEGORIES = [
...WRAPPER_INTEGRATIONS,
- ...SUPABASE_INTEGRATIONS,
- ...TEMPLATE_INTEGRATIONS,
+ ...SUPABASE_INTEGRATIONS.map((integration) => {
+ const categoryMap: Record<string, string[]> = {
+ queues: ['devtools'],
+ cron: ['devtools'],
+ vault: ['security'],
+ webhooks: ['api'],
+ data_api: ['api', 'data-platform'],
+ graphiql: ['api', 'devtools'],
+ }
+ return {
+ ...integration,
+ categories: categoryMap[integration.id] || [],
+ }
+ }),
+ ...TEMPLATE_INTEGRATIONS.map((integration) => {
+ const categoryMap: Record<string, string[]> = {
+ stripe_sync_engine: ['billing'],
+ }
+ return {
+ ...integration,
+ categories: categoryMap[integration.id] || [],
+ }
+ }),
]
+export const INTEGRATIONS: Array<IntegrationDefinition> = INTEGRATIONS_WITH_CATEGORIES
+
export const Loading = () => (
<div className="p-10">
<GenericSkeletonLoader />
diff --git a/apps/studio/components/interfaces/Integrations/Landing/useIntegrationFilteringAndSort.ts b/apps/studio/components/interfaces/Integrations/Landing/useIntegrationFilteringAndSort.ts
new file mode 100644
index 00000000000..325f4af5bd3
--- /dev/null
+++ b/apps/studio/components/interfaces/Integrations/Landing/useIntegrationFilteringAndSort.ts
@@ -0,0 +1,70 @@
+import { useMemo } from 'react'
+
+import type { IntegrationDefinition } from './Integrations.constants'
+
+interface UseIntegrationFilteringAndSortOptions {
+ featuredIds: readonly string[]
+ hasActiveFilter: boolean
+ includeFeaturedFlag?: boolean
+}
+
+// Filters all available integrations first by category,
+// then by the search term and sorts them first by
+// installation status and then alphabetically
+export const useIntegrationFilteringAndSort = (
+ filteredIntegrations: readonly IntegrationDefinition[],
+ availableIntegrations: readonly IntegrationDefinition[],
+ installedIds: readonly string[],
+ options: UseIntegrationFilteringAndSortOptions
+) => {
+ const sorted = useMemo(() => {
+ return sortByInstalledThenName(filteredIntegrations, installedIds)
+ }, [filteredIntegrations, installedIds])
+
+ const featured = useMemo(() => {
+ if (options.hasActiveFilter) return []
+
+ const byId = new Map(availableIntegrations.map((i) => [i.id, i]))
+
+ // Pinned IDs preserve their explicit order
+ const pinnedResult = options.featuredIds
+ .map((id) => byId.get(id))
+ .filter((i): i is IntegrationDefinition => !!i)
+
+ // For legacy: also include integrations with featured flag, sorted among themselves
+ if (options.includeFeaturedFlag) {
+ const flaggedFeatured = availableIntegrations.filter(
+ (i) => i.featured && !options.featuredIds.includes(i.id)
+ )
+ pinnedResult.push(...sortByInstalledThenName(flaggedFeatured, installedIds))
+ }
+
+ return pinnedResult
+ }, [
+ availableIntegrations,
+ options.hasActiveFilter,
+ options.featuredIds,
+ options.includeFeaturedFlag,
+ installedIds,
+ ])
+
+ return { sorted, featured }
+}
+
+/**
+ * Sort integrations by installation status (installed first) then alphabetically by name.
+ */
+export function sortByInstalledThenName(
+ integrations: readonly IntegrationDefinition[],
+ installedIds: readonly string[]
+): IntegrationDefinition[] {
+ return [...integrations].sort((a, b) => {
+ const aIsInstalled = installedIds.includes(a.id)
+ const bIsInstalled = installedIds.includes(b.id)
+
+ if (aIsInstalled && !bIsInstalled) return -1
+ if (!aIsInstalled && bIsInstalled) return 1
+
+ return a.name.localeCompare(b.name)
+ })
+}
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsx
index cd269c05eff..28421079dc9 100644
--- a/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsx
+++ b/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsx
@@ -31,17 +31,14 @@ import type {
export type { MarketplaceSource } from '@/components/interfaces/Integrations/Landing/Integrations.constants'
-// Launch-partner pin list for the featured rail. Order here is the order
-// shown. Stripe is the only first-party template in the set (id matches the
-// static catalogue); the rest are marketplaceDB slugs and only render if the
-// listing is published.
+// Defines featured integrations and their order in the featured hero
export const FEATURED_INTEGRATION_IDS = [
'grafana',
'stripe_sync_engine',
'aikido',
'aikido-security',
'doppler',
- 'cipherstash',
+ 'resend',
] as const
export type MarketplaceIntegrationType = 'oauth' | 'postgres_extension' | 'template' | 'wrapper'
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceCard.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceCard.tsx
index b71f24fdc82..0b1d6b3eb37 100644
--- a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceCard.tsx
+++ b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceCard.tsx
@@ -37,11 +37,7 @@ export const MarketplaceCard = ({ integration, isInstalled }: MarketplaceCardPro
<div className="flex items-center justify-between gap-2 pt-2.5">
<div className="flex flex-wrap items-center gap-1">
<MarketplaceSourceBadge source={source} />
- {integration.status && (
- <Badge variant="warning" className="capitalize">
- {integration.status}
- </Badge>
- )}
+ {integration.status && <Badge variant="warning">{integration.status}</Badge>}
</div>
<div className="text-xs flex items-center gap-1 text-foreground-lighter">
<span>Built by</span>
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHero.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHero.tsx
index ead1769c3ca..5c70808bca6 100644
--- a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHero.tsx
+++ b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHero.tsx
@@ -28,6 +28,7 @@ export const MarketplaceFeaturedHero = ({
const [activeIndex, setActiveIndex] = useState(0)
const [isPaused, setIsPaused] = useState(false)
+ const [progressKey, setProgressKey] = useState(0)
const hoveringRef = useRef(false)
const cardRef = useRef<HTMLDivElement>(null)
@@ -62,6 +63,8 @@ export const MarketplaceFeaturedHero = ({
if (integrations.length === 0) return null
+ const coverColSpan = integrations.length >= 6 ? 2 : 1
+
const active = integrations[Math.min(activeIndex, integrations.length - 1)]
const activeCategorySlug = active.categories?.[0]
const activeCategoryName = activeCategorySlug
@@ -86,13 +89,28 @@ export const MarketplaceFeaturedHero = ({
size="tiny"
className="px-1.5"
icon={isPaused ? <Play size={10} /> : <Pause size={10} />}
- onClick={() => setIsPaused((p) => !p)}
+ onClick={() =>
+ setIsPaused((p) => {
+ // When resuming, reset the progress animation so it starts from
+ // zero and stays in sync with the fresh JS interval.
+ if (p) setProgressKey((k) => k + 1)
+ return !p
+ })
+ }
/>
</div>
- <div ref={cardRef} className="overflow-hidden rounded-lg border bg-surface-100">
+ <div
+ ref={cardRef}
+ className="overflow-hidden rounded-lg border bg-surface-100"
+ style={
+ {
+ '--cover-width': `calc(${coverColSpan * 100}% / ${integrations.length})`,
+ } as React.CSSProperties
+ }
+ >
<Link
href={`/project/${project?.ref}/integrations/${active.id}/overview`}
- className="grid gap-0 @3xl:grid-cols-[minmax(0,280px)_minmax(0,1fr)] hover:bg-selection/20 transition-colors"
+ className="grid gap-0 @3xl:grid-cols-[var(--cover-width)_minmax(0,1fr)] hover:bg-selection/20 transition-colors"
>
<div className="relative hidden @3xl:block">
<FeaturedCover integration={active} categoryLabel={activeCategoryName} />
@@ -178,7 +196,7 @@ export const MarketplaceFeaturedHero = ({
</div>
{isActive && (
<span
- key={activeIndex}
+ key={`${activeIndex}-${progressKey}`}
aria-hidden
className="pointer-events-none absolute inset-x-0 bottom-0 h-0.5 origin-left animate-marketplace-featured-progress bg-brand"
style={{
@@ -201,9 +219,6 @@ interface FeaturedCoverProps {
categoryLabel: string | null
}
-// Decorative cover panel on the left of the hero. Uses a subtle dotted
-// gradient and renders the integration's own icon at a large scale so each
-// partner stays visually distinct without bespoke artwork per listing.
const FeaturedCover = ({ integration, categoryLabel }: FeaturedCoverProps) => (
<div
key={integration.id}
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFilterBar.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFilterBar.tsx
index 4ea7a9e56d9..0ff6e79b859 100644
--- a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFilterBar.tsx
+++ b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFilterBar.tsx
@@ -104,24 +104,26 @@ export const MarketplaceFilterBar = ({
All categories
</DropdownMenuItem>
<DropdownMenuSeparator />
- {categoryOptions.map((c) => {
- const Icon = getCategoryIcon(c.slug)
- return (
- <DropdownMenuItem
- key={c.slug}
- onClick={() => onCategoryChange(c.slug)}
- className="flex items-center gap-2"
- >
- <Icon size={13} className="text-foreground-lighter" />
- <span className="flex-1">{c.name}</span>
- {categoryCounts?.[c.slug] !== undefined && (
- <span className="font-mono text-xs text-foreground-lighter">
- {categoryCounts[c.slug]}
- </span>
- )}
- </DropdownMenuItem>
- )
- })}
+ {categoryOptions
+ .filter((c) => !categoryCounts || categoryCounts[c.slug] > 0)
+ .map((c) => {
+ const Icon = getCategoryIcon(c.slug)
+ return (
+ <DropdownMenuItem
+ key={c.slug}
+ onClick={() => onCategoryChange(c.slug)}
+ className="flex items-center gap-2"
+ >
+ <Icon size={13} className="text-foreground-lighter" />
+ <span className="flex-1">{c.name}</span>
+ {categoryCounts?.[c.slug] !== undefined && (
+ <span className="font-mono text-xs text-foreground-lighter">
+ {categoryCounts[c.slug]}
+ </span>
+ )}
+ </DropdownMenuItem>
+ )
+ })}
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceIndex.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceIndex.tsx
index 8fbdff6668a..5b7e271e8e3 100644
--- a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceIndex.tsx
+++ b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceIndex.tsx
@@ -30,6 +30,7 @@ import { MarketplaceListHeader, MarketplaceListRow } from './MarketplaceListRow'
import { IntegrationLoadingCard } from '@/components/interfaces/Integrations/Landing/IntegrationCard'
import { useAvailableIntegrations } from '@/components/interfaces/Integrations/Landing/useAvailableIntegrations'
import { useInstalledIntegrations } from '@/components/interfaces/Integrations/Landing/useInstalledIntegrations'
+import { useIntegrationFilteringAndSort } from '@/components/interfaces/Integrations/Landing/useIntegrationFilteringAndSort'
import { AlertError } from '@/components/ui/AlertError'
import { DocsButton } from '@/components/ui/DocsButton'
import { marketplaceCategoriesQueryOptions } from '@/data/marketplace/integration-categories-query'
@@ -88,16 +89,40 @@ export const MarketplaceIndex = () => {
const { data: marketplaceCategories = [] } = useQuery(marketplaceCategoriesQueryOptions())
- const categoryOptions = useMemo(
- () =>
- marketplaceCategories
- .filter(
- (c): c is { slug: string; name: string } & typeof c =>
- !!c.slug && !!c.name && !EXCLUDED_CATEGORY_SLUGS.has(c.slug)
- )
- .map((c) => ({ slug: c.slug, name: c.name })),
- [marketplaceCategories]
- )
+ const categoryOptions = useMemo(() => {
+ // Start with marketplace DB categories
+ const fromDb = marketplaceCategories
+ .filter(
+ (c): c is { slug: string; name: string } & typeof c =>
+ !!c.slug && !!c.name && !EXCLUDED_CATEGORY_SLUGS.has(c.slug)
+ )
+ .map((c) => ({ slug: c.slug, name: c.name }))
+
+ // Extract unique categories from static integrations
+ const staticCategories = new Set<string>()
+ const all = availableIntegrations ?? []
+ for (const integration of all) {
+ if (integration.categories) {
+ for (const cat of integration.categories) {
+ staticCategories.add(cat)
+ }
+ }
+ }
+
+ // Create options for static categories (use slug as name if not in marketplace DB)
+ const dbSlugs = new Set(fromDb.map((c) => c.slug))
+ const fromStatic = Array.from(staticCategories)
+ .filter((slug) => !dbSlugs.has(slug) && slug !== 'wrappers') // exclude 'wrappers' (it's a dedicated integration type)
+ .map((slug) => ({
+ slug,
+ name: slug
+ .split(/[-_]/)
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
+ .join(' '),
+ }))
+
+ return [...fromDb, ...fromStatic]
+ }, [marketplaceCategories, availableIntegrations])
const typeCounts = useMemo(() => {
const all = availableIntegrations ?? []
@@ -131,7 +156,7 @@ export const MarketplaceIndex = () => {
const hasActiveFilter = !!(category || type || source)
const hasSearchOrFilter = hasActiveFilter || search.length > 0
- const filtered = useMemo(() => {
+ const filteredIntegrations = useMemo(() => {
let result = availableIntegrations ?? []
if (category) {
@@ -148,22 +173,18 @@ export const MarketplaceIndex = () => {
result = result.filter((i) => i.name.toLowerCase().includes(needle))
}
- return [...result].sort((a, b) => {
- const aInstalled = installedIds.includes(a.id)
- const bInstalled = installedIds.includes(b.id)
- if (aInstalled && !bInstalled) return -1
- if (!aInstalled && bInstalled) return 1
- return a.name.localeCompare(b.name)
- })
- }, [availableIntegrations, category, type, source, search, installedIds])
+ return result
+ }, [availableIntegrations, category, type, source, search])
- const featured = useMemo(() => {
- if (hasSearchOrFilter) return []
- const byId = new Map((availableIntegrations ?? []).map((i) => [i.id, i]))
- return FEATURED_INTEGRATION_IDS.map((id) => byId.get(id)).filter(
- (i): i is NonNullable<typeof i> => !!i
- )
- }, [availableIntegrations, hasSearchOrFilter])
+ const { sorted: filtered, featured } = useIntegrationFilteringAndSort(
+ filteredIntegrations,
+ availableIntegrations,
+ installedIds,
+ {
+ featuredIds: FEATURED_INTEGRATION_IDS,
+ hasActiveFilter: hasSearchOrFilter,
+ }
+ )
const clearAll = () => {
setCategory(null)
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceListRow.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceListRow.tsx
index 0cd2a2ec0ac..dc5055e059b 100644
--- a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceListRow.tsx
+++ b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceListRow.tsx
@@ -43,11 +43,7 @@ export const MarketplaceListRow = ({ integration, isInstalled }: MarketplaceList
</div>
<div className="relative z-10">
<MarketplaceSourceBadge source={source} />
- {integration.status && (
- <Badge variant="warning" className="capitalize">
- {integration.status}
- </Badge>
- )}
+ {integration.status && <Badge variant="warning">{integration.status}</Badge>}
</div>
</div>
{integration.description && (
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceSidebar.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceSidebar.tsx
index 0f81be9013a..bac1a6e98a2 100644
--- a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceSidebar.tsx
+++ b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceSidebar.tsx
@@ -3,6 +3,7 @@ import { ArrowUpRight, BookOpen, LayoutGrid, PlusSquare } from 'lucide-react'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { cn } from 'ui'
+import { ShimmeringLoader } from 'ui-patterns'
import { useInstalledIntegrations } from '@/components/interfaces/Integrations/Landing/useInstalledIntegrations'
import { DOCS_URL } from '@/lib/constants'
@@ -56,7 +57,7 @@ export const MarketplaceSidebar = () => {
const router = useRouter()
const { ref } = useParams()
- const { installedIntegrations } = useInstalledIntegrations()
+ const { installedIntegrations, isLoading } = useInstalledIntegrations()
const baseHref = `/project/${ref}/integrations`
const isDiscoverActive =
@@ -72,7 +73,16 @@ export const MarketplaceSidebar = () => {
label="Marketplace"
/>
- {installedIntegrations.length > 0 && (
+ {isLoading ? (
+ <>
+ <div className={sectionLabelCls}>Installed</div>
+ <div className="space-y-1">
+ <ShimmeringLoader />
+ <ShimmeringLoader />
+ <ShimmeringLoader />
+ </div>
+ </>
+ ) : installedIntegrations.length > 0 ? (
<>
<div className={sectionLabelCls}>Installed · {installedIntegrations.length}</div>
{installedIntegrations.map((integration) => {
@@ -96,7 +106,7 @@ export const MarketplaceSidebar = () => {
)
})}
</>
- )}
+ ) : null}
<div className={sectionLabelCls}>Resources</div>
{HELP_LINKS.map(({ icon, label, href }) => (
diff --git a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
index f81cea188a2..30146f8a57c 100644
--- a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
+++ b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.constants.ts
@@ -47,6 +47,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'StripeFdw',
label: 'Stripe',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/stripe`,
+ categories: ['billing'],
server: {
options: [
{
@@ -1214,6 +1215,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'FirebaseFdw',
label: 'Firebase',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/firebase`,
+ categories: ['devtools', 'auth'],
server: {
options: [
{
@@ -1341,6 +1343,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'S3Fdw',
label: 'S3',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/s3`,
+ categories: ['storage'],
server: {
options: [
{
@@ -1425,6 +1428,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'S3VectorsFdw',
label: 'S3 Vectors',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/s3-vectors`,
+ categories: ['ai_vectors', 'storage'],
minimumExtensionVersion: '0.5.6',
server: {
options: [
@@ -1473,6 +1477,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'ClickHouseFdw',
label: 'ClickHouse',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/clickhouse`,
+ categories: ['data-platform'],
server: {
options: [
{
@@ -1518,6 +1523,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'BigQueryFdw',
label: 'BigQuery',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/bigquery`,
+ categories: ['data-platform'],
server: {
options: [
{
@@ -1593,6 +1599,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'airtableFdw',
label: 'Airtable',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/airtable`,
+ categories: ['data-platform'],
server: {
options: [
{
@@ -1636,6 +1643,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'logflareFdw',
label: 'Logflare',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/logflare`,
+ categories: ['observability'],
server: {
options: [
{
@@ -1672,6 +1680,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'Auth0Fdw',
label: 'Auth0',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/auth0`,
+ categories: ['auth'],
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -1803,6 +1812,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'CognitoFdw',
label: 'Cognito',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/cognito`,
+ categories: ['auth'],
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -1898,6 +1908,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'mssqlFdw',
label: 'Microsoft SQL Server',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/mssql`,
+ categories: ['data-platform'],
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -1935,6 +1946,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'redisFdw',
label: 'Redis',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/redis`,
+ categories: ['caching-offline-first'],
minimumExtensionVersion: '0.3.0',
server: {
options: [
@@ -2189,6 +2201,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'paddleFdw',
label: 'Paddle',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/paddle`,
+ categories: ['billing'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2290,6 +2303,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'snowflakeFdw',
label: 'Snowflake',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/snowflake`,
+ categories: ['data-platform'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2393,6 +2407,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'icebergFdw',
label: 'Iceberg',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/iceberg`,
+ categories: ['data-platform'],
minimumExtensionVersion: '0.5.3',
customComponent: true,
server: {
@@ -2479,6 +2494,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'calFdw',
label: 'Cal.com',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/cal`,
+ categories: ['devtools', 'api'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2686,6 +2702,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'calendlyFdw',
label: 'Calendly',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/calendly`,
+ categories: ['devtools', 'api'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -2923,6 +2940,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'clerkFdw',
label: 'Clerk',
docsUrl: `${DOCS_URL}/guides/database/extensions/wrappers/clerk`,
+ categories: ['auth'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -3263,6 +3281,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'NotionFdw',
label: 'Notion',
docsUrl: 'https://fdw.dev/catalog/notion/',
+ categories: ['devtools'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -3417,6 +3436,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'SlackFdw',
label: 'Slack',
docsUrl: 'https://fdw.dev/catalog/slack/',
+ categories: ['messaging'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -3667,6 +3687,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'Cfd1Fdw',
label: 'Cloudflare D1',
docsUrl: 'https://fdw.dev/catalog/cfd1/',
+ categories: ['data-platform'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -3803,6 +3824,7 @@ export const WRAPPERS: WrapperMeta[] = [
extensionName: 'HubspotFdw',
label: 'HubSpot',
docsUrl: 'https://fdw.dev/catalog/hubspot/',
+ categories: ['devtools', 'api'],
minimumExtensionVersion: '0.4.0',
server: {
options: [
@@ -4093,6 +4115,7 @@ export const WRAPPERS: WrapperMeta[] = [
minimumExtensionVersion: '0.4.0',
label: 'Orb',
docsUrl: 'https://fdw.dev/catalog/orb/',
+ categories: ['billing'],
server: {
options: [
{
diff --git a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.types.ts b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.types.ts
index 5c3b2eb016a..152fcbc4ad5 100644
--- a/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.types.ts
+++ b/apps/studio/components/interfaces/Integrations/Wrappers/Wrappers.types.ts
@@ -16,6 +16,7 @@ export type WrapperMeta = {
sourceSchemaOption?: ServerOption
// Array of tables that needs to be supplied to the wrapper. If the array is empty, the wrapper should target a schema.
tables: Table[]
+ categories?: string[]
}
export type ServerOption = {
diff --git a/apps/studio/pages/project/[ref]/integrations/index.tsx b/apps/studio/pages/project/[ref]/integrations/index.tsx
index 948c5de4a99..ee48c9d7a3d 100644
--- a/apps/studio/pages/project/[ref]/integrations/index.tsx
+++ b/apps/studio/pages/project/[ref]/integrations/index.tsx
@@ -26,6 +26,7 @@ import {
import { IntegrationDefinition } from '@/components/interfaces/Integrations/Landing/Integrations.constants'
import { useAvailableIntegrations } from '@/components/interfaces/Integrations/Landing/useAvailableIntegrations'
import { useInstalledIntegrations } from '@/components/interfaces/Integrations/Landing/useInstalledIntegrations'
+import { useIntegrationFilteringAndSort } from '@/components/interfaces/Integrations/Landing/useIntegrationFilteringAndSort'
import { MarketplaceIndex } from '@/components/interfaces/Integrations/Marketplace/MarketplaceIndex'
import { DefaultLayout } from '@/components/layouts/DefaultLayout'
import { ProjectIntegrationsLayoutDispatch } from '@/components/layouts/ProjectIntegrationsLayoutDispatch'
@@ -148,64 +149,6 @@ function usePageContent(
return pageContent
}
-// Filters all available integrations first by category,
-// then by the search term and sorts them first by
-// installation status and then alphabetically
-function useFilteredAndSortedIntegrations(
- availableIntegrations: IntegrationDefinition[],
- selectedCategory: string,
- search: string,
- installedIds: string[]
-) {
- const filteredAndSortedIntegrations = useMemo(() => {
- let filtered = availableIntegrations ?? []
-
- if (selectedCategory !== 'all') {
- filtered = filtered.filter(
- (i) => i.type === selectedCategory || i.categories?.includes(selectedCategory)
- )
- }
-
- if (search.length > 0) {
- filtered = filtered.filter((i) => i.name.toLowerCase().includes(search.toLowerCase()))
- }
-
- // Sort by installation status, then alphabetically
- return filtered.sort((a, b) => {
- const aIsInstalled = installedIds.includes(a.id)
- const bIsInstalled = installedIds.includes(b.id)
-
- if (aIsInstalled && !bIsInstalled) return -1
- if (!aIsInstalled && bIsInstalled) return 1
-
- return a.name.localeCompare(b.name)
- })
- }, [availableIntegrations, selectedCategory, search, installedIds])
-
- return filteredAndSortedIntegrations
-}
-
-// Returns featured integrations
-function useFeaturedIntegratios(
- filteredAndSortedIntegrations: IntegrationDefinition[],
- selectedCategory: string,
- search: string
-) {
- const groupedIntegrations = useMemo(() => {
- if (selectedCategory !== 'all' || search.length > 0) {
- return null
- }
-
- const featured = filteredAndSortedIntegrations.filter(
- (integration) => FEATURED_INTEGRATIONS.includes(integration.id) || integration.featured
- )
-
- return featured
- }, [filteredAndSortedIntegrations, selectedCategory, search])
-
- return groupedIntegrations
-}
-
const IntegrationsPage: NextPageWithLayout = () => {
const isMarketplaceEnabled = useIsMarketplaceEnabled()
if (isMarketplaceEnabled) return <MarketplaceIndex />
@@ -251,18 +194,30 @@ const LegacyIntegrationsPage = () => {
const pageContent = usePageContent(selectedCategory, categories)
- const filteredAndSortedIntegrations = useFilteredAndSortedIntegrations(
- availableIntegrations,
- selectedCategory,
- search,
- installedIds
- )
+ const filteredIntegrations = useMemo(() => {
+ let filtered = availableIntegrations ?? []
- const featuredIntegrations = useFeaturedIntegratios(
- filteredAndSortedIntegrations,
- selectedCategory,
- search
- )
+ if (selectedCategory !== 'all') {
+ filtered = filtered.filter(
+ (i) => i.type === selectedCategory || i.categories?.includes(selectedCategory)
+ )
+ }
+
+ if (search.length > 0) {
+ filtered = filtered.filter((i) => i.name.toLowerCase().includes(search.toLowerCase()))
+ }
+
+ return filtered
+ }, [availableIntegrations, selectedCategory, search])
+
+ const hasActiveFilter = selectedCategory !== 'all' || search.length > 0
+
+ const { sorted: filteredAndSortedIntegrations, featured: featuredIntegrations } =
+ useIntegrationFilteringAndSort(filteredIntegrations, availableIntegrations, installedIds, {
+ featuredIds: FEATURED_INTEGRATIONS,
+ hasActiveFilter,
+ includeFeaturedFlag: true,
+ })
return (
<>