-
Notifications
You must be signed in to change notification settings - Fork 578
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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.
const tags = new Set([...initialTags]) | |
const tags = new Set(initialTags) |
There was a problem hiding this comment.
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)] | ||
: [] |
There was a problem hiding this comment.
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.
: [] | |
: undefined |
This PR adds report reason tags to subjects which enables moderators to filter queue items based on the subjects' report types.