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

Create PR interstitial dialog refinements #2280

Merged
merged 27 commits into from
Jul 26, 2017
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
69d78c5
Remove redundant jsdoc type annotations
niik Jul 19, 2017
ec812a1
Convert private variable into getter and get rid of constructor
niik Jul 19, 2017
88d14d9
Add a loading state for the pushbranchcommits dialog
niik Jul 19, 2017
2b71ce8
Extract, document and simplify pluralization method
niik Jul 19, 2017
6e1bf09
Simplify: Include the number of commits in the pluralize method
niik Jul 19, 2017
461a05e
Add a type guard to bring back some of the old behavior
niik Jul 19, 2017
ae7ff12
:book:
niik Jul 19, 2017
327276f
Whoops
niik Jul 19, 2017
a413554
:art: cleanup
niik Jul 19, 2017
2412ba1
Break it up a little
niik Jul 19, 2017
88641ed
:art: cleanup
niik Jul 19, 2017
bc4e924
:art: naming
niik Jul 19, 2017
b520ddf
Add a generic Ref component
niik Jul 19, 2017
acea310
Render branch names as Ref components
niik Jul 19, 2017
4d9ac25
Fix unnecessarily nested paths
niik Jul 19, 2017
0390fa4
Try a new take on the push view
niik Jul 19, 2017
a56dbe9
Same logic for publish, ask a question
niik Jul 19, 2017
7d446a2
Ask some question in the title
niik Jul 19, 2017
bf255b1
language
niik Jul 19, 2017
1bff48f
Empty test commit
niik Jul 19, 2017
692c992
Fix pluralization of local commits
niik Jul 19, 2017
856b72d
Remove obsolete doc
niik Jul 21, 2017
6a23399
:art:
niik Jul 21, 2017
428b8fb
Follow the component class naming conventions
niik Jul 21, 2017
7baa69a
Add some more words to the buttons
niik Jul 21, 2017
4bbbc32
Merge branch 'master' into create-pr-dialog-refinements
niik Jul 26, 2017
64541a5
Revert to action texts
niik Jul 26, 2017
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
Prev Previous commit
Next Next commit
Ask some question in the title
  • Loading branch information
niik committed Jul 19, 2017
commit 7d446a2a45ff95f2f81db3204c671201a3ac253a
19 changes: 5 additions & 14 deletions app/src/ui/branches/PushBranchCommits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,10 @@ interface IPushBranchCommitsState {
* @param capitalize Whether or not to capitalize the unit (commit)
* on macOS
*/
function pluralizeCommits(
numberOfCommits: number,
capitalize: boolean = false
) {
const unit = __DARWIN__ && capitalize ? 'Commit' : 'commit'

function pluralizeCommits(numberOfCommits: number) {
return numberOfCommits === 1
? `${numberOfCommits} ${unit}`
: `${numberOfCommits} ${unit}s`
? `${numberOfCommits} commit`
: `${numberOfCommits} commits`
}

/**
Expand Down Expand Up @@ -133,14 +128,10 @@ export class PushBranchCommits extends React.Component<

private renderDialogTitle() {
if (renderPublishView(this.props.unPushedCommits)) {
return __DARWIN__ ? 'Publish Branch' : 'Publish branch'
return __DARWIN__ ? 'Publish Branch?' : 'Publish branch?'
}

const commits = pluralizeCommits(this.props.unPushedCommits, true)

return __DARWIN__
? `Your Branch is Ahead by ${commits}`
: `Your branch is ahead by ${commits}`
return __DARWIN__ ? `Push Local Changes?` : `Push local changes?`
}

private renderButtonGroup() {
Expand Down