Browse Source

ref(repos): Ensure repository link opens in new tab (#26645)

Leverage the EnternalLink tag to ensure clicking on a repository opens in a new tab instead of replacing the current context.

Fixes API-1947
Aniket Das "Tekky 3 years ago
parent
commit
bcebdf02f8
1 changed files with 4 additions and 1 deletions
  1. 4 1
      static/app/components/repositoryRow.tsx

+ 4 - 1
static/app/components/repositoryRow.tsx

@@ -7,6 +7,7 @@ import {Client} from 'app/api';
 import Access from 'app/components/acl/access';
 import Button from 'app/components/button';
 import Confirm from 'app/components/confirm';
+import ExternalLink from 'app/components/links/externalLink';
 import {PanelItem} from 'app/components/panels';
 import RepositoryEditForm from 'app/components/repositoryEditForm';
 import Tooltip from 'app/components/tooltip';
@@ -162,7 +163,9 @@ class RepositoryRow extends Component<Props> {
                 {showProvider && repository.url && <span>&nbsp;&mdash;&nbsp;</span>}
                 {repository.url && (
                   <small>
-                    <a href={repository.url}>{repository.url.replace('https://', '')}</a>
+                    <ExternalLink href={repository.url}>
+                      {repository.url.replace('https://', '')}
+                    </ExternalLink>
                   </small>
                 )}
               </div>