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

[CORL-3006]: Enable anonymous DSA reporting #4469

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

kabeaty
Copy link
Contributor

@kabeaty kabeaty commented Dec 19, 2023

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:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

userID is no longer required for a DSA report

Does 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. Click Submit report. You should see a submission success screen. Now log in to the admin and go to the DSA Reports tab. Find the new report you just created. For Reported by in the overall reports table, it should say Anonymous user. Click through to that report's individual page. For Reporter, it should say Anonymous user. Download the report's CSV. In the User 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?

Copy link

netlify bot commented Dec 19, 2023

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit 72fbdee
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/6581f0b0289355000708041b

Copy link
Contributor

@nick-funk nick-funk left a 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!

Comment on lines +29 to 36
let anonymousWithDSA = false;
if (!viewer) {
return null;
if (!settings.dsa?.enabled) {
return null;
} else {
anonymousWithDSA = true;
}
}
Copy link
Contributor

@nick-funk nick-funk Dec 20, 2023

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;
}

@nick-funk nick-funk added this pull request to the merge queue Jan 11, 2024
Merged via the queue into develop with commit 7c52afa Jan 11, 2024
6 checks passed
@nick-funk nick-funk deleted the feat/CORL-3006-dsa-anonymous-reporting branch January 11, 2024 20:03
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