Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Conversation

@grokys
Copy link
Contributor

@grokys grokys commented Apr 4, 2018

Split the PullRequestReviewAuthoringViewModel.Submit command into 2 separate commands and add a CanExecute observable for them:

  • Approve can always be submitted
  • Comment needs either a review body or >0 review comments
  • RequestChanges needs either a review body or >0 review comments

HACK

Disabling the GitHubActionLinks that are used for the approve/comment/request changes buttons had no visual effect. Seems that hyperlinks don't respect dependency property precedence, so the IsEnabled=False trigger for Hyperlink.Foreground doesn't override the foreground TemplateBinding. Not sure what we can do here other than set the control's opacity when disabled, so that's what I did for now.

Depends on #1581
Part of #1491

Split the `PullRequestReviewAuthoringViewModel.Submit` command into 2 separate commands and add a `CanExecute` observable for them:

- `Approve` can always be submitted
- `Comment` needs either a review body or >0 review comments
- `RequestChanges` always needs a review body
@grokys grokys changed the base branch from master to feature/pr-reviews-master April 4, 2018 10:45
@meaghanlewis
Copy link
Contributor

This LGTM - except I thought that RequestChanges option needs to be either have a review body or > 0 review comments to submit.

@grokys
Copy link
Contributor Author

grokys commented Apr 5, 2018

@meaghanlewis oh, yes you're right! Fixed that.

Sigh. Seems that hyperlinks don't respect dependency property precedence, so the `IsEnabled=False` trigger for `Hyperlink.Foreground` doesn't override the foreground `TemplateBinding`. Not sure what we can do here other than set the control's opacity when disabled, so that's what we'll do for now.
@jcansdale jcansdale changed the base branch from feature/pr-reviews-master to feature/pr-reviews April 10, 2018 10:49
@jcansdale jcansdale changed the base branch from feature/pr-reviews to feature/pr-reviews-master April 10, 2018 10:49
@jcansdale jcansdale merged commit a96fd8f into feature/pr-reviews-master Apr 10, 2018
@jcansdale jcansdale deleted the fixes/pr-authoring-command-validatation branch April 10, 2018 10:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants