Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add subject tags with report type #3260

Merged
merged 6 commits into from
Dec 18, 2024
Merged

Conversation

foysalit
Copy link
Contributor

This PR adds report reason tags to subjects which enables moderators to filter queue items based on the subjects' report types.

@@ -69,7 +69,7 @@ describe('report-muting', () => {
})

// Verify that a subject status was not created for bob's post since the reporter was muted
await assertSubjectStatus(bobsPostSubject.uri, undefined)
await assertSubjectStatus(bobsPostSubject.uri, REVIEWNONE)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only needed changing because we are now emitting an additional tag event because of report which causes the status to change to reviewNone which is similar to not having a reviewstate so there is no functional change.

try {
const tags: string[] = []
const tags = new Set([...initialTags])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to copy here (the Set will do that for you). This also allows to type the argument in a broader way initialTags?: Iterable<string> instead of defaulting to an empty array.

Suggested change
const tags = new Set([...initialTags])
const tags = new Set(initialTags)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaned it up as recommended!

await tagService.evaluateForSubject()
const initialTags = isModEventReport(event)
? [getTagForReport(event.reportType)]
: []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: No need to create empty unused array here.

Suggested change
: []
: undefined

@foysalit foysalit merged commit c559e7e into main Dec 18, 2024
10 checks passed
@foysalit foysalit deleted the ozone-report-type-tagging branch December 18, 2024 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants