From 842110a60177ba6c5948f9307ffbe8cf54d134c5 Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:33:37 +0800 Subject: [PATCH] refactor(web): migrate subscription create modal to dialog (#35721) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- eslint-suppressions.json | 5 - .../create/__tests__/common-modal.spec.tsx | 32 +---- .../subscription-list/create/common-modal.tsx | 130 +++++++++++++----- 3 files changed, 93 insertions(+), 74 deletions(-) diff --git a/eslint-suppressions.json b/eslint-suppressions.json index e58da286aa..1db5e1bc59 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -3331,11 +3331,6 @@ "count": 2 } }, - "web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.tsx": { - "no-restricted-imports": { - "count": 1 - } - }, "web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts": { "erasable-syntax-only/enums": { "count": 1 diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsx index 459b657f3f..af52ec14f0 100644 --- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsx +++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsx @@ -1,6 +1,6 @@ +import type * as React from 'react' import type { TriggerSubscriptionBuilder } from '@/app/components/workflow/block-selector/types' import { act, fireEvent, render, screen, waitFor } from '@testing-library/react' -import * as React from 'react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { SupportedCreationMethods } from '@/app/components/plugins/types' import { TriggerCredentialTypeEnum } from '@/app/components/workflow/block-selector/types' @@ -134,36 +134,6 @@ vi.mock('@langgenius/dify-ui/toast', () => ({ }), })) -vi.mock('@/app/components/base/modal/modal', () => ({ - default: ({ - children, - onClose, - onConfirm, - title, - confirmButtonText, - bottomSlot, - size, - disabled, - }: { - children: React.ReactNode - onClose: () => void - onConfirm: () => void - title: string - confirmButtonText: string - bottomSlot?: React.ReactNode - size?: string - disabled?: boolean - }) => ( -