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

Add the repo alias to its tooltip #12028

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -68,13 +68,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