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-296]7 view conversation rejection reasons #4405

Merged

Conversation

marcushaddon
Copy link
Contributor

@marcushaddon marcushaddon commented Nov 17, 2023

What does this PR do?

This PR fixes a bug in which the moderation reasons modal doesn't close after seelcting a reason when in the user drawer. It also updates the user deletion flow to include comment rejection reasons when rejecting the deleted users comments.

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

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

None.

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?

Navigate to a user drawer for any usera as an user with mod privileges, with DSA enabled. Reject a comment from the drawer. Observe that a reason is requried, and when one is supplied, the Moderation Reason modal closes.

Find a user with comments with no replies. As that user, request that your account be deleted. In the database, set the scheduled deletion time to something soon. Observe that the account is successfully deteleted, and the comments with no replies are rejected, and the resulting CommentModerationActions specify a reason.

Where any tests migrated to React Testing Library?

No

Copy link

netlify bot commented Nov 17, 2023

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit c222e65
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/6557c0182ef5b50008d14d43

@marcushaddon marcushaddon changed the base branch from develop to feat/dsa-launch-pad November 17, 2023 19:34
@@ -131,7 +133,8 @@ async function moderateComments(
filter: FilterQuery<Comment>,
targetStatus: GQLCOMMENT_STATUS,
now: Date,
isArchived = false
isArchived = false,
rejectionReason?: Moderate["rejectionReason"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the type here be GQLRejectionReason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@kabeaty kabeaty 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!

@kabeaty kabeaty merged commit 5a14b47 into feat/dsa-launch-pad Nov 20, 2023
2 checks passed
@kabeaty kabeaty deleted the feat/CORL-2967-view-conversation-rejection-reasons branch November 20, 2023 19:08
isArchived,
{
code: GQLREJECTION_REASON_CODE.OTHER,
detailedExplanation: "User account deleted",
Copy link
Contributor

@nick-funk nick-funk Nov 20, 2023

Choose a reason for hiding this comment

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

We can translate this using the following:

import { I18n, translate } from "coral-server/services/i18n";
...

const text = "User account deleted";
const key = "common-userDeletion-userAccountDeleted";
const args = {};

const bundle = this.i18n.getBundle(tenant.locale);
const result = translate(bundle, text, key, args);

Then the translations for this can be specified in common.ftl under server/src/core/server/lcoales/en-US.

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.

3 participants