diff --git a/client/src/core/client/admin/routes/Reports/ReportHistory.tsx b/client/src/core/client/admin/routes/Reports/ReportHistory.tsx index f5a85ac880..1e22254477 100644 --- a/client/src/core/client/admin/routes/Reports/ReportHistory.tsx +++ b/client/src/core/client/admin/routes/Reports/ReportHistory.tsx @@ -7,7 +7,10 @@ import { graphql } from "react-relay"; import { useDateTimeFormatter } from "coral-framework/hooks"; import { useMutation, withFragmentContainer } from "coral-framework/lib/relay"; import { required } from "coral-framework/lib/validation"; -import { GQLDSAReportHistoryType } from "coral-framework/schema"; +import { + GQLDSAReportHistoryType, + GQLDSAReportStatus, +} from "coral-framework/schema"; import { AddIcon, BinIcon, ButtonSvgIcon } from "coral-ui/components/icons"; import { Button, @@ -39,6 +42,7 @@ export const statusMappings = { AWAITING_REVIEW: "Awaiting review", UNDER_REVIEW: "In review", COMPLETED: "Completed", + VOID: "Void", "%future added value": "Unknown status", }; @@ -97,7 +101,9 @@ const ReportHistory: FunctionComponent = ({ userID, }); form.change("note", undefined); - setShowChangeStatusModal(true); + if (dsaReport.status === GQLDSAReportStatus.AWAITING_REVIEW) { + setShowChangeStatusModal(true); + } } }, [addReportNote, dsaReport, userID, setShowChangeStatusModal] @@ -163,17 +169,28 @@ const ReportHistory: FunctionComponent = ({ )} {h?.type === GQLDSAReportHistoryType.STATUS_CHANGED && ( - -
{`${ - h.createdBy?.username - } changed status to "${statusMapping(h.status)}"`}
-
+ <> + {h.status === GQLDSAReportStatus.VOID ? ( + // TODO: Localize +
+ User deleted their account. Report is void. +
+ ) : ( + +
{`${ + h.createdBy?.username + } changed status to "${statusMapping( + h.status + )}"`}
+
+ )} + )} {h?.type === GQLDSAReportHistoryType.SHARE && ( @@ -188,16 +205,29 @@ const ReportHistory: FunctionComponent = ({ )} {h?.type === GQLDSAReportHistoryType.DECISION_MADE && ( - -
{`${ - h.createdBy?.username - } made a decision that this report ${decisionMapping( - h.decision?.legality - )}`}
-
+ <> + +
{`${ + h.createdBy?.username + } made a decision that this report ${decisionMapping( + h.decision?.legality + )}`}
+
+ {h.decision?.legality === "ILLEGAL" && ( + <> +
+ Legal grounds: {`${h.decision?.legalGrounds}`} +
+
+ Explanation:{" "} + {`${h.decision?.detailedExplanation}`} +
+ + )} + )}
@@ -250,6 +280,7 @@ const enhanced = withFragmentContainer({ dsaReport: graphql` fragment ReportHistory_dsaReport on DSAReport { id + status createdAt history { id diff --git a/client/src/core/client/admin/routes/Reports/ReportShareButton.tsx b/client/src/core/client/admin/routes/Reports/ReportShareButton.tsx index 6085f3906d..56c7207d64 100644 --- a/client/src/core/client/admin/routes/Reports/ReportShareButton.tsx +++ b/client/src/core/client/admin/routes/Reports/ReportShareButton.tsx @@ -10,6 +10,7 @@ import { withFragmentContainer, } from "coral-framework/lib/relay"; import { GQLDSAReportStatus } from "coral-framework/schema"; +import { DrawerDownloadIcon, SvgIcon } from "coral-ui/components/icons"; import { Button } from "coral-ui/components/v2"; import { ReportShareButton_dsaReport } from "coral-admin/__generated__/ReportShareButton_dsaReport.graphql"; @@ -85,7 +86,10 @@ const ReportShareButton: FunctionComponent = ({ ]); return ( - + }} + > ); diff --git a/client/src/core/client/admin/routes/Reports/ReportStatusMenu.tsx b/client/src/core/client/admin/routes/Reports/ReportStatusMenu.tsx index 6bada4c323..5bc58fbf38 100644 --- a/client/src/core/client/admin/routes/Reports/ReportStatusMenu.tsx +++ b/client/src/core/client/admin/routes/Reports/ReportStatusMenu.tsx @@ -39,7 +39,7 @@ const ReportStatusMenu: FunctionComponent = ({ } } }, - [reportID, userID, changeReportStatus] + [reportID, userID, changeReportStatus, onChangeReportStatusCompleted] ); return ( <> @@ -53,7 +53,7 @@ const ReportStatusMenu: FunctionComponent = ({ id="coral-reports-report-statusMenu" onChange={(e) => onChangeStatus(e.target.value as DSAReportStatus)} value={value ?? "AWAITING_REVIEW"} - disabled={value === "COMPLETED"} + disabled={value === "COMPLETED" || value === "VOID"} > @@ -64,6 +64,11 @@ const ReportStatusMenu: FunctionComponent = ({ + {/* */} + + {/* */} ); diff --git a/client/src/core/client/admin/routes/Reports/ReportsTableContainer.tsx b/client/src/core/client/admin/routes/Reports/ReportsTableContainer.tsx index 25755b06fd..b1719d07bd 100644 --- a/client/src/core/client/admin/routes/Reports/ReportsTableContainer.tsx +++ b/client/src/core/client/admin/routes/Reports/ReportsTableContainer.tsx @@ -47,7 +47,10 @@ const ReportsTableContainer: React.FunctionComponent = (props) => { ); const onShowCompleted = useCallback(() => { - setStatusFilter([GQLDSAREPORT_STATUS_FILTER.COMPLETED]); + setStatusFilter([ + GQLDSAREPORT_STATUS_FILTER.COMPLETED, + GQLDSAREPORT_STATUS_FILTER.VOID, + ]); setFilterButton("open"); }, []); @@ -84,7 +87,7 @@ const ReportsTableContainer: React.FunctionComponent = (props) => { color="dark" uppercase={false} > - Show completed reports + Show closed reports ) : ( + + & {
Comment
- -
+ <> + {comment.deleted ? (
- - {comment.author?.username && ( - <> - - onShowUserDrawer(comment.author?.id) - } - /> - - - )} - {comment.createdAt} - {comment.editing.edited && ( - - - (edited) - - - )} - - {inReplyTo && inReplyTo.username && ( - - onShowUserDrawer(inReplyTo.id) - } - > - {inReplyTo.username} - - )} + This comment is no longer available. The commenter + has deleted their account.
- {comment.rating && ( -
- -
- )} -
-
- {/* TODO: Do we want to show message for deleted/rejected */} - - {comment.body || ""} - - -
-
-
- + ) : ( + <> +
- - - Comment on - - - : + + {comment.author?.username && ( + <> + + onShowUserDrawer(comment.author?.id) + } + /> + + + )} + {comment.createdAt} + {comment.editing.edited && ( + + + (edited) + + + )} + + {inReplyTo && inReplyTo.username && ( + + onShowUserDrawer(inReplyTo.id) + } + > + {inReplyTo.username} + + )}
+ {comment.rating && ( +
+ +
+ )}
- - {comment.story?.metadata?.title ?? ( - - )} - +
+ {/* TODO: Do we want to show message for deleted/rejected */} + + {comment.body || ""} + + +
+
+
+ +
+
+ + + Comment on + + + : +
+
+ + {comment.story?.metadata?.title ?? ( + + )} + +
+
+
-
-
-
-
-
- {/* TODO: Localize these comment links */} - - - - - + + {/* TODO: Localize these comment links */} + + + + + + + + )} + )} + {dsaReport.decision && ( + + + {/* */} +
Decision
+ {/*
*/} + {dsaReport.decision.legality === "ILLEGAL" ? ( + <> + +
+ This report appears to contain illegal content +
+
+ +
Legal grounds
+
+ {`${dsaReport.decision.legalGrounds}`} +
+
+ +
+ Detailed explanation +
+
+ {`${dsaReport.decision.detailedExplanation}`} +
+
+ + ) : ( +
+ This report does not appear to contain illegal content +
+ )} +
+
+ )} {({ firstFocusableRef }) => ( @@ -377,67 +460,80 @@ const SingleReportRoute: FunctionComponent & {
- +
- This comment + Does this comment appear to contain illegal + content?
- - {({ input }) => { - return ( - - - - - ); - }} - -
- - - {({ input }) => ( -