From 9d31a64b2c6e5a2802735b9a3950ff255f393935 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:33:36 +0800 Subject: [PATCH] refactor: add next api compatibility --- .../apps/app-card-operations-flow.test.tsx | 4 +- .../apps/app-list-browsing-flow.test.tsx | 4 +- web/__tests__/apps/create-app-flow.test.tsx | 4 +- .../billing/billing-integration.test.tsx | 2 +- .../billing/cloud-plan-payment-flow.test.tsx | 2 +- .../education-verification-flow.test.tsx | 2 +- .../billing/partner-stack-flow.test.tsx | 2 +- .../billing/pricing-modal-flow.test.tsx | 2 +- .../datasets/document-management.test.tsx | 2 +- .../document-detail-navigation-fix.test.tsx | 4 +- web/__tests__/embedded-user-id-auth.test.tsx | 2 +- web/__tests__/embedded-user-id-store.test.tsx | 2 +- .../explore/sidebar-lifecycle-flow.test.tsx | 2 +- .../share/text-generation-index-flow.test.tsx | 2 +- .../(appDetailLayout)/[appId]/layout-main.tsx | 4 +- .../[appId]/overview/tracing/panel.tsx | 6 +-- .../[datasetId]/layout-main.tsx | 2 +- .../(commonLayout)/datasets/layout.spec.tsx | 2 +- web/app/(commonLayout)/datasets/layout.tsx | 2 +- .../(commonLayout)/education-apply/page.tsx | 8 ++-- .../(commonLayout)/role-route-guard.spec.tsx | 2 +- web/app/(commonLayout)/role-route-guard.tsx | 2 +- .../(humanInputLayout)/form/[token]/form.tsx | 38 ++++++++-------- .../components/authenticated-layout.tsx | 4 +- web/app/(shareLayout)/components/splash.tsx | 4 +- .../webapp-reset-password/check-code/page.tsx | 12 ++--- .../webapp-reset-password/page.tsx | 14 +++--- .../set-password/page.tsx | 14 +++--- .../webapp-signin/check-code/page.tsx | 10 ++--- .../components/external-member-sso-auth.tsx | 2 +- .../components/mail-and-code-auth.tsx | 4 +- .../components/mail-and-password-auth.tsx | 8 ++-- .../webapp-signin/components/sso-auth.tsx | 2 +- .../webapp-signin/normalForm.tsx | 38 ++++++++-------- web/app/(shareLayout)/webapp-signin/page.tsx | 6 +-- .../account-page/email-change-modal.tsx | 44 +++++++++---------- web/app/account/(commonLayout)/avatar.tsx | 6 +-- .../delete-account/components/check-email.tsx | 8 ++-- .../delete-account/components/feed-back.tsx | 4 +- .../components/verify-email.tsx | 8 ++-- web/app/account/(commonLayout)/header.tsx | 6 +-- web/app/account/oauth/authorize/page.tsx | 2 +- web/app/activate/activateForm.tsx | 4 +- web/app/components/app-initializer.tsx | 2 +- .../app-sidebar/__tests__/index.spec.tsx | 2 +- .../text-squeeze-fix-verification.spec.tsx | 2 +- .../__tests__/app-info-modals.spec.tsx | 2 +- .../__tests__/use-app-info-actions.spec.ts | 2 +- .../app-sidebar/app-info/app-info-modals.tsx | 2 +- .../app-info/use-app-info-actions.ts | 2 +- .../__tests__/dropdown-callbacks.spec.tsx | 2 +- .../dataset-info/__tests__/index.spec.tsx | 2 +- .../app-sidebar/dataset-info/dropdown.tsx | 2 +- web/app/components/app-sidebar/index.tsx | 2 +- .../nav-link/__tests__/index.spec.tsx | 4 +- .../components/app-sidebar/nav-link/index.tsx | 4 +- .../dataset-config/context-var/index.spec.tsx | 2 +- .../context-var/var-picker.spec.tsx | 2 +- .../dataset-config/select-dataset/index.tsx | 6 +-- .../debug-with-single-model/index.spec.tsx | 2 +- .../components/app/configuration/index.tsx | 10 ++--- .../create-app-dialog/app-list/index.spec.tsx | 2 +- .../app/create-app-dialog/app-list/index.tsx | 12 ++--- .../app/create-app-modal/index.spec.tsx | 6 +-- .../components/app/create-app-modal/index.tsx | 26 +++++------ .../app/create-from-dsl-modal/index.tsx | 12 ++--- .../app/log-annotation/index.spec.tsx | 2 +- .../components/app/log-annotation/index.tsx | 2 +- web/app/components/app/log/empty-element.tsx | 6 +-- web/app/components/app/log/index.tsx | 4 +- web/app/components/app/log/list.tsx | 26 +++++------ web/app/components/app/overview/app-card.tsx | 20 ++++----- .../app/overview/settings/index.tsx | 2 +- .../components/app/overview/trigger-card.tsx | 10 ++--- .../app/switch-app-modal/index.spec.tsx | 2 +- .../components/app/switch-app-modal/index.tsx | 2 +- .../app/text-generate/item/index.tsx | 14 +++--- .../text-generate/saved-items/index.spec.tsx | 2 +- .../app/workflow-log/detail.spec.tsx | 2 +- .../components/app/workflow-log/detail.tsx | 4 +- .../app/workflow-log/index.spec.tsx | 4 +- .../components/app/workflow-log/list.spec.tsx | 2 +- .../apps/__tests__/app-card.spec.tsx | 4 +- .../components/apps/__tests__/list.spec.tsx | 4 +- .../apps/__tests__/new-app-card.spec.tsx | 4 +- web/app/components/apps/app-card.tsx | 4 +- web/app/components/apps/footer.tsx | 4 +- web/app/components/apps/list.tsx | 2 +- web/app/components/apps/new-app-card.tsx | 10 ++--- .../base/audio-btn/__tests__/index.spec.tsx | 4 +- web/app/components/base/audio-btn/index.tsx | 2 +- .../__tests__/chat-wrapper.spec.tsx | 2 +- .../__tests__/header-in-mobile.spec.tsx | 2 +- .../__tests__/index.spec.tsx | 2 +- .../sidebar/__tests__/index.spec.tsx | 2 +- .../chat/__tests__/content-switch.spec.tsx | 4 +- .../base/chat/chat/__tests__/hooks.spec.tsx | 4 +- .../chat/chat/__tests__/question.spec.tsx | 6 +-- .../chat/answer/__tests__/operation.spec.tsx | 2 +- .../base/chat/chat/answer/index.tsx | 2 +- .../chat-input-area/__tests__/index.spec.tsx | 2 +- .../base/chat/chat/citation/popup.tsx | 2 +- .../base/chat/chat/content-switch.tsx | 4 +- web/app/components/base/chat/chat/hooks.ts | 2 +- .../components/base/chat/chat/question.tsx | 2 +- .../header/__tests__/index.spec.tsx | 2 +- .../inputs-form/__tests__/content.spec.tsx | 2 +- .../checkbox-list/__tests__/index.spec.tsx | 2 +- .../components/base/checkbox-list/index.tsx | 2 +- .../base/encrypted-bottom/index.tsx | 4 +- .../__tests__/index.spec.tsx | 2 +- .../annotation-reply/__tests__/index.spec.tsx | 2 +- .../annotation-reply/index.tsx | 2 +- .../__tests__/param-config-content.spec.tsx | 2 +- .../__tests__/voice-settings.spec.tsx | 2 +- .../text-to-speech/param-config-content.tsx | 2 +- .../base/file-thumb/__tests__/index.spec.tsx | 2 +- .../file-uploader/__tests__/hooks.spec.ts | 2 +- .../dynamic-pdf-preview.spec.tsx | 2 +- .../file-uploader/dynamic-pdf-preview.tsx | 2 +- .../components/base/file-uploader/hooks.ts | 2 +- .../field/__tests__/file-uploader.spec.tsx | 2 +- .../base/__tests__/field.spec.tsx | 2 +- .../base/ga/__tests__/index.spec.tsx | 4 +- web/app/components/base/ga/index.tsx | 4 +- .../image-uploader/__tests__/hooks.spec.ts | 2 +- .../components/base/image-uploader/hooks.ts | 2 +- .../__tests__/index.spec.tsx | 2 +- .../base/linked-apps-panel/index.tsx | 6 +-- .../base/markdown-blocks/code-block.tsx | 2 +- .../components/with-icon-card-item.spec.tsx | 2 +- .../components/with-icon-card-item.tsx | 2 +- .../markdown-with-directive/index.spec.tsx | 2 +- .../base/markdown/__tests__/index.spec.tsx | 2 +- web/app/components/base/markdown/index.tsx | 2 +- .../base/markdown/streamdown-wrapper.tsx | 2 +- .../new-audio-button/__tests__/index.spec.tsx | 4 +- .../base/new-audio-button/index.tsx | 2 +- .../prompt-editor/__tests__/utils.spec.ts | 4 +- .../__tests__/pre-populate.spec.tsx | 4 +- .../ui/dropdown-menu/__tests__/index.spec.tsx | 4 +- .../base/voice-input/__tests__/index.spec.tsx | 2 +- web/app/components/base/voice-input/index.tsx | 2 +- .../base/zendesk/__tests__/index.spec.tsx | 4 +- web/app/components/base/zendesk/index.tsx | 4 +- .../__tests__/use-ps-info.spec.tsx | 2 +- .../billing/partner-stack/use-ps-info.ts | 2 +- .../billing/plan/__tests__/index.spec.tsx | 2 +- web/app/components/billing/plan/index.tsx | 6 +-- .../billing/pricing/__tests__/footer.spec.tsx | 2 +- .../billing/pricing/__tests__/index.spec.tsx | 2 +- web/app/components/billing/pricing/footer.tsx | 2 +- .../__tests__/index.spec.tsx | 2 +- .../common/retrieval-method-info/index.tsx | 2 +- .../common/retrieval-param-config/index.tsx | 10 ++--- .../__tests__/footer.spec.tsx | 2 +- .../__tests__/index.spec.tsx | 2 +- .../hooks/__tests__/use-dsl-import.spec.tsx | 2 +- .../hooks/use-dsl-import.ts | 2 +- .../datasets/create-from-pipeline/footer.tsx | 4 +- .../datasets/create-from-pipeline/header.tsx | 6 +-- .../list/__tests__/create-card.spec.tsx | 2 +- .../create-from-pipeline/list/create-card.tsx | 6 +-- .../template-card/__tests__/index.spec.tsx | 2 +- .../list/template-card/index.tsx | 2 +- .../datasets/create/__tests__/index.spec.tsx | 2 +- .../__tests__/index.spec.tsx | 4 +- .../create/embedding-process/index.tsx | 6 +-- .../create/embedding-process/rule-detail.tsx | 2 +- .../__tests__/index.spec.tsx | 2 +- .../empty-dataset-creation-modal/index.tsx | 2 +- .../file-uploader/__tests__/index.spec.tsx | 2 +- .../__tests__/file-list-item.spec.tsx | 2 +- .../components/file-list-item.tsx | 2 +- .../__tests__/indexing-mode-section.spec.tsx | 2 +- .../components/__tests__/option-card.spec.tsx | 2 +- .../components/general-chunking-options.tsx | 10 ++--- .../components/indexing-mode-section.tsx | 20 ++++----- .../step-two/components/option-card.tsx | 6 +-- .../components/parent-child-options.tsx | 6 +-- .../create/top-bar/__tests__/index.spec.tsx | 2 +- .../datasets/create/top-bar/index.tsx | 4 +- .../documents/__tests__/index.spec.tsx | 2 +- .../components/__tests__/operations.spec.tsx | 2 +- .../document-list/__tests__/index.spec.tsx | 2 +- .../__tests__/document-table-row.spec.tsx | 2 +- .../components/document-table-row.tsx | 2 +- .../documents/components/operations.tsx | 2 +- .../__tests__/index.spec.tsx | 4 +- .../__tests__/left-header.spec.tsx | 4 +- .../actions/__tests__/index.spec.tsx | 4 +- .../create-from-pipeline/actions/index.tsx | 8 ++-- .../local-file/__tests__/index.spec.tsx | 2 +- .../__tests__/file-list-item.spec.tsx | 2 +- .../local-file/components/file-list-item.tsx | 2 +- .../online-drive/__tests__/utils.spec.ts | 4 +- .../create-from-pipeline/left-header.tsx | 12 ++--- .../__tests__/index.spec.tsx | 4 +- .../__tests__/rule-detail.spec.tsx | 2 +- .../processing/embedding-process/index.tsx | 10 ++--- .../embedding-process/rule-detail.tsx | 2 +- .../steps/__tests__/step-one-content.spec.tsx | 2 +- .../detail/__tests__/document-title.spec.tsx | 2 +- .../documents/detail/__tests__/index.spec.tsx | 2 +- .../detail/__tests__/new-segment.spec.tsx | 2 +- .../detail/completed/__tests__/index.spec.tsx | 2 +- .../__tests__/new-child-segment.spec.tsx | 2 +- .../__tests__/use-segment-list-data.spec.ts | 2 +- .../completed/hooks/use-segment-list-data.ts | 2 +- .../detail/completed/new-child-segment.tsx | 8 ++-- .../documents/detail/document-title.tsx | 2 +- .../embedding/components/rule-detail.tsx | 2 +- .../datasets/documents/detail/index.tsx | 2 +- .../datasets/documents/detail/new-segment.tsx | 8 ++-- .../__tests__/document-settings.spec.tsx | 2 +- .../detail/settings/document-settings.tsx | 2 +- .../__tests__/index.spec.tsx | 2 +- .../__tests__/left-header.spec.tsx | 2 +- .../settings/pipeline-settings/index.tsx | 2 +- .../pipeline-settings/left-header.tsx | 8 ++-- .../components/datasets/documents/index.tsx | 2 +- .../connector/__tests__/index.spec.tsx | 2 +- .../connector/index.tsx | 2 +- .../create/ExternalApiSelect.tsx | 12 ++--- .../create/ExternalApiSelection.tsx | 8 ++-- .../__tests__/ExternalApiSelect.spec.tsx | 2 +- .../__tests__/ExternalApiSelection.spec.tsx | 2 +- .../create/__tests__/index.spec.tsx | 2 +- .../external-knowledge-base/create/index.tsx | 14 +++--- .../extra-info/__tests__/index.spec.tsx | 4 +- .../datasets/extra-info/api-access/card.tsx | 6 +-- .../service-api/__tests__/index.spec.tsx | 4 +- .../datasets/extra-info/service-api/card.tsx | 14 +++--- .../hit-testing/__tests__/index.spec.tsx | 2 +- .../components/query-input/index.tsx | 6 +-- .../datasets/list/__tests__/datasets.spec.tsx | 2 +- .../datasets/list/__tests__/index.spec.tsx | 2 +- .../dataset-card/__tests__/index.spec.tsx | 2 +- .../datasets/list/dataset-card/index.tsx | 2 +- .../datasets/list/new-dataset-card/option.tsx | 4 +- .../__tests__/index.spec.tsx | 2 +- .../__tests__/info-group.spec.tsx | 2 +- .../metadata/metadata-document/info-group.tsx | 8 ++-- .../components/devtools/react-grab/loader.tsx | 2 +- .../components/devtools/react-scan/loader.tsx | 2 +- .../explore/__tests__/index.spec.tsx | 2 +- .../create-app-modal/__tests__/index.spec.tsx | 2 +- .../explore/sidebar/__tests__/index.spec.tsx | 2 +- .../app-nav-item/__tests__/index.spec.tsx | 2 +- .../explore/sidebar/app-nav-item/index.tsx | 6 +-- web/app/components/explore/sidebar/index.tsx | 4 +- .../try-app/app-info/__tests__/index.spec.tsx | 2 +- .../explore/try-app/app-info/index.tsx | 2 +- .../__tests__/command-selector.spec.tsx | 2 +- .../goto-anything/__tests__/context.spec.tsx | 2 +- .../goto-anything/__tests__/index.spec.tsx | 2 +- .../goto-anything/command-selector.tsx | 2 +- web/app/components/goto-anything/context.tsx | 2 +- .../use-goto-anything-navigation.spec.ts | 2 +- .../hooks/use-goto-anything-navigation.ts | 2 +- .../components/header/account-about/index.tsx | 4 +- .../header/account-dropdown/index.spec.tsx | 6 +-- .../header/account-dropdown/index.tsx | 4 +- .../Integrations-page/index.tsx | 2 +- .../install-from-marketplace.spec.tsx | 2 +- .../install-from-marketplace.tsx | 8 ++-- .../header/account-setting/index.spec.tsx | 2 +- .../language-page/index.spec.tsx | 2 +- .../account-setting/language-page/index.tsx | 2 +- .../install-from-marketplace.spec.tsx | 2 +- .../install-from-marketplace.tsx | 8 ++-- .../model-modal/Input.spec.tsx | 4 +- .../status-indicators.tsx | 8 ++-- .../plugin-page/SerpapiPlugin.tsx | 2 +- .../account-setting/plugin-page/index.tsx | 2 +- .../components/header/app-nav/index.spec.tsx | 4 +- web/app/components/header/app-nav/index.tsx | 2 +- .../header/app-selector/index.spec.tsx | 4 +- .../components/header/app-selector/index.tsx | 2 +- .../header/dataset-nav/index.spec.tsx | 8 ++-- .../components/header/dataset-nav/index.tsx | 2 +- .../header/explore-nav/index.spec.tsx | 4 +- .../components/header/explore-nav/index.tsx | 4 +- .../components/header/header-wrapper.spec.tsx | 4 +- web/app/components/header/header-wrapper.tsx | 2 +- web/app/components/header/index.spec.tsx | 2 +- web/app/components/header/index.tsx | 4 +- web/app/components/header/nav/index.spec.tsx | 4 +- web/app/components/header/nav/index.tsx | 4 +- .../header/nav/nav-selector/index.spec.tsx | 4 +- .../header/nav/nav-selector/index.tsx | 4 +- .../header/plugins-nav/index.spec.tsx | 4 +- .../components/header/plugins-nav/index.tsx | 6 +-- .../header/tools-nav/index.spec.tsx | 2 +- web/app/components/header/tools-nav/index.tsx | 4 +- .../__tests__/deprecation-notice.spec.tsx | 2 +- .../plugins/base/deprecation-notice.tsx | 4 +- .../tool-selector/index.tsx | 4 +- .../components/plugins/plugin-page/index.tsx | 2 +- .../components/__tests__/conversion.spec.tsx | 2 +- .../components/__tests__/index.spec.tsx | 2 +- .../rag-pipeline/components/conversion.tsx | 6 +-- .../components/panel/__tests__/index.spec.tsx | 2 +- .../rag-pipeline/components/panel/index.tsx | 2 +- .../__tests__/index.spec.tsx | 4 +- .../publisher/__tests__/index.spec.tsx | 4 +- .../publisher/__tests__/popup.spec.tsx | 4 +- .../rag-pipeline-header/publisher/popup.tsx | 20 ++++----- .../rag-pipeline/components/screenshot.tsx | 2 +- .../__tests__/menu-dropdown.spec.tsx | 2 +- .../share/text-generation/index.tsx | 2 +- .../share/text-generation/menu-dropdown.tsx | 10 ++--- web/app/components/tools/provider/empty.tsx | 2 +- .../__tests__/configure-button.spec.tsx | 2 +- .../__tests__/use-configure-button.spec.ts | 2 +- .../hooks/use-configure-button.ts | 2 +- .../components/workflow-children.tsx | 2 +- .../components/workflow-panel.tsx | 2 +- .../workflow-app/hooks/use-workflow-run.ts | 2 +- web/app/components/workflow-app/index.tsx | 2 +- .../__tests__/workflow-edge-events.spec.tsx | 2 +- .../block-selector/all-start-blocks.tsx | 4 +- .../workflow/block-selector/all-tools.tsx | 4 +- .../block-selector/featured-tools.tsx | 12 ++--- .../block-selector/featured-triggers.tsx | 12 ++--- .../market-place-plugin/list.tsx | 8 ++-- .../rag-tool-recommendations/index.tsx | 8 ++-- web/app/components/workflow/header/index.tsx | 4 +- web/app/components/workflow/index.tsx | 2 +- .../components/agent-strategy-selector.tsx | 2 +- .../nodes/_base/components/agent-strategy.tsx | 2 +- .../components/switch-plugin-version.tsx | 4 +- web/app/components/workflow/panel/index.tsx | 2 +- .../education-apply/education-apply-page.tsx | 26 +++++------ .../education-apply/expire-notice-modal.tsx | 12 ++--- web/app/education-apply/hooks.ts | 2 +- web/app/education-apply/user-info.tsx | 8 ++-- .../forgot-password/ChangePasswordForm.tsx | 2 +- .../ForgotPasswordForm.spec.tsx | 2 +- .../forgot-password/ForgotPasswordForm.tsx | 4 +- web/app/forgot-password/page.tsx | 2 +- web/app/init/InitPasswordPopup.tsx | 2 +- web/app/install/installForm.spec.tsx | 2 +- web/app/install/installForm.tsx | 8 ++-- web/app/layout.tsx | 4 +- web/app/page.tsx | 2 +- .../repos/[owner]/[repo]/releases/route.ts | 4 +- web/app/reset-password/check-code/page.tsx | 10 ++--- web/app/reset-password/page.tsx | 12 ++--- web/app/reset-password/set-password/page.tsx | 14 +++--- web/app/routePrefixHandle.tsx | 2 +- web/app/signin/_header.tsx | 2 +- web/app/signin/check-code/page.tsx | 4 +- .../signin/components/mail-and-code-auth.tsx | 4 +- .../components/mail-and-password-auth.tsx | 4 +- web/app/signin/components/social-auth.tsx | 2 +- web/app/signin/components/sso-auth.tsx | 2 +- web/app/signin/invite-settings/page.tsx | 4 +- web/app/signin/normal-form.tsx | 4 +- web/app/signin/one-more-step.tsx | 18 ++++---- web/app/signin/page.tsx | 4 +- web/app/signup/check-code/page.tsx | 10 ++--- web/app/signup/components/input-mail.spec.tsx | 2 +- web/app/signup/components/input-mail.tsx | 10 ++--- web/app/signup/page.tsx | 6 +-- web/app/signup/set-password/page.tsx | 12 ++--- web/context/modal-context-provider.tsx | 2 +- web/context/modal-context.test.tsx | 2 +- web/context/web-app-context.tsx | 2 +- web/docs/test.md | 6 +-- web/eslint.config.mjs | 7 +++ web/hooks/use-import-dsl.ts | 2 +- web/hooks/use-pay.tsx | 2 +- web/i18n-config/server.ts | 2 +- web/next.config.ts | 1 + web/next/dynamic.ts | 2 + web/next/font/google.ts | 2 + web/next/headers.ts | 2 + web/next/image.ts | 2 + web/next/index.ts | 2 + web/next/link.ts | 2 + web/next/navigation.ts | 9 ++++ web/next/script.ts | 2 + web/next/server.ts | 3 ++ web/proxy.ts | 4 +- web/vitest.setup.ts | 4 +- 386 files changed, 847 insertions(+), 813 deletions(-) create mode 100644 web/next/dynamic.ts create mode 100644 web/next/font/google.ts create mode 100644 web/next/headers.ts create mode 100644 web/next/image.ts create mode 100644 web/next/index.ts create mode 100644 web/next/link.ts create mode 100644 web/next/navigation.ts create mode 100644 web/next/script.ts create mode 100644 web/next/server.ts diff --git a/web/__tests__/apps/app-card-operations-flow.test.tsx b/web/__tests__/apps/app-card-operations-flow.test.tsx index c3e8410955..c5766878a1 100644 --- a/web/__tests__/apps/app-card-operations-flow.test.tsx +++ b/web/__tests__/apps/app-card-operations-flow.test.tsx @@ -29,7 +29,7 @@ const mockOnPlanInfoChanged = vi.fn() const mockDeleteAppMutation = vi.fn().mockResolvedValue(undefined) let mockDeleteMutationPending = false -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: mockRouterPush, }), @@ -57,7 +57,7 @@ vi.mock('@headlessui/react', async () => { } }) -vi.mock('next/dynamic', () => ({ +vi.mock('@/next/dynamic', () => ({ default: (loader: () => Promise<{ default: React.ComponentType }>) => { let Component: React.ComponentType> | null = null loader().then((mod) => { diff --git a/web/__tests__/apps/app-list-browsing-flow.test.tsx b/web/__tests__/apps/app-list-browsing-flow.test.tsx index 079f667dbc..1be7e56086 100644 --- a/web/__tests__/apps/app-list-browsing-flow.test.tsx +++ b/web/__tests__/apps/app-list-browsing-flow.test.tsx @@ -38,7 +38,7 @@ let mockShowTagManagementModal = false const mockRouterPush = vi.fn() const mockRouterReplace = vi.fn() -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: mockRouterPush, replace: mockRouterReplace, @@ -46,7 +46,7 @@ vi.mock('next/navigation', () => ({ useSearchParams: () => new URLSearchParams(), })) -vi.mock('next/dynamic', () => ({ +vi.mock('@/next/dynamic', () => ({ default: (_loader: () => Promise<{ default: React.ComponentType }>) => { const LazyComponent = (props: Record) => { return
diff --git a/web/__tests__/apps/create-app-flow.test.tsx b/web/__tests__/apps/create-app-flow.test.tsx index 4ac9824ddd..bc1f7a3a06 100644 --- a/web/__tests__/apps/create-app-flow.test.tsx +++ b/web/__tests__/apps/create-app-flow.test.tsx @@ -35,7 +35,7 @@ const mockRouterPush = vi.fn() const mockRouterReplace = vi.fn() const mockOnPlanInfoChanged = vi.fn() -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: mockRouterPush, replace: mockRouterReplace, @@ -117,7 +117,7 @@ vi.mock('ahooks', async () => { }) // Mock dynamically loaded modals with test stubs -vi.mock('next/dynamic', () => ({ +vi.mock('@/next/dynamic', () => ({ default: (loader: () => Promise<{ default: React.ComponentType }>) => { let Component: React.ComponentType> | null = null loader().then((mod) => { diff --git a/web/__tests__/billing/billing-integration.test.tsx b/web/__tests__/billing/billing-integration.test.tsx index 4891760df4..64d358cbe6 100644 --- a/web/__tests__/billing/billing-integration.test.tsx +++ b/web/__tests__/billing/billing-integration.test.tsx @@ -64,7 +64,7 @@ vi.mock('@/service/use-education', () => ({ // ─── Navigation mocks ─────────────────────────────────────────────────────── const mockRouterPush = vi.fn() -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: mockRouterPush }), usePathname: () => '/billing', useSearchParams: () => new URLSearchParams(), diff --git a/web/__tests__/billing/cloud-plan-payment-flow.test.tsx b/web/__tests__/billing/cloud-plan-payment-flow.test.tsx index e01d9250fd..bd3b6aa8d8 100644 --- a/web/__tests__/billing/cloud-plan-payment-flow.test.tsx +++ b/web/__tests__/billing/cloud-plan-payment-flow.test.tsx @@ -54,7 +54,7 @@ vi.mock('@/app/components/base/toast', () => ({ })) // ─── Navigation mocks ─────────────────────────────────────────────────────── -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: vi.fn() }), usePathname: () => '/billing', useSearchParams: () => new URLSearchParams(), diff --git a/web/__tests__/billing/education-verification-flow.test.tsx b/web/__tests__/billing/education-verification-flow.test.tsx index 8c35cd9a8c..707f1d690a 100644 --- a/web/__tests__/billing/education-verification-flow.test.tsx +++ b/web/__tests__/billing/education-verification-flow.test.tsx @@ -63,7 +63,7 @@ vi.mock('@/service/use-billing', () => ({ })) // ─── Navigation mocks ─────────────────────────────────────────────────────── -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: mockRouterPush }), usePathname: () => '/billing', useSearchParams: () => new URLSearchParams(), diff --git a/web/__tests__/billing/partner-stack-flow.test.tsx b/web/__tests__/billing/partner-stack-flow.test.tsx index 4f265478cd..fe642ac70b 100644 --- a/web/__tests__/billing/partner-stack-flow.test.tsx +++ b/web/__tests__/billing/partner-stack-flow.test.tsx @@ -18,7 +18,7 @@ let mockSearchParams = new URLSearchParams() const mockMutateAsync = vi.fn() // ─── Module mocks ──────────────────────────────────────────────────────────── -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useSearchParams: () => mockSearchParams, useRouter: () => ({ push: vi.fn() }), usePathname: () => '/', diff --git a/web/__tests__/billing/pricing-modal-flow.test.tsx b/web/__tests__/billing/pricing-modal-flow.test.tsx index 6b8fb57f83..3e9200c63f 100644 --- a/web/__tests__/billing/pricing-modal-flow.test.tsx +++ b/web/__tests__/billing/pricing-modal-flow.test.tsx @@ -51,7 +51,7 @@ vi.mock('@/hooks/use-async-window-open', () => ({ })) // ─── Navigation mocks ─────────────────────────────────────────────────────── -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ push: vi.fn() }), usePathname: () => '/billing', useSearchParams: () => new URLSearchParams(), diff --git a/web/__tests__/datasets/document-management.test.tsx b/web/__tests__/datasets/document-management.test.tsx index 8aedd4fc63..f9d80520ed 100644 --- a/web/__tests__/datasets/document-management.test.tsx +++ b/web/__tests__/datasets/document-management.test.tsx @@ -13,7 +13,7 @@ import { DataSourceType } from '@/models/datasets' import { renderHookWithNuqs } from '@/test/nuqs-testing' const mockPush = vi.fn() -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useSearchParams: () => new URLSearchParams(''), useRouter: () => ({ push: mockPush }), usePathname: () => '/datasets/ds-1/documents', diff --git a/web/__tests__/document-detail-navigation-fix.test.tsx b/web/__tests__/document-detail-navigation-fix.test.tsx index 6b348cd15b..5cb115830e 100644 --- a/web/__tests__/document-detail-navigation-fix.test.tsx +++ b/web/__tests__/document-detail-navigation-fix.test.tsx @@ -7,12 +7,12 @@ import type { Mock } from 'vitest' */ import { fireEvent, render, screen } from '@testing-library/react' -import { useRouter } from 'next/navigation' +import { useRouter } from '@/next/navigation' import { useDocumentDetail, useDocumentMetadata } from '@/service/knowledge/use-document' // Mock Next.js router const mockPush = vi.fn() -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: vi.fn(() => ({ push: mockPush, })), diff --git a/web/__tests__/embedded-user-id-auth.test.tsx b/web/__tests__/embedded-user-id-auth.test.tsx index 9231ac6199..cacd6331f8 100644 --- a/web/__tests__/embedded-user-id-auth.test.tsx +++ b/web/__tests__/embedded-user-id-auth.test.tsx @@ -8,7 +8,7 @@ const replaceMock = vi.fn() const backMock = vi.fn() const useSearchParamsMock = vi.fn(() => new URLSearchParams()) -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ usePathname: vi.fn(() => '/chatbot/test-app'), useRouter: vi.fn(() => ({ replace: replaceMock, diff --git a/web/__tests__/embedded-user-id-store.test.tsx b/web/__tests__/embedded-user-id-store.test.tsx index 901218e76b..04597ccfeb 100644 --- a/web/__tests__/embedded-user-id-store.test.tsx +++ b/web/__tests__/embedded-user-id-store.test.tsx @@ -4,7 +4,7 @@ import WebAppStoreProvider, { useWebAppStore } from '@/context/web-app-context' import { AccessMode } from '@/models/access-control' -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ usePathname: vi.fn(() => '/chatbot/sample-app'), useSearchParams: vi.fn(() => { const params = new URLSearchParams() diff --git a/web/__tests__/explore/sidebar-lifecycle-flow.test.tsx b/web/__tests__/explore/sidebar-lifecycle-flow.test.tsx index e2c18bcc4f..77f493ab18 100644 --- a/web/__tests__/explore/sidebar-lifecycle-flow.test.tsx +++ b/web/__tests__/explore/sidebar-lifecycle-flow.test.tsx @@ -19,7 +19,7 @@ const mockUninstall = vi.fn() const mockUpdatePinStatus = vi.fn() let mockInstalledApps: InstalledApp[] = [] -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useSelectedLayoutSegments: () => mockSegments, useRouter: () => ({ push: mockPush, diff --git a/web/__tests__/share/text-generation-index-flow.test.tsx b/web/__tests__/share/text-generation-index-flow.test.tsx index 3292474bec..2fec054a47 100644 --- a/web/__tests__/share/text-generation-index-flow.test.tsx +++ b/web/__tests__/share/text-generation-index-flow.test.tsx @@ -5,7 +5,7 @@ import TextGeneration from '@/app/components/share/text-generation' const useSearchParamsMock = vi.fn(() => new URLSearchParams()) -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useSearchParams: () => useSearchParamsMock(), })) diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx index fd0bf2c8bd..0c87fd1a4d 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx @@ -13,8 +13,6 @@ import { RiTerminalWindowLine, } from '@remixicon/react' import { useUnmount } from 'ahooks' -import dynamic from 'next/dynamic' -import { usePathname, useRouter } from 'next/navigation' import * as React from 'react' import { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -26,6 +24,8 @@ import { useStore as useTagStore } from '@/app/components/base/tag-management/st import { useAppContext } from '@/context/app-context' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import useDocumentTitle from '@/hooks/use-document-title' +import dynamic from '@/next/dynamic' +import { usePathname, useRouter } from '@/next/navigation' import { fetchAppDetailDirect } from '@/service/apps' import { AppModeEnum } from '@/types/app' import { cn } from '@/utils/classnames' diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx index 5e7d98d191..1a2ec30ff9 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx @@ -7,7 +7,6 @@ import { RiEqualizer2Line, } from '@remixicon/react' import { useBoolean } from 'ahooks' -import { usePathname } from 'next/navigation' import * as React from 'react' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -17,6 +16,7 @@ import Loading from '@/app/components/base/loading' import Toast from '@/app/components/base/toast' import Indicator from '@/app/components/header/indicator' import { useAppContext } from '@/context/app-context' +import { usePathname } from '@/next/navigation' import { fetchTracingConfig as doFetchTracingConfig, fetchTracingStatus, updateTracingStatus } from '@/service/apps' import { cn } from '@/utils/classnames' import ConfigButton from './config-button' @@ -254,7 +254,7 @@ const Panel: FC = () => { )} > -
{t(`${I18N_PREFIX}.title`, { ns: 'app' })}
+
{t(`${I18N_PREFIX}.title`, { ns: 'app' })}
@@ -294,7 +294,7 @@ const Panel: FC = () => { >
-
+
{t(`${I18N_PREFIX}.${enabled ? 'enabled' : 'disabled'}`, { ns: 'app' })}
diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx index 4f3f724e62..730b76ee19 100644 --- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx +++ b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx @@ -9,7 +9,6 @@ import { RiFocus2Fill, RiFocus2Line, } from '@remixicon/react' -import { usePathname } from 'next/navigation' import * as React from 'react' import { useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -23,6 +22,7 @@ import DatasetDetailContext from '@/context/dataset-detail' import { useEventEmitterContextContext } from '@/context/event-emitter' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import useDocumentTitle from '@/hooks/use-document-title' +import { usePathname } from '@/next/navigation' import { useDatasetDetail, useDatasetRelatedApps } from '@/service/knowledge/use-dataset' import { cn } from '@/utils/classnames' diff --git a/web/app/(commonLayout)/datasets/layout.spec.tsx b/web/app/(commonLayout)/datasets/layout.spec.tsx index 5873f344d0..9c01cffba8 100644 --- a/web/app/(commonLayout)/datasets/layout.spec.tsx +++ b/web/app/(commonLayout)/datasets/layout.spec.tsx @@ -6,7 +6,7 @@ import DatasetsLayout from './layout' const mockReplace = vi.fn() const mockUseAppContext = vi.fn() -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ useRouter: () => ({ replace: mockReplace, }), diff --git a/web/app/(commonLayout)/datasets/layout.tsx b/web/app/(commonLayout)/datasets/layout.tsx index b543c42570..a465f8222b 100644 --- a/web/app/(commonLayout)/datasets/layout.tsx +++ b/web/app/(commonLayout)/datasets/layout.tsx @@ -1,11 +1,11 @@ 'use client' -import { useRouter } from 'next/navigation' import { useEffect } from 'react' import Loading from '@/app/components/base/loading' import { useAppContext } from '@/context/app-context' import { ExternalApiPanelProvider } from '@/context/external-api-panel-context' import { ExternalKnowledgeApiProvider } from '@/context/external-knowledge-api-context' +import { useRouter } from '@/next/navigation' export default function DatasetsLayout({ children }: { children: React.ReactNode }) { const { isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator, currentWorkspace, isLoadingCurrentWorkspace } = useAppContext() diff --git a/web/app/(commonLayout)/education-apply/page.tsx b/web/app/(commonLayout)/education-apply/page.tsx index fce6fe1d5d..44ba5ee8ad 100644 --- a/web/app/(commonLayout)/education-apply/page.tsx +++ b/web/app/(commonLayout)/education-apply/page.tsx @@ -1,15 +1,15 @@ 'use client' -import { - useRouter, - useSearchParams, -} from 'next/navigation' import { useEffect, useMemo, } from 'react' import EducationApplyPage from '@/app/education-apply/education-apply-page' import { useProviderContext } from '@/context/provider-context' +import { + useRouter, + useSearchParams, +} from '@/next/navigation' export default function EducationApply() { const router = useRouter() diff --git a/web/app/(commonLayout)/role-route-guard.spec.tsx b/web/app/(commonLayout)/role-route-guard.spec.tsx index 87bf9be8af..ca1550f0b8 100644 --- a/web/app/(commonLayout)/role-route-guard.spec.tsx +++ b/web/app/(commonLayout)/role-route-guard.spec.tsx @@ -6,7 +6,7 @@ const mockReplace = vi.fn() const mockUseAppContext = vi.fn() let mockPathname = '/apps' -vi.mock('next/navigation', () => ({ +vi.mock('@/next/navigation', () => ({ usePathname: () => mockPathname, useRouter: () => ({ replace: mockReplace, diff --git a/web/app/(commonLayout)/role-route-guard.tsx b/web/app/(commonLayout)/role-route-guard.tsx index 1c42be9d15..483dfef095 100644 --- a/web/app/(commonLayout)/role-route-guard.tsx +++ b/web/app/(commonLayout)/role-route-guard.tsx @@ -1,10 +1,10 @@ 'use client' import type { ReactNode } from 'react' -import { usePathname, useRouter } from 'next/navigation' import { useEffect } from 'react' import Loading from '@/app/components/base/loading' import { useAppContext } from '@/context/app-context' +import { usePathname, useRouter } from '@/next/navigation' const datasetOperatorRedirectRoutes = ['/apps', '/app', '/explore', '/tools'] as const diff --git a/web/app/(humanInputLayout)/form/[token]/form.tsx b/web/app/(humanInputLayout)/form/[token]/form.tsx index d027ef8b7d..2b20cba5b7 100644 --- a/web/app/(humanInputLayout)/form/[token]/form.tsx +++ b/web/app/(humanInputLayout)/form/[token]/form.tsx @@ -9,7 +9,6 @@ import { RiInformation2Fill, } from '@remixicon/react' import { produce } from 'immer' -import { useParams } from 'next/navigation' import * as React from 'react' import { useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -21,6 +20,7 @@ import { getButtonStyle } from '@/app/components/base/chat/chat/answer/human-inp import Loading from '@/app/components/base/loading' import DifyLogo from '@/app/components/base/logo/dify-logo' import useDocumentTitle from '@/hooks/use-document-title' +import { useParams } from '@/next/navigation' import { useGetHumanInputForm, useSubmitHumanInputForm } from '@/service/use-share' import { cn } from '@/utils/classnames' @@ -106,17 +106,17 @@ const FormContent = () => {
-
{t('humanInput.thanks', { ns: 'share' })}
-
{t('humanInput.recorded', { ns: 'share' })}
+
{t('humanInput.thanks', { ns: 'share' })}
+
{t('humanInput.recorded', { ns: 'share' })}
-
{t('humanInput.submissionID', { id: token, ns: 'share' })}
+
{t('humanInput.submissionID', { id: token, ns: 'share' })}
-
{t('chat.poweredBy', { ns: 'share' })}
+
{t('chat.poweredBy', { ns: 'share' })}
@@ -134,17 +134,17 @@ const FormContent = () => {
-
{t('humanInput.sorry', { ns: 'share' })}
-
{t('humanInput.expired', { ns: 'share' })}
+
{t('humanInput.sorry', { ns: 'share' })}
+
{t('humanInput.expired', { ns: 'share' })}
-
{t('humanInput.submissionID', { id: token, ns: 'share' })}
+
{t('humanInput.submissionID', { id: token, ns: 'share' })}
-
{t('chat.poweredBy', { ns: 'share' })}
+
{t('chat.poweredBy', { ns: 'share' })}
@@ -162,17 +162,17 @@ const FormContent = () => {
-
{t('humanInput.sorry', { ns: 'share' })}
-
{t('humanInput.completed', { ns: 'share' })}
+
{t('humanInput.sorry', { ns: 'share' })}
+
{t('humanInput.completed', { ns: 'share' })}
-
{t('humanInput.submissionID', { id: token, ns: 'share' })}
+
{t('humanInput.submissionID', { id: token, ns: 'share' })}
-
{t('chat.poweredBy', { ns: 'share' })}
+
{t('chat.poweredBy', { ns: 'share' })}
@@ -190,7 +190,7 @@ const FormContent = () => {
-
{t('humanInput.rateLimitExceeded', { ns: 'share' })}
+
{t('humanInput.rateLimitExceeded', { ns: 'share' })}
@@ -198,7 +198,7 @@ const FormContent = () => { 'flex shrink-0 items-center gap-1.5 px-1', )} > -
{t('chat.poweredBy', { ns: 'share' })}
+
{t('chat.poweredBy', { ns: 'share' })}
@@ -216,7 +216,7 @@ const FormContent = () => {
-
{t('humanInput.formNotFound', { ns: 'share' })}
+
{t('humanInput.formNotFound', { ns: 'share' })}
@@ -224,7 +224,7 @@ const FormContent = () => { 'flex shrink-0 items-center gap-1.5 px-1', )} > -
{t('chat.poweredBy', { ns: 'share' })}
+
{t('chat.poweredBy', { ns: 'share' })}
@@ -245,7 +245,7 @@ const FormContent = () => { background={site.icon_background} imageUrl={site.icon_url} /> -
{site.title}
+
{site.title}
@@ -277,7 +277,7 @@ const FormContent = () => { 'flex shrink-0 items-center gap-1.5 px-1', )} > -
{t('chat.poweredBy', { ns: 'share' })}
+
{t('chat.poweredBy', { ns: 'share' })}
diff --git a/web/app/(shareLayout)/components/authenticated-layout.tsx b/web/app/(shareLayout)/components/authenticated-layout.tsx index c874990448..420b11c6f5 100644 --- a/web/app/(shareLayout)/components/authenticated-layout.tsx +++ b/web/app/(shareLayout)/components/authenticated-layout.tsx @@ -1,12 +1,12 @@ 'use client' -import { usePathname, useRouter, useSearchParams } from 'next/navigation' import * as React from 'react' import { useCallback, useEffect } from 'react' import { useTranslation } from 'react-i18next' import AppUnavailable from '@/app/components/base/app-unavailable' import Loading from '@/app/components/base/loading' import { useWebAppStore } from '@/context/web-app-context' +import { usePathname, useRouter, useSearchParams } from '@/next/navigation' import { useGetUserCanAccessApp } from '@/service/access-control' import { useGetWebAppInfo, useGetWebAppMeta, useGetWebAppParams } from '@/service/use-share' import { webAppLogout } from '@/service/webapp-auth' @@ -81,7 +81,7 @@ const AuthenticatedLayout = ({ children }: { children: React.ReactNode }) => { return (
- {t('userProfile.logout', { ns: 'common' })} + {t('userProfile.logout', { ns: 'common' })}
) } diff --git a/web/app/(shareLayout)/components/splash.tsx b/web/app/(shareLayout)/components/splash.tsx index a2b847f74f..1177fc507d 100644 --- a/web/app/(shareLayout)/components/splash.tsx +++ b/web/app/(shareLayout)/components/splash.tsx @@ -1,11 +1,11 @@ 'use client' import type { FC, PropsWithChildren } from 'react' -import { useRouter, useSearchParams } from 'next/navigation' import { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import AppUnavailable from '@/app/components/base/app-unavailable' import Loading from '@/app/components/base/loading' import { useWebAppStore } from '@/context/web-app-context' +import { useRouter, useSearchParams } from '@/next/navigation' import { fetchAccessToken } from '@/service/share' import { setWebAppAccessToken, setWebAppPassport, webAppLoginStatus, webAppLogout } from '@/service/webapp-auth' @@ -95,7 +95,7 @@ const Splash: FC = ({ children }) => { return (
- {code === '403' ? t('userProfile.logout', { ns: 'common' }) : t('login.backToHome', { ns: 'share' })} + {code === '403' ? t('userProfile.logout', { ns: 'common' }) : t('login.backToHome', { ns: 'share' })}
) } diff --git a/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx b/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx index fbf45259e5..fed6878c73 100644 --- a/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx +++ b/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx @@ -1,14 +1,14 @@ 'use client' import { RiArrowLeftLine, RiMailSendFill } from '@remixicon/react' -import { useRouter, useSearchParams } from 'next/navigation' import { useState } from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import Input from '@/app/components/base/input' import Toast from '@/app/components/base/toast' import Countdown from '@/app/components/signin/countdown' - import { useLocale } from '@/context/i18n' + +import { useRouter, useSearchParams } from '@/next/navigation' import { sendWebAppResetPasswordCode, verifyWebAppResetPasswordCode } from '@/service/common' export default function CheckCode() { @@ -69,8 +69,8 @@ export default function CheckCode() {
-

{t('checkCode.checkYourEmail', { ns: 'login' })}

-

+

{t('checkCode.checkYourEmail', { ns: 'login' })}

+

{t('checkCode.tipsPrefix', { ns: 'login' })} {email} @@ -82,7 +82,7 @@ export default function CheckCode() {

- + setVerifyCode(e.target.value)} maxLength={6} className="mt-1" placeholder={t('checkCode.verificationCodePlaceholder', { ns: 'login' }) || ''} /> @@ -94,7 +94,7 @@ export default function CheckCode() {
- {t('back', { ns: 'login' })} + {t('back', { ns: 'login' })}
) diff --git a/web/app/(shareLayout)/webapp-reset-password/page.tsx b/web/app/(shareLayout)/webapp-reset-password/page.tsx index 9b9a853cdd..d141d417cc 100644 --- a/web/app/(shareLayout)/webapp-reset-password/page.tsx +++ b/web/app/(shareLayout)/webapp-reset-password/page.tsx @@ -1,8 +1,6 @@ 'use client' import { RiArrowLeftLine, RiLockPasswordLine } from '@remixicon/react' import { noop } from 'es-toolkit/function' -import Link from 'next/link' -import { useRouter, useSearchParams } from 'next/navigation' import { useState } from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' @@ -10,9 +8,11 @@ import Input from '@/app/components/base/input' import Toast from '@/app/components/base/toast' import { COUNT_DOWN_KEY, COUNT_DOWN_TIME_MS } from '@/app/components/signin/countdown' import { emailRegex } from '@/config' - import { useLocale } from '@/context/i18n' import useDocumentTitle from '@/hooks/use-document-title' + +import Link from '@/next/link' +import { useRouter, useSearchParams } from '@/next/navigation' import { sendResetPasswordCode } from '@/service/common' export default function CheckCode() { @@ -74,8 +74,8 @@ export default function CheckCode() {
-

{t('resetPassword', { ns: 'login' })}

-

+

{t('resetPassword', { ns: 'login' })}

+

{t('resetPasswordDesc', { ns: 'login' })}

@@ -83,7 +83,7 @@ export default function CheckCode() {
- +
setEmail(e.target.value)} />
@@ -99,7 +99,7 @@ export default function CheckCode() {
- {t('backToLogin', { ns: 'login' })} + {t('backToLogin', { ns: 'login' })}
) diff --git a/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx b/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx index 9f59e8f9eb..453c2a73c5 100644 --- a/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx +++ b/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx @@ -1,13 +1,13 @@ 'use client' import { RiCheckboxCircleFill } from '@remixicon/react' import { useCountDown } from 'ahooks' -import { useRouter, useSearchParams } from 'next/navigation' import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import Input from '@/app/components/base/input' import Toast from '@/app/components/base/toast' import { validPassword } from '@/config' +import { useRouter, useSearchParams } from '@/next/navigation' import { changeWebAppPasswordWithToken } from '@/service/common' import { cn } from '@/utils/classnames' @@ -91,10 +91,10 @@ const ChangePasswordForm = () => { {!showSuccess && (
-

+

{t('changePassword', { ns: 'login' })}

-

+

{t('changePasswordTip', { ns: 'login' })}

@@ -103,7 +103,7 @@ const ChangePasswordForm = () => {
{/* Password */}
-
-
{t('error.passwordInvalid', { ns: 'login' })}
+
{t('error.passwordInvalid', { ns: 'login' })}
{/* Confirm Password */}
-
-

{t('checkCode.checkYourEmail', { ns: 'login' })}

-

+

{t('checkCode.checkYourEmail', { ns: 'login' })}

+

{t('checkCode.tipsPrefix', { ns: 'login' })} {email} @@ -122,7 +122,7 @@ export default function CheckCode() {

- +
- {t('back', { ns: 'login' })} + {t('back', { ns: 'login' })} ) diff --git a/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx index 0776df036d..391479c870 100644 --- a/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx +++ b/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx @@ -1,11 +1,11 @@ 'use client' -import { useRouter, useSearchParams } from 'next/navigation' import * as React from 'react' import { useCallback, useEffect } from 'react' import AppUnavailable from '@/app/components/base/app-unavailable' import Loading from '@/app/components/base/loading' import Toast from '@/app/components/base/toast' import { useGlobalPublicStore } from '@/context/global-public-context' +import { useRouter, useSearchParams } from '@/next/navigation' import { fetchWebOAuth2SSOUrl, fetchWebOIDCSSOUrl, fetchWebSAMLSSOUrl } from '@/service/share' import { SSOProtocol } from '@/types/feature' diff --git a/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx index 5aa9d9f141..af1345dd86 100644 --- a/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx +++ b/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx @@ -1,5 +1,4 @@ import { noop } from 'es-toolkit/function' -import { useRouter, useSearchParams } from 'next/navigation' import { useState } from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' @@ -8,6 +7,7 @@ import Toast from '@/app/components/base/toast' import { COUNT_DOWN_KEY, COUNT_DOWN_TIME_MS } from '@/app/components/signin/countdown' import { emailRegex } from '@/config' import { useLocale } from '@/context/i18n' +import { useRouter, useSearchParams } from '@/next/navigation' import { sendWebAppEMailLoginCode } from '@/service/common' export default function MailAndCodeAuth() { @@ -55,7 +55,7 @@ export default function MailAndCodeAuth() {
- +
setEmail(e.target.value)} />
diff --git a/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx index e49559401d..205c310640 100644 --- a/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx +++ b/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx @@ -1,7 +1,5 @@ 'use client' import { noop } from 'es-toolkit/function' -import Link from 'next/link' -import { useRouter, useSearchParams } from 'next/navigation' import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' @@ -10,6 +8,8 @@ import Toast from '@/app/components/base/toast' import { emailRegex } from '@/config' import { useLocale } from '@/context/i18n' import { useWebAppStore } from '@/context/web-app-context' +import Link from '@/next/link' +import { useRouter, useSearchParams } from '@/next/navigation' import { webAppLogin } from '@/service/common' import { fetchAccessToken } from '@/service/share' import { setWebAppAccessToken, setWebAppPassport } from '@/service/webapp-auth' @@ -112,7 +112,7 @@ export default function MailAndPasswordAuth({ isEmailSetup }: MailAndPasswordAut return (
-
@@ -76,8 +76,8 @@ const NormalForm = () => { -

{t('licenseExpired', { ns: 'login' })}

-

{t('licenseExpiredTip', { ns: 'login' })}

+

{t('licenseExpired', { ns: 'login' })}

+

{t('licenseExpiredTip', { ns: 'login' })}

@@ -92,8 +92,8 @@ const NormalForm = () => { -

{t('licenseInactive', { ns: 'login' })}

-

{t('licenseInactiveTip', { ns: 'login' })}

+

{t('licenseInactive', { ns: 'login' })}

+

{t('licenseInactiveTip', { ns: 'login' })}

@@ -104,8 +104,8 @@ const NormalForm = () => { <>
-

{systemFeatures.branding.enabled ? t('pageTitleForE', { ns: 'login' }) : t('pageTitle', { ns: 'login' })}

-

{t('welcome', { ns: 'login' })}

+

{systemFeatures.branding.enabled ? t('pageTitleForE', { ns: 'login' }) : t('pageTitle', { ns: 'login' })}

+

{t('welcome', { ns: 'login' })}

@@ -122,7 +122,7 @@ const NormalForm = () => {
- {t('or', { ns: 'login' })} + {t('or', { ns: 'login' })}
)} @@ -134,7 +134,7 @@ const NormalForm = () => { {systemFeatures.enable_email_password_login && (
{ updateAuthType('password') }}> - {t('usePassword', { ns: 'login' })} + {t('usePassword', { ns: 'login' })}
)} @@ -144,7 +144,7 @@ const NormalForm = () => { {systemFeatures.enable_email_code_login && (
{ updateAuthType('code') }}> - {t('useVerificationCode', { ns: 'login' })} + {t('useVerificationCode', { ns: 'login' })}
)} @@ -158,8 +158,8 @@ const NormalForm = () => {
-

{t('noLoginMethod', { ns: 'login' })}

-

{t('noLoginMethodTip', { ns: 'login' })}

+

{t('noLoginMethod', { ns: 'login' })}

+

{t('noLoginMethodTip', { ns: 'login' })}