diff --git a/src/components/AccountWarning/CannedMessages.ts b/src/components/AccountWarning/CannedMessages.ts index f616aa0ea7..19565295bd 100644 --- a/src/components/AccountWarning/CannedMessages.ts +++ b/src/components/AccountWarning/CannedMessages.ts @@ -248,13 +248,13 @@ and that abandoned game annulled.`), no_stalling_evident: (reported) => interpolate( _(` -Thank you for bringing the possible instance of stalling play by {{reported}} to +Thank you for bringing the possible instance of stalling play by {{reported}} to \ our attention. We looked into the report and don't see evidence of stalling. -Note that the correct way to signal the game has finished is to pass. If you didn't pass, +Note that the correct way to signal the game has finished is to pass. If you didn't pass, \ then your opponent is entitled to keep playing. -It may be that you need to report a different type of problem, or provide more explanation - +It may be that you need to report a different type of problem, or provide more explanation - \ you are welcome to raise a new report if that is the case. Thank you for helping keep OGS enjoyable for everyone. We appreciate it.`), @@ -267,10 +267,11 @@ Thanks for your recent report. We've had to change the 'report type': {{change}}. -It makes it easier and quicker to process reports if they are raised with the +It makes it easier and quicker to process reports if they are raised with the \ correct type - if you could help with that we'd appreciate it. -If this change seems wrong, we'd welcome feedback about that - please contact a moderator to let them know. +If this change seems wrong, we'd welcome feedback about that - please contact a \ +moderator to let them know. `), { change }, ), diff --git a/src/views/ReportsCenter/ViewReport.tsx b/src/views/ReportsCenter/ViewReport.tsx index 56971daef4..9516e8263c 100644 --- a/src/views/ReportsCenter/ViewReport.tsx +++ b/src/views/ReportsCenter/ViewReport.tsx @@ -24,7 +24,7 @@ import { report_categories, ReportType } from "Report"; import { report_manager } from "report_manager"; import { Report } from "report_util"; import { AutoTranslate } from "AutoTranslate"; -import { _, pgettext } from "translate"; +import { interpolate, _, pgettext } from "translate"; import { Player } from "Player"; import { Link } from "react-router-dom"; import { post } from "requests"; @@ -38,6 +38,7 @@ import { MessageTemplate, WARNING_TEMPLATES, REPORTER_RESPONSE_TEMPLATES } from import { ModerationActionSelector } from "./ModerationActionSelector"; import { openAnnulQueueModal, AnnulQueueModal } from "AnnulQueueModal"; import { ReportTypeSelector } from "./ReportTypeSelector"; +import { alert } from "swal_config"; // Used for saving updates to the report let report_note_id = 0; @@ -261,16 +262,35 @@ export function ViewReport({ report_id, reports, onChange }: ViewReportProps): J }; const changeReportType = (new_type: ReportType) => { - setReport({ ...report, retyped: true }); // this disables the selector on this page for this report, while action happens... - post(`moderation/incident/${report.id}`, { - id: report.id, - action: "retype", - new_type: new_type, - }) - .then((_res) => { - // We need to move on to the next report, because this one is getting updated in the - // back end, and we'll get it back via that route, not by directly manipulating it here. - next(); + alert + .fire({ + text: interpolate( + pgettext( + "Confirmation dialog", + "Just checking: change the report type from {{report_type}} to {{new_type}}?", + ), + { report_type: report.report_type, new_type }, + ), + confirmButtonText: _("Yes"), + cancelButtonText: _("No"), + showCancelButton: true, + focusCancel: true, + }) + .then(({ value: yes }) => { + if (yes) { + setReport({ ...report, retyped: true }); // this disables the selector on this page for this report, while action happens... + post(`moderation/incident/${report.id}`, { + id: report.id, + action: "retype", + new_type: new_type, + }) + .then((_res) => { + // We need to move on to the next report, because this one is getting updated in the + // back end, and we'll get it back via that route, not by directly manipulating it here. + next(); + }) + .catch(errorAlerter); + } }) .catch(errorAlerter); };