Skip to content

Commit

Permalink
Merge pull request #16274 from desktop/commit-attribution-descriptive…
Browse files Browse the repository at this point in the history
…-links

Commit attribution descriptive links
  • Loading branch information
tidy-dev committed Mar 14, 2023
2 parents 8232bcc + 68f3334 commit abb0855
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 8 deletions.
7 changes: 5 additions & 2 deletions app/src/ui/changes/commit-message-avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,11 @@ export class CommitMessageAvatar extends React.Component<
The email in your global Git config (
<span className="git-email">{this.props.email}</span>) doesn't match
your GitHub{accountTypeSuffix} account.{' '}
<LinkButton uri="https://docs.github.com/en/github/committing-changes-to-your-project/why-are-my-commits-linked-to-the-wrong-user">
Learn more.
<LinkButton
ariaLabel="Learn more about commit attribution"
uri="https://docs.github.com/en/github/committing-changes-to-your-project/why-are-my-commits-linked-to-the-wrong-user"
>
Learn more
</LinkButton>
</div>
</Row>
Expand Down
2 changes: 1 addition & 1 deletion app/src/ui/history/unreachable-commits-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class UnreachableCommitsDialog extends React.Component<
: ''}{' '}
in the ancestry path of the most recent commit in your selection.{' '}
<LinkButton uri="https://github.com/desktop/desktop/blob/development/docs/learn-more/unreachable-commits.md">
Learn more.
Learn more about unreachable commits.
</LinkButton>
</div>
)
Expand Down
5 changes: 4 additions & 1 deletion app/src/ui/lib/git-email-not-found-warning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export class GitEmailNotFoundWarning extends React.Component<
const info = !isAttributableEmail ? (
<>
Your commits will be wrongly attributed.{' '}
<LinkButton uri="https://docs.github.com/en/github/committing-changes-to-your-project/why-are-my-commits-linked-to-the-wrong-user">
<LinkButton
ariaLabel="Learn more about commit attribution"
uri="https://docs.github.com/en/github/committing-changes-to-your-project/why-are-my-commits-linked-to-the-wrong-user"
>
Learn more.
</LinkButton>
</>
Expand Down
4 changes: 4 additions & 0 deletions app/src/ui/lib/link-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ interface ILinkButtonProps {

/** title-text or tooltip for the link */
readonly title?: string

/** aria-label for the link */
readonly ariaLabel?: string
}

/**
Expand All @@ -53,6 +56,7 @@ export class LinkButton extends React.Component<ILinkButtonProps, {}> {
onMouseOut={this.props.onMouseOut}
onClick={this.onClick}
tabIndex={this.props.tabIndex}
aria-label={this.props.ariaLabel}
>
{title && <Tooltip target={this.anchorRef}>{title}</Tooltip>}
{this.props.children}
Expand Down
2 changes: 1 addition & 1 deletion app/src/ui/repository-settings/git-ignore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class GitIgnore extends React.Component<IGitIgnoreProps, {}> {
untracked files that Git should ignore. Files already tracked by Git
are not affected.{' '}
<LinkButton onClick={this.props.onShowExamples}>
Learn more
Learn more about gitignore files
</LinkButton>
</p>

Expand Down
7 changes: 4 additions & 3 deletions app/src/ui/repository-settings/no-remote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ export class NoRemote extends React.Component<INoRemoteProps, {}> {
return (
<DialogContent>
<CallToAction actionTitle="Publish" onAction={this.props.onPublish}>
<div>
<div className="no-remote-publish-message">
Publish your repository to GitHub. Need help?{' '}
<LinkButton uri={HelpURL}>Learn more</LinkButton> about remote
repositories.
<LinkButton uri={HelpURL}>
Learn more about remote repositories.
</LinkButton>
</div>
</CallToAction>
</DialogContent>
Expand Down
4 changes: 4 additions & 0 deletions app/styles/ui/_commit-message-avatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@

width: 300px;
}

.link-button-component {
display: inline;
}
}
4 changes: 4 additions & 0 deletions app/styles/ui/_git-email-not-found-warning.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
color: var(--warning-badge-icon-color);
}

.link-button-component {
display: inline;
}

.green-circle {
background-color: var(--color-new);
color: var(--background-color);
Expand Down
6 changes: 6 additions & 0 deletions app/styles/ui/dialogs/_repository-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@
margin-bottom: 0;
}
}

.no-remote-publish-message {
.link-button-component {
display: inline;
}
}
}

1 comment on commit abb0855

@RamboDonnie
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app/src/ui/changes/commit-message-avatar.tsx

Please sign in to comment.