-
Notifications
You must be signed in to change notification settings - Fork 355
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
[CORL-3006]: Enable anonymous DSA reporting #4469
Conversation
✅ Deploy Preview for gallant-galileo-14878c canceled.
|
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.
Looks good, left one comment, but it is minor. Approved!
let anonymousWithDSA = false; | ||
if (!viewer) { | ||
return null; | ||
if (!settings.dsa?.enabled) { | ||
return null; | ||
} else { | ||
anonymousWithDSA = true; | ||
} | ||
} |
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.
What are your thoughts on this logic? For me, it improves read-ability, but I have a feeling I might be in the minority due to it relying on ?.
operator.
const anonymousWithDSA = !viewer && settings.dsa?.enabled;
if (!settings.dsa?.enabled && !viewer) {
return null;
}
What does this PR do?
These changes enable DSA reports to be made by users who are not signed in. If a user is not signed in, and DSA is enabled, then when they hit the
Report
button for a comment, they will go into a flow that allows them to report illegal content but provides the info that to report a comment in any other way, they must sign in.If DSA is not enabled, the report flow remains as is.
These changes will impact:
What changes to the GraphQL/Database Schema does this PR introduce?
userID
is no longer required for a DSA reportDoes this PR introduce any new environment variables or feature flags?
no
If any indexes were added, were they added to
INDEXES.md
?n/a
How do I test this PR?
You can test this PR by enabling DSA and ensuring you are logged out. Click
Report
for a comment in the stream. See that it says "Report This Comment" and "You have to sign in to report a comment". You should also see a link to report the comment for illegal content. Click that link. Stay signed out and fill out the DSA report. ClickSubmit report
. You should see a submission success screen. Now log in to the admin and go to theDSA Reports
tab. Find the new report you just created. ForReported by
in the overall reports table, it should sayAnonymous user
. Click through to that report's individual page. ForReporter
, it should sayAnonymous user
. Download the report's CSV. In theUser
column, it should say "Anonymous user`.Sign in and report a DSA report. All should still be as before, you should be able to create your report and see the reporter displayed.
Disable DSA. Try to report a comment signed in/out and see that the flow is still as it was. Signed out, you are prompted to sign in before reporting. Signed in, you go to the report form.
Archived comment report flow remains the same, as it doesn't require being signed in.
Were any tests migrated to React Testing Library?
How do we deploy this PR?