Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DC] Use href and target instead of onClick for opening URLs #7923

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const DeploymentCenterBitbucketConfiguredView: React.FC<DeploymentCenterFieldPro
const getBranchLink = () => {
if (!isBranchInfoMissing) {
return (
<Link key="deployment-center-branch-link" onClick={() => window.open(repoUrl, '_blank')} aria-label={`${branch}`}>
<Link key="deployment-center-branch-link" href={repoUrl} target="_blank" aria-label={`${branch}`}>
{`${branch} `}
<Icon id={`branch-button`} iconName={'NavigateExternalInline'} />
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const DeploymentCenterGitHubActionsCodeLogs: React.FC<DeploymentCenterCodeLogsPr
message: run.head_commit.message,
commit: run.head_commit.id.substr(0, 7),
logSource: (
<Link key="github-actions-logs-link" onClick={() => window.open(run.html_url, '_blank')}>
<Link key="github-actions-logs-link" href={run.html_url} target="_blank">
{t('deploymentCenterBuildDeployLogSource')}
<Icon id={`ga-logs`} iconName={'NavigateExternalInline'} />
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ const DeploymentCenterVSTSCodeLogs: React.FC<DeploymentCenterCodeLogsProps> = pr
{urlInfo.map(info => {
return (
<>
<Link
className={deploymentCenterVstsCodeLogsLinkStyle}
onClick={() => window.open(info.url, '_blank')}
aria-label={info.urlText}>
<Link className={deploymentCenterVstsCodeLogsLinkStyle} href={info.url} target="_blank" aria-label={info.urlText}>
{info.urlIcon && <Icon iconName={info.urlIcon} />}
{info.urlText}
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ const DeploymentCenterVstsBuildConfiguredView: React.FC<DeploymentCenterFieldPro
return (
<Link
key="deployment-center-branch-link"
onClick={() => window.open(`https://dev.azure.com/${vstsAccountName}/${project}`, '_blank')}
href={`https://dev.azure.com/${vstsAccountName}/${project}`}
target="_blank"
aria-label={project}>
{project}
<Icon id={`repo-button`} iconName={'NavigateExternalInline'} />
Expand All @@ -106,7 +107,7 @@ const DeploymentCenterVstsBuildConfiguredView: React.FC<DeploymentCenterFieldPro
const getRepoLink = () => {
if (repoUrl) {
return (
<Link key="deployment-center-branch-link" onClick={() => window.open(repoUrl, '_blank')} aria-label={`${repo}`}>
<Link key="deployment-center-branch-link" href={repoUrl} target="_blank" aria-label={`${repo}`}>
{`${repo} `}
<Icon id={`repo-button`} iconName={'NavigateExternalInline'} />
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const DeploymentCenterExternalConfiguredView: React.FC<DeploymentCenterFieldProp
const getBranchLink = () => {
if (!isBranchInfoMissing) {
return (
<Link key="deployment-center-branch-link" onClick={() => window.open(repo, '_blank')}>
<Link key="deployment-center-branch-link" href={repo} target="_blank">
{`${branch} `}
<Icon id={`branch-button`} iconName={'NavigateExternalInline'} />
</Link>
Expand Down
Loading