-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4460 from coralproject/develop
[8.6.4] Release (`develop` into `main`)
- Loading branch information
Showing
21 changed files
with
429 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
.../core/client/admin/routes/Configure/sections/Moderation/PremoderateEmailAddressConfig.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { Localized } from "@fluent/react/compat"; | ||
import React, { FunctionComponent } from "react"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { | ||
FieldSet, | ||
FormField, | ||
FormFieldHeader, | ||
Label, | ||
} from "coral-ui/components/v2"; | ||
|
||
import ConfigBox from "../../ConfigBox"; | ||
import Header from "../../Header"; | ||
import HelperText from "../../HelperText"; | ||
import OnOffField from "../../OnOffField"; | ||
|
||
// eslint-disable-next-line no-unused-expressions | ||
graphql` | ||
fragment PremoderateEmailAddressConfig_formValues on Settings { | ||
premoderateEmailAddress { | ||
tooManyPeriods { | ||
enabled | ||
} | ||
} | ||
} | ||
`; | ||
|
||
interface Props { | ||
disabled: boolean; | ||
} | ||
|
||
const PremoderateEmailAddressConfig: FunctionComponent<Props> = ({ | ||
disabled, | ||
}) => { | ||
return ( | ||
<ConfigBox | ||
title={ | ||
<Localized id="configure-moderation-premoderateEmailAddress-title"> | ||
<Header container={<legend />}>Email address</Header> | ||
</Localized> | ||
} | ||
container={<FieldSet />} | ||
> | ||
<FormField container={<FieldSet />}> | ||
<FormFieldHeader> | ||
<Localized id="configure-moderation-premoderateEmailAddress-enabled"> | ||
<Label component="legend"> | ||
Pre-moderate emails with too many periods | ||
</Label> | ||
</Localized> | ||
<Localized id="configure-moderation-premoderateEmailAddress-enabled-description"> | ||
<HelperText> | ||
If a user has three or more periods in the first part of their | ||
email address (before the @), set their status to pre-moderate | ||
comments. Emails with 3 or more periods can have a very high spam | ||
correlation. It can be useful to pro-actively pre-moderate them. | ||
</HelperText> | ||
</Localized> | ||
</FormFieldHeader> | ||
<OnOffField | ||
name="premoderateEmailAddress.tooManyPeriods.enabled" | ||
disabled={disabled} | ||
/> | ||
</FormField> | ||
</ConfigBox> | ||
); | ||
}; | ||
|
||
export default PremoderateEmailAddressConfig; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
server/src/core/server/graph/resolvers/PremoderateEmailAddress.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { | ||
GQLPremoderateEmailAddressConfiguration, | ||
GQLPremoderateEmailAddressConfigurationTypeResolver, | ||
} from "coral-server/graph/schema/__generated__/types"; | ||
|
||
export const PremoderateEmailAddressConfiguration: GQLPremoderateEmailAddressConfigurationTypeResolver<GQLPremoderateEmailAddressConfiguration> = | ||
{ | ||
tooManyPeriods: (config) => | ||
config && config.tooManyPeriods | ||
? config.tooManyPeriods | ||
: { enabled: false }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.