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

Missing buttons and errors when deleting or editing a comment #1723

Merged
merged 11 commits into from
Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Specifying the pull request node id
  • Loading branch information
StanleyGoldman committed Jun 11, 2018
commit 09da40681f28a23e88db91e025bc892ddaf75daa
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Task<IPullRequestReviewCommentModel> PostPendingReviewCommentReply(
/// </summary>
/// <param name="localRepository">The local repository.</param>
/// <param name="user">The user posting the comment.</param>
/// <param name="pullRequestId">The pull request number.</param>
/// <param name="pullRequestNodeId">The pull request node id.</param>
/// <param name="body">The comment body.</param>
/// <param name="commitId">THe SHA of the commit to comment on.</param>
/// <param name="path">The relative path of the file to comment on.</param>
Expand All @@ -273,7 +273,7 @@ Task<IPullRequestReviewCommentModel> PostPendingReviewCommentReply(
/// </remarks>
Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(ILocalRepositoryModel localRepository,
IAccount user,
int pullRequestId,
string pullRequestNodeId,
string body,
string commitId,
string path,
Expand All @@ -284,13 +284,13 @@ Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(ILocalRepositor
/// </summary>
/// <param name="localRepository">The local repository.</param>
/// <param name="user">The user posting the comment.</param>
/// <param name="pullRequestId">The pull request number.</param>
/// <param name="pullRequestNodeId">The pull request node id.</param>
/// <param name="body">The comment body.</param>
/// <param name="inReplyTo">The comment ID to reply to.</param>
/// <returns>A model representing the posted comment.</returns>
Task<IPullRequestReviewCommentModel> PostStandaloneReviewCommentReply(ILocalRepositoryModel localRepository,
IAccount user,
int pullRequestId,
string pullRequestNodeId,
string body,
int inReplyTo);

Expand Down
6 changes: 4 additions & 2 deletions src/GitHub.InlineReviews/Services/PullRequestSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ public async Task<IPullRequestReviewCommentModel> PostReviewComment(

if (!HasPendingReview)
{
var pullRequestNodeId = await GetPullRequestNodeId();
model = await service.PostStandaloneReviewComment(
LocalRepository,
User,
PullRequest.Number,
pullRequestNodeId,
body,
commitId,
path,
Expand Down Expand Up @@ -200,10 +201,11 @@ public async Task<IPullRequestReviewCommentModel> PostReviewComment(

if (!HasPendingReview)
{
var pullRequestNodeId = await GetPullRequestNodeId();
model = await service.PostStandaloneReviewCommentReply(
LocalRepository,
User,
PullRequest.Number,
pullRequestNodeId,
body,
inReplyTo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public async Task<IPullRequestReviewCommentModel> PostPendingReviewCommentReply(
public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(
ILocalRepositoryModel localRepository,
IAccount user,
int pullRequestId,
string pullRequestNodeId,
string body,
string commitId,
string path,
Expand All @@ -543,7 +543,7 @@ public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(
Body = body,
CommitOID = commitId,
Event = Octokit.GraphQL.Model.PullRequestReviewEvent.Comment,
PullRequestId = pullRequestId.ToString(),
PullRequestId = pullRequestNodeId,
Comments = new[]
{
new DraftPullRequestReviewComment
Expand Down Expand Up @@ -586,11 +586,11 @@ public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewComment(
public async Task<IPullRequestReviewCommentModel> PostStandaloneReviewCommentReply(
ILocalRepositoryModel localRepository,
IAccount user,
int pullRequestId,
string pullRequestNodeId,
string body,
int inReplyTo)
{
var review = await CreatePendingReview(localRepository, user, pullRequestId.ToString());
var review = await CreatePendingReview(localRepository, user, pullRequestNodeId);
var comment = await PostPendingReviewCommentReply(localRepository, user, review.Id.ToString(), body, inReplyTo.ToString());
return comment;
}
Expand Down