From 6da44b0571f6ec3a5cfd91c90d59148ad6a546ed Mon Sep 17 00:00:00 2001 From: Yoona Oh Date: Mon, 2 Dec 2024 11:32:18 -0800 Subject: [PATCH] [DC] Use href and target instead of onClick for opening URLs (#7923) (#7924) Co-authored-by: Yoona Oh --- .../DeploymentCenterBitbucketConfiguredView.tsx | 2 +- .../code/DeploymentCenterGitHubActionsCodeLogs.tsx | 2 +- .../deployment-center/code/DeploymentCenterVSTSCodeLogs.tsx | 5 +---- .../DeploymentCenterVstsBuildConfiguredView.tsx | 5 +++-- .../DeploymentCenterExternalConfiguredView.tsx | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/client-react/src/pages/app/deployment-center/bitbucket-provider/DeploymentCenterBitbucketConfiguredView.tsx b/client-react/src/pages/app/deployment-center/bitbucket-provider/DeploymentCenterBitbucketConfiguredView.tsx index 3116aa67d3..5e92ee7d63 100644 --- a/client-react/src/pages/app/deployment-center/bitbucket-provider/DeploymentCenterBitbucketConfiguredView.tsx +++ b/client-react/src/pages/app/deployment-center/bitbucket-provider/DeploymentCenterBitbucketConfiguredView.tsx @@ -152,7 +152,7 @@ const DeploymentCenterBitbucketConfiguredView: React.FC { if (!isBranchInfoMissing) { return ( - window.open(repoUrl, '_blank')} aria-label={`${branch}`}> + {`${branch} `} diff --git a/client-react/src/pages/app/deployment-center/code/DeploymentCenterGitHubActionsCodeLogs.tsx b/client-react/src/pages/app/deployment-center/code/DeploymentCenterGitHubActionsCodeLogs.tsx index 5b172df5ca..906eb03ba1 100644 --- a/client-react/src/pages/app/deployment-center/code/DeploymentCenterGitHubActionsCodeLogs.tsx +++ b/client-react/src/pages/app/deployment-center/code/DeploymentCenterGitHubActionsCodeLogs.tsx @@ -318,7 +318,7 @@ const DeploymentCenterGitHubActionsCodeLogs: React.FC window.open(run.html_url, '_blank')}> + {t('deploymentCenterBuildDeployLogSource')} diff --git a/client-react/src/pages/app/deployment-center/code/DeploymentCenterVSTSCodeLogs.tsx b/client-react/src/pages/app/deployment-center/code/DeploymentCenterVSTSCodeLogs.tsx index 677c919e55..1314bef5d5 100644 --- a/client-react/src/pages/app/deployment-center/code/DeploymentCenterVSTSCodeLogs.tsx +++ b/client-react/src/pages/app/deployment-center/code/DeploymentCenterVSTSCodeLogs.tsx @@ -163,10 +163,7 @@ const DeploymentCenterVSTSCodeLogs: React.FC = pr {urlInfo.map(info => { return ( <> - window.open(info.url, '_blank')} - aria-label={info.urlText}> + {info.urlIcon && } {info.urlText} diff --git a/client-react/src/pages/app/deployment-center/devops-provider/DeploymentCenterVstsBuildConfiguredView.tsx b/client-react/src/pages/app/deployment-center/devops-provider/DeploymentCenterVstsBuildConfiguredView.tsx index 953efb2891..4a2a555942 100644 --- a/client-react/src/pages/app/deployment-center/devops-provider/DeploymentCenterVstsBuildConfiguredView.tsx +++ b/client-react/src/pages/app/deployment-center/devops-provider/DeploymentCenterVstsBuildConfiguredView.tsx @@ -94,7 +94,8 @@ const DeploymentCenterVstsBuildConfiguredView: React.FC window.open(`https://dev.azure.com/${vstsAccountName}/${project}`, '_blank')} + href={`https://dev.azure.com/${vstsAccountName}/${project}`} + target="_blank" aria-label={project}> {project} @@ -106,7 +107,7 @@ const DeploymentCenterVstsBuildConfiguredView: React.FC { if (repoUrl) { return ( - window.open(repoUrl, '_blank')} aria-label={`${repo}`}> + {`${repo} `} diff --git a/client-react/src/pages/app/deployment-center/external-provider/DeploymentCenterExternalConfiguredView.tsx b/client-react/src/pages/app/deployment-center/external-provider/DeploymentCenterExternalConfiguredView.tsx index 6ebf1c96df..9a964ce17c 100644 --- a/client-react/src/pages/app/deployment-center/external-provider/DeploymentCenterExternalConfiguredView.tsx +++ b/client-react/src/pages/app/deployment-center/external-provider/DeploymentCenterExternalConfiguredView.tsx @@ -69,7 +69,7 @@ const DeploymentCenterExternalConfiguredView: React.FC { if (!isBranchInfoMissing) { return ( - window.open(repo, '_blank')}> + {`${branch} `}