Skip to content

Adds Create Pull Request menu item - #2195

Merged
joshaber merged 48 commits into
masterfrom
pr-menu
Jul 14, 2017
Merged

joshaber merged 48 commits into
masterfrom
pr-menu

Conversation

@iAmWillShepherd

@iAmWillShepherd iAmWillShepherd commented Jul 6, 2017 •

Copy link
Copy Markdown
Contributor

This PR fixes #2135.

  • Add menu item to UI
  • Push unpublished commits
  • Publish unpublished branch
  • Disable menu item if Repository isn't hosted on GitHub
  • Open PR view on GitHub and attempt to pre-fill as much info as possible
  • Figure out a decent shortcut

Updated UI

Menu Item

2017-07-13_14-57-07 125

Unpublished Branch

publish

Branch Ahead

push

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

@joshaber should we show a popup letting the user know that they have commits that need to be pushed or a branch that must be publish and allow them to continue? I would prefer this way instead of us automatically doing it. Also, what do you feel is a good short-cut for this?

@donokuda do you have any thoughts?

@donokuda

donokuda commented Jul 6, 2017

Copy link
Copy Markdown
Contributor

@joshaber should we show a popup letting the user know that they have commits that need to be pushed or a branch that must be publish and allow them to continue? I would prefer this way instead of us automatically doing it.

That's a good point. Maybe a dialog along the lines of:

+------------------------------------------------+
|          You have 3 unpushed commits           |
+------------------------------------------------+
| Push these commits to `origin/foobar`          |
| before creating your pull request?             |
|------------------------------------------------|
| [Cancel] [ Push commits and open pull request] |
+------------------------------------------------+

The only thing I'm not sure of at the moment is that I feel like we should have 2 buttons here (in addition to the cancel):

  • Only open pull request
  • Push commits and open pull request

However, I'm not sure if we'll be able to fit 3 buttons nicely in the dialog (especially given how wordy the push commits action is.)

For for an unpublished branch we should only have one main action:

  • Publish branch and open pull request

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

I feel like we should require commits be pushed here. It's a bit opinionated, but I think it's best for most users. Those who are more advanced still have access to the web UI. I will cede my opinion to you on this however.

@donokuda

donokuda commented Jul 6, 2017

Copy link
Copy Markdown
Contributor

I feel like we should require commits be pushed here. It's a bit opinionated, but I think it's best for most users. Those who are more advanced still have access to the web UI. I will cede my opinion to you on this however.

👍 Totally fair and alleviates my concern! 😄

@iAmWillShepherd iAmWillShepherd changed the title Adds Create Pull Request menu item Adds Create Pull Request menu item Jul 6, 2017
@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

💯

@joshaber joshaber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🌉

Comment thread app/src/lib/menu-update.ts Outdated
) {
if (selectedState.repository.gitHubRepository) {
menuStateBuilder.enable('view-repository-on-github')
menuStateBuilder.enable('create-pull-request')

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/ui/branches/PublishBranch.tsx Outdated
<DialogContent>
<p>
Your branch must be published before opening a pull request. Would
you like to publish <b>{this.props.branch.name}</b> and oepn a pull

This comment was marked as spam.

Comment thread app/src/ui/branches/PublishBranch.tsx Outdated
<ButtonGroup>
<Button type="submit">Cancel</Button>
<Button onClick={this.push}>
Publish branch and open pull request

This comment was marked as spam.

<DialogContent>
<p>
{`Would you like to push ${numberOfCommits} ${this.createCommitString()} to `}
<b>{this.props.branch.name}</b> and oepn a pull request?

This comment was marked as spam.

<ButtonGroup>
<Button type="submit">Cancel</Button>
<Button onClick={this.push}>
Push commits and open pull request

This comment was marked as spam.

Comment thread app/src/ui/branches/PublishBranch.tsx Outdated
readonly onDismissed: () => void
}

export class PublishBranch extends React.Component<IPublishBranchProps> {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/ui/branches/PublishBranch.tsx Outdated

<DialogFooter>
<ButtonGroup>
<Button type="submit">Cancel</Button>

This comment was marked as spam.

@joshaber

Copy link
Copy Markdown
Contributor

I think the situation occurs with new users who may not understand it or people like me who don't realize they are about to do something unwise

Yeah, I could see that as part of the "saving face" thing. We can roll with it and see how it goes.

@dwilt

dwilt commented Jul 13, 2017

Copy link
Copy Markdown

@iAmWillShepherd Thanks for putting this together man!!!

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

@joshaber are we gonna move forward with CMD+Shift+P for the shortcut?

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

💯

@joshaber joshaber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🌂

Just a couple things left.

* @type {boolean}
* @memberof IPushBranchCommitsProps
*/
readonly publish?: boolean

This comment was marked as spam.

readonly unPushedCommits?: number
}

export class PushBranchCommits extends React.Component<

This comment was marked as spam.

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants