Skip to content

Commit

Permalink
✨ Optionally ack all subjects of an account when acknowledging report…
Browse files Browse the repository at this point in the history
…s on account
  • Loading branch information
foysalit committed Dec 3, 2024
1 parent 0a55cba commit 295f47c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/actions/ModActionPanel/QuickAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ function Form(
const isMuteReporterEvent = modEventType === MOD_EVENTS.MUTE_REPORTER
const isCommentEvent = modEventType === MOD_EVENTS.COMMENT
const isTakedownEvent = modEventType === MOD_EVENTS.TAKEDOWN
const isAckEvent = modEventType === MOD_EVENTS.ACKNOWLEDGE
const shouldShowDurationInHoursField =
isTakedownEvent || isMuteEvent || isMuteReporterEvent
const canManageChat = usePermission('canManageChat')
Expand Down Expand Up @@ -262,7 +263,7 @@ function Form(
}

if (
modEventType === MOD_EVENTS.TAKEDOWN &&
(isTakedownEvent || isAckEvent) &&
formData.get('acknowledgeAccountSubjects')
) {
coreEvent.acknowledgeAccountSubjects = true
Expand Down Expand Up @@ -740,7 +741,7 @@ function Form(
/>
)}

{isTakedownEvent && isSubjectDid && (
{(isTakedownEvent || isAckEvent) && isSubjectDid && (
<Checkbox
value="true"
id="acknowledgeAccountSubjects"
Expand Down
3 changes: 2 additions & 1 deletion components/workspace/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ export function WorkspacePanel(props: PropsOf<typeof ActionPanel>) {
}

if (
coreEvent.$type === MOD_EVENTS.TAKEDOWN &&
(coreEvent.$type === MOD_EVENTS.TAKEDOWN ||
coreEvent.$type === MOD_EVENTS.ACKNOWLEDGE) &&
formData.get('acknowledgeAccountSubjects')
) {
coreEvent.acknowledgeAccountSubjects = true
Expand Down
6 changes: 4 additions & 2 deletions components/workspace/PanelActionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const WorkspacePanelActionForm = ({
setModEventType: (action: string) => void
onCancel: () => void
}) => {
const isAckEvent = modEventType === MOD_EVENTS.ACKNOWLEDGE
const isTakedownEvent = modEventType === MOD_EVENTS.TAKEDOWN
const isCommentEvent = modEventType === MOD_EVENTS.COMMENT
const isMuteEvent = modEventType === MOD_EVENTS.MUTE
Expand Down Expand Up @@ -102,7 +103,7 @@ export const WorkspacePanelActionForm = ({
label="Update the subject's persistent note with this comment"
/>
)}
{isTakedownEvent && (
{(isTakedownEvent || isAckEvent) && (
<Checkbox
value="true"
id="acknowledgeAccountSubjects"
Expand All @@ -112,7 +113,8 @@ export const WorkspacePanelActionForm = ({
label={
<span className="leading-4">
Acknowledge all open/escalated/appealed reports on subjects
created by accounts that you are taking down.
created by accounts that you are{' '}
{isAckEvent ? 'acknowledging' : 'taking down'}.
</span>
}
/>
Expand Down

0 comments on commit 295f47c

Please sign in to comment.