diff --git a/app/actions/ModActionPanel/QuickAction.tsx b/app/actions/ModActionPanel/QuickAction.tsx
index 45974014..ee704ecf 100644
--- a/app/actions/ModActionPanel/QuickAction.tsx
+++ b/app/actions/ModActionPanel/QuickAction.tsx
@@ -59,6 +59,7 @@ import {
import { SubjectTag } from 'components/tags/SubjectTag'
import { HighProfileWarning } from '@/repositories/HighProfileWarning'
import { EmailComposer } from 'components/email/Composer'
+import { ActionPolicySelector } from '@/reports/ModerationForm/ActionPolicySelector'
const FORM_ID = 'mod-action-panel'
const useBreakpoint = createBreakpoint({ xs: 340, sm: 640 })
@@ -266,6 +267,10 @@ function Form(
coreEvent.durationInHours = Number(formData.get('durationInHours'))
}
+ if (isTakedownEvent && formData.get('policies')) {
+ coreEvent.policies = [String(formData.get('policies'))]
+ }
+
if (
(isTakedownEvent || isAckEvent) &&
formData.get('acknowledgeAccountSubjects')
@@ -333,6 +338,10 @@ function Form(
throw new Error('blob-selection-required')
}
+ if (isTakedownEvent && !coreEvent.policies) {
+ throw new Error('policy-selection-required')
+ }
+
// This block handles an edge case where a label may be applied to profile record and then the profile record is updated by the user.
// In that state, if the moderator reverts the label, the event is emitted for the latest CID of the profile entry which does NOT revert
// the label applied to the old CID.
@@ -666,16 +675,35 @@ function Form(
Until {dateFormatter.format(expiresAt)}
+
+
+
{`${modEvent.event.comment}`}
) : null} diff --git a/components/mod-event/EventList.tsx b/components/mod-event/EventList.tsx index 5e26eea7..3128e1c3 100644 --- a/components/mod-event/EventList.tsx +++ b/components/mod-event/EventList.tsx @@ -143,6 +143,7 @@ export const ModEventList = ( isInitialLoadingModEvents, hasFilter, commentFilter, + policies, toggleCommentFilter, setCommentFilterKeyword, createdBy, @@ -285,6 +286,7 @@ export const ModEventList = ( removedTags, applyFilterMacro, changeListFilter, + policies, }} /> )} diff --git a/components/mod-event/FilterPanel.tsx b/components/mod-event/FilterPanel.tsx index 076982ca..6ab3d086 100644 --- a/components/mod-event/FilterPanel.tsx +++ b/components/mod-event/FilterPanel.tsx @@ -17,6 +17,10 @@ import { useState } from 'react' import { RepoFinder } from '@/repositories/Finder' import { Dropdown } from '@/common/Dropdown' import { ChevronDownIcon } from '@heroicons/react/24/solid' +import { + ActionPoliciesSelector, + ActionPolicySelector, +} from '@/reports/ModerationForm/ActionPolicySelector' export const EventFilterPanel = ({ limit, @@ -271,6 +275,17 @@ export const EventFilterPanel = ({ + {types.includes(MOD_EVENTS.TAKEDOWN) && ( +{ActionErrors[error].description}
+ {tpl.name} +
+{tpl.description}
+Hang tight, we{"'"}re loading all policies...
+ ) : ( ++ {!searchQuery + ? 'No policies found.' + : `No policy matches the prefix "${searchQuery}". Please clear your search to see all policies`} +
+ )} + {policyList?.map((policy, i) => { + const lastItem = i === policyList.length - 1 + return ( +{policy.name}
+{policy.description}
+