Skip to content

Select the current pull request - #3331

Merged
niik merged 6 commits into
masterfrom
select-my-pr
Nov 16, 2017
Merged

niik merged 6 commits into
masterfrom
select-my-pr

Conversation

@joshaber

Copy link
Copy Markdown
Contributor

Fixes #2873

@joshaber joshaber added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 15, 2017
@joshaber

Copy link
Copy Markdown
Contributor Author

This is ready 🙏

@niik niik self-assigned this Nov 15, 2017
/** The pull requests to display. */
readonly pullRequests: ReadonlyArray<PullRequest>

/** The pull request associated with the current branch. */

This comment was marked as spam.

const pullRequest = nextProps.currentPullRequest
const selectedItem = pullRequest
? findItemForPullRequest(group, pullRequest)
: this.state.selectedItem

This comment was marked as spam.

@joshaber

Copy link
Copy Markdown
Contributor Author

🇻🇦

const group = createListItems(nextProps.pullRequests)
const pullRequest = nextProps.currentPullRequest
const selectedItem = pullRequest
? findItemForPullRequest(group, pullRequest)

This comment was marked as spam.

@joshaber

Copy link
Copy Markdown
Contributor Author

🐲

As we discussed in chat, I think we only wanna set the selected item to the currentPullRequest when the component is first created. After that, we don't wanna change it out from under the user in case they've changed selection manually.

@niik
niik merged commit 60011ed into master Nov 16, 2017
@niik
niik deleted the select-my-pr branch November 16, 2017 16:52
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.

2 participants