mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
refactor: route next/link through compat re-export (#33632)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Link from '@/next/link'
|
||||
import { useAccountIntegrates } from '@/service/use-common'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import s from './index.module.css'
|
||||
|
||||
@ -16,7 +16,7 @@ vi.mock('next-themes', () => ({
|
||||
useTheme: vi.fn(),
|
||||
}))
|
||||
|
||||
vi.mock('next/link', () => ({
|
||||
vi.mock('@/next/link', () => ({
|
||||
default: ({ children, href }: { children: React.ReactNode, href: string }) => (
|
||||
<a href={href} data-testid="mock-link">{children}</a>
|
||||
),
|
||||
|
||||
@ -4,7 +4,6 @@ import {
|
||||
RiArrowRightUpLine,
|
||||
} from '@remixicon/react'
|
||||
import { useTheme } from 'next-themes'
|
||||
import Link from 'next/link'
|
||||
import {
|
||||
memo,
|
||||
useCallback,
|
||||
@ -15,6 +14,7 @@ import Divider from '@/app/components/base/divider'
|
||||
import Loading from '@/app/components/base/loading'
|
||||
import List from '@/app/components/plugins/marketplace/list'
|
||||
import ProviderCard from '@/app/components/plugins/provider-card'
|
||||
import Link from '@/next/link'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import { getMarketplaceUrl } from '@/utils/var'
|
||||
import {
|
||||
|
||||
@ -7,7 +7,7 @@ import { useMarketplaceAllPlugins } from '../hooks'
|
||||
import InstallFromMarketplace from '../install-from-marketplace'
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('next/link', () => ({
|
||||
vi.mock('@/next/link', () => ({
|
||||
default: ({ children, href }: { children: React.ReactNode, href: string }) => <a href={href}>{children}</a>,
|
||||
}))
|
||||
|
||||
|
||||
@ -3,13 +3,13 @@ import type {
|
||||
} from './declarations'
|
||||
import type { Plugin } from '@/app/components/plugins/types'
|
||||
import { useTheme } from 'next-themes'
|
||||
import Link from 'next/link'
|
||||
import { useCallback, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Divider from '@/app/components/base/divider'
|
||||
import Loading from '@/app/components/base/loading'
|
||||
import List from '@/app/components/plugins/marketplace/list'
|
||||
import ProviderCard from '@/app/components/plugins/provider-card'
|
||||
import Link from '@/next/link'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import { getMarketplaceUrl } from '@/utils/var'
|
||||
import {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { RiErrorWarningFill } from '@remixicon/react'
|
||||
import Link from 'next/link'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
import { SwitchPluginVersion } from '@/app/components/workflow/nodes/_base/components/switch-plugin-version'
|
||||
import Link from '@/next/link'
|
||||
import { useInstalledPluginList } from '@/service/use-plugins'
|
||||
|
||||
type StatusIndicatorsProps = {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { PluginProvider } from '@/models/common'
|
||||
import { LockClosedIcon } from '@heroicons/react/24/solid'
|
||||
import Link from 'next/link'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Link from '@/next/link'
|
||||
import { usePluginProviders } from '@/service/use-common'
|
||||
import SerpapiPlugin from './SerpapiPlugin'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user