Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
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" |
StanleyGoldman
May 24, 2018
Author
Contributor
Fixed up.
Fixed up.
|
Same feedback as @jcansdale. Otherwise looking good. |
| </Style.Triggers> | ||
| </Style> | ||
| </StackPanel.Style> | ||
| <Button Command="{Binding CommitEdit}">Edit</Button> |
donokuda
May 23, 2018
Member
Per @jcansdale's comment, can we change this to "Update comment" so it's inline with the interaction on dotcom?
Per @jcansdale's comment, can we change this to "Update comment" so it's inline with the interaction on dotcom?
StanleyGoldman
May 24, 2018
Author
Contributor
Fixed up.
Fixed up.
| public ReactiveCommand<ICommentModel> EditComment | ||
| { | ||
| get { return editComment; } | ||
| set |
grokys
May 29, 2018
Contributor
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?
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?
StanleyGoldman
May 29, 2018
Author
Contributor
Made them protected
Made them protected
| public ReactiveCommand<object> DeleteComment | ||
| { | ||
| get { return deleteComment; } | ||
| set |
grokys
May 29, 2018
Contributor
As with this one.
As with this one.
StanleyGoldman
May 29, 2018
Author
Contributor
👍
bd0e9a9
to
cc12bea
|
@meaghanlewis good catch. I fixed that up. |
| x => x.EditState, | ||
| x => x == CommentEditState.None && user.Login.Equals(currentUser.Login)); | ||
|
|
||
| canDelete.Subscribe(b => CanDelete = b); |
|
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. |
| @@ -111,7 +111,7 @@ public interface IPullRequestSession | |||
| /// <param name="body">The comment body.</param> | |||
| /// <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> | |||
sguthals
May 31, 2018
Contributor
Adding an inline comment
Adding an inline comment
StanleyGoldman
May 31, 2018
Author
Contributor
Ah. this is a test.
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 |
|
One nit but seems to work fine with pending reviews now! |
| @@ -24,6 +24,7 @@ public class CommentViewModel : ReactiveObject, ICommentViewModel | |||
| CommentEditState state; | |||
| DateTimeOffset updatedAt; | |||
| string undoBody; | |||
| private bool canDelete; | |||
grokys
May 31, 2018
Contributor
Nit: Stray private
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: