fix(agent-v2): open workflow references in new tab

This commit is contained in:
yyh 2026-06-23 18:29:25 +08:00
parent 53b59eea8b
commit 6dd394edee
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -97,8 +97,10 @@ describe('WorkflowReferencesTable', () => {
expect(screen.getByText('v3')).toBeInTheDocument()
expect(screen.getByText('agentV2.agentDetail.access.workflow.nodeCount:{"count":2}')).toBeInTheDocument()
expect(screen.getByText('formatted-1781660000')).toBeInTheDocument()
expect(screen.getByRole('link', { name: 'agentV2.agentDetail.access.workflow.openInStudioFor:{"name":"Support Workflow"}' }))
.toHaveAttribute('href', '/app/workflow-app-id/workflow')
const studioLink = screen.getByRole('link', { name: 'agentV2.agentDetail.access.workflow.openInStudioFor:{"name":"Support Workflow"}' })
expect(studioLink).toHaveAttribute('href', '/app/workflow-app-id/workflow')
expect(studioLink).toHaveAttribute('target', '_blank')
expect(studioLink).toHaveAttribute('rel', 'noopener noreferrer')
})
it('should render an empty state when the agent has no workflow references', async () => {

View File

@ -145,6 +145,8 @@ function WorkflowAccessRow({
<td className="px-3">
<Link
href={getWorkflowReferenceHref(reference)}
target="_blank"
rel="noopener noreferrer"
aria-label={t('agentDetail.access.workflow.openInStudioFor', { name: reference.app_name })}
className="inline-flex items-center gap-0.5 rounded-sm text-text-secondary hover:text-text-accent hover:underline focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden"
>