From 195ff4711d08471f70e2162c49a76c57776c7d10 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 ced0d27afe..183560f81b 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -3167,11 +3167,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 - }) => ( -