-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adding Edit/Delete functions to inline comments #1701
Conversation
|
|
||
| <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" DockPanel.Dock="Right" | ||
| Visibility="{Binding CanEditOrDelete, Converter={ui:BooleanToVisibilityConverter}}"> | ||
| <ui:GitHubActionLink Content="Edit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same feedback as @jcansdale. Otherwise looking good.
| </Style.Triggers> | ||
| </Style> | ||
| </StackPanel.Style> | ||
| <Button Command="{Binding CommitEdit}">Edit</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @jcansdale's comment, can we change this to "Update comment" so it's inline with the interaction on dotcom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed up.
| public ReactiveCommand<ICommentModel> EditComment | ||
| { | ||
| get { return editComment; } | ||
| set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you followed PostComment and made this setter public - I think that was an oversight, it should be protected. When you fix this, could you fix PostComment too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made them protected
| public ReactiveCommand<object> DeleteComment | ||
| { | ||
| get { return deleteComment; } | ||
| set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As with this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
bd0e9a9 to
cc12bea
Compare
|
@meaghanlewis good catch. I fixed that up. |
| x => x.EditState, | ||
| x => x == CommentEditState.None && user.Login.Equals(currentUser.Login)); | ||
|
|
||
| canDelete.Subscribe(b => CanDelete = b); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use ObservableAsPropertyHelper to make this a bit neater.
|
Oops, clicked "approve" before writing my comment ;) Looks good and works well - just one small suggestion, but I don't think that should hold up an approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// <param name="inReplyTo">The REST ID of the comment to reply to.</param> | ||
| /// <param name="inReplyToNodeId">The GraphQL ID of the comment to reply to.</param> | ||
| /// <returns></returns> | ||
| /// <returns>A comment model.</returns> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding an inline comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. this is a test.
|
Nice catch @grokys! I'm able to update comments now when a review is pending. |
|
@StanleyGoldman - on a similar note about pending reviews...i don't seem to be able to delete comments while a review is pending. And then trying to update after clicking delete shows a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit but seems to work fine with pending reviews now!
| CommentEditState state; | ||
| DateTimeOffset updatedAt; | ||
| string undoBody; | ||
| private bool canDelete; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Stray private
|
@meaghanlewis I opened #1713 to reflect your comments |
Mainly merging #1701 Conflicts: src/GitHub.Exports.Reactive/Services/IPullRequestSession.cs src/GitHub.InlineReviews/SampleData/CommentThreadViewModelDesigner.cs src/GitHub.InlineReviews/Services/IPullRequestSessionService.cs src/GitHub.InlineReviews/Services/PullRequestSession.cs src/GitHub.InlineReviews/Services/PullRequestSessionService.cs src/GitHub.InlineReviews/ViewModels/CommentThreadViewModel.cs src/GitHub.InlineReviews/ViewModels/CommentViewModel.cs src/GitHub.InlineReviews/ViewModels/ICommentThreadViewModel.cs test/GitHub.InlineReviews.UnitTests/ViewModels/PullRequestReviewCommentViewModelTests.cs






Depends on: