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 OAuth redirect copy action (#40303)

yyh7a72bb35712f
diff --git a/web/app/components/plugins/plugin-auth/authorize/__tests__/add-oauth-button.spec.tsx b/web/app/components/plugins/plugin-auth/authorize/__tests__/add-oauth-button.spec.tsx
index cadc7332e3d..fcbd90d5071 100644
--- a/web/app/components/plugins/plugin-auth/authorize/__tests__/add-oauth-button.spec.tsx
+++ b/web/app/components/plugins/plugin-auth/authorize/__tests__/add-oauth-button.spec.tsx
@@ -1,6 +1,6 @@
import type { OAuthClientSettingsProps } from '../oauth-client-settings'
import type { FormSchema } from '@/app/components/base/form/types'
-import { fireEvent, render, screen, waitFor, within } from '@testing-library/react'
+import { fireEvent, render, screen, waitFor } from '@testing-library/react'
import * as React from 'react'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { AuthCategory } from '../../types'
@@ -248,7 +248,7 @@ describe('AddOAuthButton', () => {
})
expect(screen.getByText('https://redirect.example.com')).toBeInTheDocument()
- fireEvent.click(within(screen.getByTestId('oauth-schema-label-client_id')).getByRole('button'))
+ fireEvent.click(screen.getByRole('button', { name: 'common.operation.copy' }))
expect(mockWriteText).toHaveBeenCalledWith('https://redirect.example.com')
})
diff --git a/web/app/components/plugins/plugin-auth/authorize/add-oauth-button.tsx b/web/app/components/plugins/plugin-auth/authorize/add-oauth-button.tsx
index a9b54b20bfe..161182defb9 100644
--- a/web/app/components/plugins/plugin-auth/authorize/add-oauth-button.tsx
+++ b/web/app/components/plugins/plugin-auth/authorize/add-oauth-button.tsx
@@ -101,12 +101,13 @@ const AddOAuthButton = ({
<div className="flex w-full py-0.5 system-sm-medium">
<div className="w-0 grow wrap-break-word break-all">{redirect_uri}</div>
<ActionButton
+ aria-label={t(($) => $['operation.copy'], { ns: 'common' })}
className="shrink-0"
onClick={() => {
navigator.clipboard.writeText(redirect_uri || '')
}}
>
- <span className="i-ri-clipboard-line size-4" />
+ <span aria-hidden className="i-ri-clipboard-line size-4" />
</ActionButton>
</div>
)}