Skip to content

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

Chore/fix broken links wrappers (#30046)

Joshen Limc9458d93cf38
diff --git a/apps/studio/components/interfaces/Database/Wrappers/CreateWrapper.tsx b/apps/studio/components/interfaces/Database/Wrappers/CreateWrapper.tsx
index 685e05b56a2..98056249503 100644
--- a/apps/studio/components/interfaces/Database/Wrappers/CreateWrapper.tsx
+++ b/apps/studio/components/interfaces/Database/Wrappers/CreateWrapper.tsx
@@ -142,7 +142,7 @@ const CreateWrapper = () => {
'absolute -left-20 top-1 opacity-75 hover:opacity-100',
].join(' ')}
>
- <Link href={`/project/${ref}/database/wrappers`}>
+ <Link href={`/project/${ref}/integrations/wrappers`}>
<div className="flex items-center space-x-2">
<ArrowLeft strokeWidth={1.5} size={14} />
<p className="text-sm">Back</p>
diff --git a/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx b/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx
index 21c9fce17f9..ffdb8ae54d9 100644
--- a/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx
+++ b/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx
@@ -1,14 +1,14 @@
-import * as Tooltip from '@radix-ui/react-tooltip'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { partition } from 'lodash'
+import { ChevronUp, Edit, ExternalLink, Trash } from 'lucide-react'
import Image from 'next/legacy/image'
import Link from 'next/link'
-import { Button, Collapsible } from 'ui'
-import { useParams } from 'common/hooks'
+import { useParams } from 'common'
+import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import type { FDW } from 'data/fdw/fdws-query'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import { ChevronUp, Edit, ExternalLink, Trash } from 'lucide-react'
+import { Collapsible } from 'ui'
import type { WrapperMeta } from './Wrappers.types'
interface WrapperRowProps {
@@ -131,72 +131,41 @@ const WrapperRow = ({
</div>
</div>
</div>
- <div className="flex items-center space-x-2">
- {canManageWrappers ? (
- <Link href={`/project/${ref}/database/wrappers/${wrapper.id}`}>
- <Button
- type="default"
- icon={<Edit strokeWidth={1.5} />}
- className="px-1.5"
- />
+ <div className="flex items-center gap-x-2">
+ <ButtonTooltip
+ asChild
+ disabled={!canManageWrappers}
+ type="default"
+ icon={<Edit strokeWidth={1.5} />}
+ className="px-1.5 space-x-0"
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: !canManageWrappers
+ ? 'You need additional permissions to edit wrappers'
+ : 'Edit wrapper',
+ },
+ }}
+ >
+ <Link href={`/project/${ref}/integrations/wrappers/${wrapper.id}`}>
+ <span className="sr-only">Edit</span>
</Link>
- ) : (
- <Tooltip.Root delayDuration={0}>
- <Tooltip.Trigger asChild>
- <Button
- disabled
- type="default"
- icon={<Edit strokeWidth={1.5} />}
- className="px-1.5"
- />
- </Tooltip.Trigger>
- {!canManageWrappers && (
- <Tooltip.Portal>
- <Tooltip.Content side="bottom">
- <Tooltip.Arrow className="radix-tooltip-arrow" />
- <div
- className={[
- 'rounded bg-alternative py-1 px-2 leading-none shadow',
- 'border border-background',
- ].join(' ')}
- >
- <span className="text-xs text-foreground">
- You need additional permissions to edit wrappers
- </span>
- </div>
- </Tooltip.Content>
- </Tooltip.Portal>
- )}
- </Tooltip.Root>
- )}
- <Tooltip.Root delayDuration={0}>
- <Tooltip.Trigger asChild>
- <Button
- type="default"
- disabled={!canManageWrappers}
- icon={<Trash strokeWidth={1.5} />}
- className="px-1.5"
- onClick={() => onSelectDelete(wrapper)}
- />
- </Tooltip.Trigger>
- {!canManageWrappers && (
- <Tooltip.Portal>
- <Tooltip.Content side="bottom">
- <Tooltip.Arrow className="radix-tooltip-arrow" />
- <div
- className={[
- 'rounded bg-alternative py-1 px-2 leading-none shadow',
- 'border border-background',
- ].join(' ')}
- >
- <span className="text-xs text-foreground">
- You need additional permissions to add wrappers
- </span>
- </div>
- </Tooltip.Content>
- </Tooltip.Portal>
- )}
- </Tooltip.Root>
+ </ButtonTooltip>
+ <ButtonTooltip
+ type="default"
+ disabled={!canManageWrappers}
+ icon={<Trash strokeWidth={1.5} />}
+ className="px-1.5"
+ onClick={() => onSelectDelete(wrapper)}
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: !canManageWrappers
+ ? 'You need additional permissions to delete wrappers'
+ : 'Delete wrapper',
+ },
+ }}
+ />
</div>
</div>
)
diff --git a/apps/studio/components/ui/ButtonTooltip.tsx b/apps/studio/components/ui/ButtonTooltip.tsx
index f1ff45d08e8..23372130b80 100644
--- a/apps/studio/components/ui/ButtonTooltip.tsx
+++ b/apps/studio/components/ui/ButtonTooltip.tsx
@@ -18,7 +18,7 @@ export const ButtonTooltip = forwardRef<
{props.children}
</Button>
</TooltipTrigger_Shadcn_>
- {props.disabled && props.tooltip.content.text !== undefined && (
+ {props.tooltip.content.text !== undefined && (
<TooltipContent_Shadcn_ {...props.tooltip.content}>
{props.tooltip.content.text}
</TooltipContent_Shadcn_>
diff --git a/apps/studio/pages/project/[ref]/integrations/wrappers/index.tsx b/apps/studio/pages/project/[ref]/integrations/wrappers/index.tsx
index 6c0d2ea7566..6360dd51395 100644
--- a/apps/studio/pages/project/[ref]/integrations/wrappers/index.tsx
+++ b/apps/studio/pages/project/[ref]/integrations/wrappers/index.tsx
@@ -3,7 +3,7 @@ import { ExternalLink } from 'lucide-react'
import { Wrappers } from 'components/interfaces/Database'
import WrappersDropdown from 'components/interfaces/Database/Wrappers/WrappersDropdown'
-import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout'
+import ProjectIntegrationsLayout from 'components/layouts/ProjectIntegrationsLayout/ProjectIntegrationsLayout'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import {
ScaffoldContainer,
@@ -19,7 +19,6 @@ import { useCheckPermissions, usePermissionsLoaded } from 'hooks/misc/useCheckPe
import type { NextPageWithLayout } from 'types'
import { Button } from 'ui'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
-import ProjectIntegrationsLayout from 'components/layouts/ProjectIntegrationsLayout/ProjectIntegrationsLayout'
const DatabaseWrappers: NextPageWithLayout = () => {
const { project } = useProjectContext()