Skip to content

Commit

Permalink
Merge pull request #12028 from desktop/repo-alias-tooltip
Browse files Browse the repository at this point in the history
Add the repo alias to its tooltip
  • Loading branch information
sergiou87 committed Apr 20, 2021
2 parents efbe424 + db80844 commit 4629e4e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/src/ui/repositories-list/repository-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,19 @@ export class RepositoryListItem extends React.Component<
repository instanceof Repository ? repository.gitHubRepository : null
const hasChanges = this.props.changedFilesCount > 0

const repoTooltip = gitHubRepo
? gitHubRepo.fullName + '\n' + gitHubRepo.htmlURL + '\n' + path
: path

const alias: string | null =
repository instanceof Repository ? repository.alias : null

const repoTooltipComponents = gitHubRepo
? [gitHubRepo.fullName, gitHubRepo.htmlURL, path]
: [path]

if (alias !== null) {
repoTooltipComponents.unshift(alias)
}

const repoTooltip = repoTooltipComponents.join('\n')

let prefix: string | null = null
if (this.props.needsDisambiguation && gitHubRepo) {
prefix = `${gitHubRepo.owner.login}/`
Expand Down

0 comments on commit 4629e4e

Please sign in to comment.