1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Make report's comment not optional

This commit is contained in:
ansel 2022-10-16 20:14:05 +03:00
parent ba595ab8fa
commit e1785f73a2
2 changed files with 5 additions and 6 deletions

View File

@ -278,7 +278,7 @@ namespace osu.Game.Tests.Visual.Online
AddAssert("Loading spinner shown", () => targetComment.ChildrenOfType<LoadingSpinner>().Any(d => d.IsPresent)); AddAssert("Loading spinner shown", () => targetComment.ChildrenOfType<LoadingSpinner>().Any(d => d.IsPresent));
AddStep("Complete request", () => requestLock.Set()); AddStep("Complete request", () => requestLock.Set());
AddUntilStep("Request sent", () => request != null); AddUntilStep("Request sent", () => request != null);
AddAssert("Request is correct", () => request != null && request.CommentID == 2 && request.Info == report_text && request.Reason == CommentReportReason.Other); AddAssert("Request is correct", () => request != null && request.CommentID == 2 && request.Comment == report_text && request.Reason == CommentReportReason.Other);
AddUntilStep("Buttons hidden", () => !targetComment.ChildrenOfType<LinkFlowContainer>().Single(x => x.Name == @"Actions buttons").IsPresent); AddUntilStep("Buttons hidden", () => !targetComment.ChildrenOfType<LinkFlowContainer>().Single(x => x.Name == @"Actions buttons").IsPresent);
} }

View File

@ -11,13 +11,13 @@ namespace osu.Game.Online.API.Requests
{ {
public readonly long CommentID; public readonly long CommentID;
public readonly CommentReportReason Reason; public readonly CommentReportReason Reason;
public readonly string? Info; public readonly string Comment;
public CommentReportRequest(long commentID, CommentReportReason reason, string? info) public CommentReportRequest(long commentID, CommentReportReason reason, string comment)
{ {
CommentID = commentID; CommentID = commentID;
Reason = reason; Reason = reason;
Info = info; Comment = comment;
} }
protected override WebRequest CreateWebRequest() protected override WebRequest CreateWebRequest()
@ -28,8 +28,7 @@ namespace osu.Game.Online.API.Requests
req.AddParameter(@"reportable_type", @"comment"); req.AddParameter(@"reportable_type", @"comment");
req.AddParameter(@"reportable_id", $"{CommentID}"); req.AddParameter(@"reportable_id", $"{CommentID}");
req.AddParameter(@"reason", Reason.ToString()); req.AddParameter(@"reason", Reason.ToString());
if (!string.IsNullOrWhiteSpace(Info)) req.AddParameter(@"comments", Comment);
req.AddParameter(@"comments", Info);
return req; return req;
} }