Skip to content

Commit 8fc6dab

Browse files
joshenlimivasilov
andauthored
Fix link to wrappers integrations from database page (supabase#30731)
* Fix link to wrappers integrations from database page * Update next.config redirects for webhooks and wrappers * Fix link to webhooks * Move the search and selectedCategory into useQueryState. --------- Co-authored-by: Ivan Vasilov <[email protected]>
1 parent 08a45f4 commit 8fc6dab

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

apps/studio/components/interfaces/Integrations/Landing/AvailableIntegrations.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1+
import { Search } from 'lucide-react'
2+
import { parseAsString, useQueryState } from 'nuqs'
3+
14
import AlertError from 'components/ui/AlertError'
25
import NoSearchResults from 'components/ui/NoSearchResults'
3-
import { Search } from 'lucide-react'
4-
import { useState } from 'react'
56
import { buttonVariants, cn, Tabs_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_ } from 'ui'
6-
import { Admonition } from 'ui-patterns'
7+
import { Admonition } from 'ui-patterns/admonition'
78
import { Input } from 'ui-patterns/DataInputs/Input'
89
import { IntegrationCard, IntegrationLoadingCard } from './IntegrationCard'
910
import { useInstalledIntegrations } from './useInstalledIntegrations'
1011

1112
type IntegrationCategory = 'all' | 'wrapper' | 'postgres_extensions' | 'custom'
1213

1314
export const AvailableIntegrations = () => {
14-
const [search, setSearch] = useState('')
15-
const [selectedCategory, setSelectedCategory] = useState<IntegrationCategory>('all')
15+
const [selectedCategory, setSelectedCategory] = useQueryState(
16+
'category',
17+
parseAsString.withDefault('all').withOptions({ clearOnDefault: true })
18+
)
19+
const [search, setSearch] = useQueryState(
20+
'search',
21+
parseAsString.withDefault('').withOptions({ clearOnDefault: true })
22+
)
1623

1724
const { availableIntegrations, installedIntegrations, error, isError, isLoading, isSuccess } =
1825
useInstalledIntegrations()

apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export const generateDatabaseMenu = (
112112
{
113113
name: 'Wrappers',
114114
key: 'wrappers',
115-
url: `/project/${ref}/integrations/wrappers`,
115+
url: `/project/${ref}/integrations?category=wrapper`,
116116
rightIcon: <ArrowUpRight strokeWidth={1} className="h-4 w-4" />,
117117
items: [],
118118
},
@@ -121,7 +121,7 @@ export const generateDatabaseMenu = (
121121
{
122122
name: 'Webhooks',
123123
key: 'hooks',
124-
url: `/project/${ref}/integrations/hooks`,
124+
url: `/project/${ref}/integrations/webhooks/overview`,
125125
rightIcon: <ArrowUpRight strokeWidth={1} className="h-4 w-4" />,
126126
items: [],
127127
},

apps/studio/next.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,12 @@ const nextConfig = {
402402
{
403403
permanent: true,
404404
source: '/project/:ref/database/webhooks',
405-
destination: '/project/:ref/integrations/webhooks',
405+
destination: '/project/:ref/integrations/webhooks/overview',
406406
},
407407
{
408408
permanent: true,
409409
source: '/project/:ref/database/wrappers',
410-
destination: '/project/:ref/integrations/wrappers',
410+
destination: '/project/:ref/integrations?category=wrapper',
411411
},
412412
{
413413
permanent: true,

0 commit comments

Comments
 (0)