Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): name plugin detail close action (#40264)

yyhe8afed13cc3b
diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx
index e849f6ef2bd..83ab818f14a 100644
--- a/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx
@@ -45,10 +45,8 @@ vi.mock('@/utils/var', () => ({
}))
vi.mock('@/app/components/base/action-button', () => ({
- default: ({ onClick, children }: { onClick?: () => void; children: React.ReactNode }) => (
- <button data-testid="close-button" onClick={onClick}>
- {children}
- </button>
+ default: ({ children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>) => (
+ <button {...props}>{children}</button>
),
}))
@@ -219,7 +217,7 @@ describe('DetailHeader', () => {
render(<DetailHeader detail={createDetail()} onHide={onHide} onUpdate={vi.fn()} />)
fireEvent.click(screen.getByText('plugin.detailPanel.operation.update'))
- fireEvent.click(screen.getByTestId('close-button'))
+ fireEvent.click(screen.getByRole('button', { name: 'common.operation.close' }))
expect(mockHandleUpdate).toHaveBeenCalledTimes(1)
expect(onHide).toHaveBeenCalled()
diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx
index c5fb5894d5b..23d4c992fe0 100644
--- a/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx
@@ -310,7 +310,10 @@ const DetailHeader = ({
showCheckVersion={canUpdatePlugin}
showRemove={canDeletePlugin}
/>
- <ActionButton onClick={onHide}>
+ <ActionButton
+ aria-label={t(($) => $['operation.close'], { ns: 'common' })}
+ onClick={onHide}
+ >
<span aria-hidden className="i-ri-close-line size-4" />
</ActionButton>
</div>