Skip to content

Commit

Permalink
Merge pull request #4595 from coralproject/develop
Browse files Browse the repository at this point in the history
v9.0.2
  • Loading branch information
tessalt authored Apr 16, 2024
2 parents a4684e0 + 5610d9e commit b3e42ff
Show file tree
Hide file tree
Showing 18 changed files with 201 additions and 36 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "9.0.1",
"version": "9.0.2",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useMemo } from "react";
import { graphql } from "react-relay";

import { withFragmentContainer } from "coral-framework/lib/relay";
import { GQLCOMMENT_STATUS } from "coral-framework/schema";
import {
Flex,
HorizontalGutter,
Expand All @@ -27,21 +28,29 @@ const markers: Array<
(c: MarkersContainer_comment) => React.ReactElement<any> | null
> = [
(c) =>
(c.status === "PREMOD" && (
(c.status === GQLCOMMENT_STATUS.PREMOD && (
<Localized id="moderate-marker-preMod" key={keyCounter++}>
<Marker color="pending">Pre-Mod</Marker>
</Localized>
)) ||
null,
(c) =>
(c.status === "PREMOD" &&
(c.status === GQLCOMMENT_STATUS.PREMOD &&
c.author &&
c.author.premoderatedBecauseOfEmailAt && (
<Localized id="moderate-marker-preMod-userEmail" key={keyCounter++}>
<Marker color="pending">User email</Marker>
</Localized>
)) ||
null,
(c) =>
(c.status !== GQLCOMMENT_STATUS.PREMOD &&
c.initialStatus === GQLCOMMENT_STATUS.PREMOD && (
<Localized id="moderate-marker-preMod" key={keyCounter++}>
<Marker color="pending">Pre-Mod</Marker>
</Localized>
)) ||
null,
(c) =>
(c.revision &&
c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_LINKS && (
Expand Down Expand Up @@ -244,6 +253,7 @@ const enhanced = withFragmentContainer<MarkersContainerProps>({
comment: graphql`
fragment MarkersContainer_comment on Comment {
...ModerateCardDetailsContainer_comment
initialStatus
status
tags {
code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,31 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
user,
viewer,
}) => {
const system = (
<Localized
id="moderate-user-drawer-account-history-system"
elems={{
icon: (
const system = useMemo(
() => (
<Localized
id="moderate-user-drawer-account-history-system"
elems={{
icon: (
<SvgIcon
size="md"
className={styles.coralIcon}
Icon={CoralMarkIcon}
/>
),
}}
>
<span>
<SvgIcon
size="md"
className={styles.coralIcon}
Icon={CoralMarkIcon}
/>
),
}}
>
<span>
<SvgIcon size="md" className={styles.coralIcon} Icon={CoralMarkIcon} />{" "}
System
</span>
</Localized>
/>{" "}
System
</span>
</Localized>
),
[]
);

const { localeBundles } = useCoralContext();
Expand All @@ -80,12 +87,12 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
minute: "numeric",
second: "numeric",
});
const addSeconds = (date: Date, seconds: number) => {
return new Date(date.getTime() + seconds * 1000);
};

const deletionDescriptionMapping = useCallback(
(updateType: string, createdAt: string) => {
const addSeconds = (date: Date, seconds: number) => {
return new Date(date.getTime() + seconds * 1000);
};
const mapping: { [key: string]: string } = {
REQUESTED: getMessage(
localeBundles,
Expand Down Expand Up @@ -117,7 +124,13 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
};
return mapping[updateType];
},
[getMessage, localeBundles, addSeconds, deletionFormatter]
[localeBundles, deletionFormatter]
);

const accountDomainBannedMessage = getMessage(
localeBundles,
"moderate-user-drawer-account-history-account-domain-banned",
"Account domain banned"
);

const combinedHistory = useMemo(() => {
Expand Down Expand Up @@ -190,7 +203,15 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
takenBy: record.createdBy ? record.createdBy.username : system,
description:
isSiteBanned && !!user.status.ban.sites
? user.status.ban.sites.map((s) => s.name).join(", ")
? // does the site ban have sites? If so, add to description
user.status.ban.sites.map((s) => s.name).join(", ")
: // is the ban created?
record.active
? // If the ban is created, is it created by the system?
record.createdBy
? ""
: // If the ban is created by the system, show the account domain banned message
accountDomainBannedMessage
: "",
};
} else {
Expand All @@ -201,10 +222,19 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
},
date: new Date(record.createdAt),
takenBy: record.createdBy ? record.createdBy.username : system,
description:
siteBan && record.sites
description: siteBan
? // does the site ban have sites? If so, add to description
record.sites
? record.sites.map((s) => s.name).join(", ")
: "",
: ""
: // is the ban created?
record.active
? // If the ban is created, is it created by the system?
record.createdBy
? ""
: // If the ban is created by the system, show the account domain banned message
accountDomainBannedMessage
: "",
});
}
});
Expand Down Expand Up @@ -301,7 +331,12 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
}

return dateSortedHistory;
}, [system, user.status, deletionDescriptionMapping]);
}, [
system,
user.status,
deletionDescriptionMapping,
accountDomainBannedMessage,
]);
const formatter = useDateTimeFormatter({
year: "numeric",
month: "long",
Expand Down
2 changes: 1 addition & 1 deletion common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common",
"version": "9.0.1",
"version": "9.0.2",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common",
"version": "9.0.1",
"version": "9.0.2",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: A guide to developing and extending Coral.
Running Coral for development is very similar to installing Coral via Source as
described in our [Getting Started](/#source) guide.

Coral requires NodeJS ^14.18, we recommend using `nvm` to help manage node
Coral requires NodeJS ^18.16.0, we recommend using `nvm` to help manage node
versions: https://github.com/creationix/nvm.

```bash
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Built with ❤️ by Coral by [Vox Media](https://product.voxmedia.com/).

- MongoDB ^4.2
- Redis ^3.2
- NodeJS ^14.18
- NPM ^8.0
- NodeJS ^18.16.0
- PNPM ^8.0

## Running

Expand Down Expand Up @@ -114,7 +114,7 @@ Then start Coral with:

```bash
cd server
ppnpm run start:development
pnpm run start:development
```

Then head on over to http://localhost:3000 to install Coral!
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/mobile.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: Native Mobile Apps

Integration with native mobile applications is done through web view, you will need to host an HTML page which contains your embed code and open a web view to this page. There are many approaches to integrating native and web applications across different mobile operating systems, but any integration will involve the following steps:

1. Host your embed code (find your **Embed code** under **Configure** > **Organization** > **Site Details**) in an HTML page served over HTTPS. For example, `https://yoursitename.com/coral.html`
1. Host your embed code (find your **Embed code** under **Configure** > **Organization** > **Site Details**) in an HTML page served over HTTPS. For example, `https://yoursitename.com/coral.html`. Alternately, host a [proxy service](https://github.com/coralproject/app-proxy) to return the HTML for your embed code.
2. Add the domain to the list of permitted domains for your site under **Configure** > **Organization** > **Site Details**
3. Create a web view in your native application which points to this URL
4. Pass an SSO access token through to the embed code to log in your user. See [Single Sign On](/sso) for information on how to generate an SSO token. There are multiple ways to pass data from a native application to a web view, one method is to encode the access token in a query parameter on the URL hash (ex. `https://yoursitename.com/coral.html#accessToken=ssoToken`) and retrieve the token from the embed code. You can then pass through the `accessToken` option passed to `createStreamEmbed`:
Expand Down
1 change: 1 addition & 0 deletions locales/en-US/admin.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,7 @@ moderate-user-drawer-account-history-system = <icon></icon> System
moderate-user-drawer-account-history-suspension-ended = Suspension ended
moderate-user-drawer-account-history-suspension-removed = Suspension removed
moderate-user-drawer-account-history-banned = Banned
moderate-user-drawer-account-history-account-domain-banned = Account domain banned
moderate-user-drawer-account-history-ban-removed = Ban removed
moderate-user-drawer-account-history-site-banned = Site banned
moderate-user-drawer-account-history-site-ban-removed = Site ban removed
Expand Down
90 changes: 90 additions & 0 deletions locales/fr-FR/stream.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,17 @@ profile-account-notifications-updated = Vos paramètres de notification ont ét
profile-account-notifications-button = Mettre à jour mes paramètres de notification
profile-account-notifications-button-update = Mise à jour

profile-account-notifications-inPageNotifications = Notifications
profile-account-notifications-includeInPageWhen = M'alerter quand

profile-account-notifications-inPageNotifications-on = Badges activés
profile-account-notifications-inPageNotifications-off = Badges désactivés

profile-account-notifications-showReplies-fromAnyone = de n'importe qui
profile-account-notifications-showReplies-fromStaff = d'un membre de l'équipe
profile-account-notifications-showReplies =
.aria-label = Montrer les réponses venant de

## Report Comment Popover
comments-reportPopover =
.description = Un dialogue pour les commentaires signalés
Expand Down Expand Up @@ -794,3 +805,82 @@ stream-footer-links-profile = Profile et réponses
stream-footer-links-discussions = Plus de discussions
.title = Lire plus de discussions


## Notifications

notifications-title = Notifications
notifications-loadMore = Charger plus de notifications
notifications-loadNew = Charger nouvelles notifications

notifications-adjustPreferences = Ajuster les paramètres de notifications dans Mon Profil &gt;<button>Préférences.</button>

notification-comment-toggle-default-open = - Commentaire
notification-comment-toggle-default-closed = + Commentaire

notifications-comment-showRemovedComment = + Afficher le commentaire supprimé
notifications-comment-hideRemovedComment = - Cacher le commentaire supprimé

notification-comment-description-featured = votre commentaire sur "{ $title }" a été mis en avant par un membre de notre équipe.
notification-comment-description-default = sur "{ $title }"
notification-comment-media-image = Image
notification-comment-media-embed = Embed
notification-comment-media-gif = Gif

notifications-yourIllegalContentReportHasBeenReviewed =
Votre signalement de contenu potentiellement illégal a été examiné
notifications-yourCommentHasBeenRejected =
Votre commentaire a été rejeté
notifications-yourCommentHasBeenApproved =
Votre commentaire a été approuvé
notifications-yourCommentHasBeenFeatured =
Votre commentaire a été mis en avant
notifications-yourCommentHasReceivedAReply =
Nouvelle réponse de { $author }
notifications-defaultTitle = Notification

notifications-rejectedComment-body =
Le contenu de votre commentaire ne respecte pas les règles de notre communauté. Le commentaire a été supprimé.
notifications-rejectedComment-wasPending-body =
Le contenu de votre commentaire ne respecte pas les règles de notre communauté.
notifications-reasonForRemoval = Raison de la suppression
notifications-legalGrounds = Motifs légaux
notifications-additionalExplanation = Explication supplémentaire

notifications-repliedComment-hideReply = - Cacher la réponse
notifications-repliedComment-showReply = + Afficher la réponse
notifications-repliedComment-hideOriginalComment = - Cacher mon commentaire
notifications-repliedComment-showOriginalComment = + Afficher mon commentaire

notifications-dsaReportLegality-legal = Contenu légal
notifications-dsaReportLegality-illegal = Contenu potentiellement illégal
notifications-dsaReportLegality-unknown = Inconnu

notifications-rejectionReason-offensive = Ce commentaire contient du langage offesant
notifications-rejectionReason-abusive = Ce commentaire contient du langage abusif
notifications-rejectionReason-spam = Ce commentaire est du spam
notifications-rejectionReason-bannedWord = Mot banni
notifications-rejectionReason-ad = Ce commentaire est une publicité
notifications-rejectionReason-illegalContent = Ce commentaire a du contenu potentiellement illégal
notifications-rejectionReason-harassmentBullying = Ce commentaire contient du harcélement
notifications-rejectionReason-misinformation = Ce commentaire contient des informations inexactes
notifications-rejectionReason-hateSpeech = Ce commentaire contient un discours haineux
notifications-rejectionReason-irrelevant = Ce commentaire n'est pas pertinent à la discussion
notifications-rejectionReason-other = Autre
notifications-rejectionReason-other-customReason = Autre - { $customReason }
notifications-rejectionReason-unknown = Inconnu

notifications-reportDecisionMade-legal =
Le <strong>{ $date }</strong> vous avez signalé un commentaire écrit par <strong>{ $author }</strong> car il contient du contenu potentiellement illégal. Après avoir évalué votre signalement, notre équipe de modération a décidé que ce commentaire <strong>ne semble pas contenir de contenu illégal.</strong> Merci pour votre contribution à la sécurité de notre communauté.
notifications-reportDecisionMade-illegal =
Le <strong>{ $date }</strong> vous avez signalé un commentaire écrit par <strong>{ $author }</strong> car il contient du contenu potentiellement illégal. Après avoir évalué votre signalement, notre équipe de modération a décidé que ce commentaire <strong>contient du contenu illégal</strong> et a été supprimé. D'autres mesures pourront être prises à l'encontre de l'auteur, mais vous n'en serez pas informé. Merci pour votre contribution à la sécurité de notre communauté.

notifications-methodOfRedress-none =
Toutes les décisions de modération sont finales et sans appel
notifications-methodOfRedress-email =
Pour contester une décision qui apparaît ici, veuillez contacter <a>{ $email }</a>
notifications-methodOfRedress-url =
Pour contester une décision qui apparaît ici, veuillez visiter <a>{ $url }</a>

notifications-youDoNotCurrentlyHaveAny = Vous n'avez actuellement aucune notification

notifications-floatingIcon-close = fermer
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "9.0.1",
"version": "9.0.2",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
1 change: 1 addition & 0 deletions server/src/core/server/graph/resolvers/Comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const Comment: GQLCommentTypeResolver<comment.Comment> = {
c.revisions.length > 0
? { revision: getLatestRevision(c), comment: c }
: null,
initialStatus: (c) => (c.revisions.length > 0 ? c.revisions[0].status : null),
canModerate: (c, input, ctx) => {
if (!ctx.user) {
return false;
Expand Down
1 change: 1 addition & 0 deletions server/src/core/server/graph/resolvers/CommentRevision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export const CommentRevision: Required<
metadata: (w) => w.revision.metadata || {},
createdAt: (w) => w.revision.createdAt,
media: (w) => w.revision.media,
status: (w) => w.revision.status,
};
10 changes: 10 additions & 0 deletions server/src/core/server/graph/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4129,6 +4129,11 @@ type CommentRevision {
createdAt is the time that the CommentRevision was created.
"""
createdAt: Time!

"""
status is the status of the CommentRevision.
"""
status: COMMENT_STATUS
}

enum TAG {
Expand Down Expand Up @@ -4304,6 +4309,11 @@ type Comment @cacheControl(maxAge: 5) {
"""
status: COMMENT_STATUS!

"""
initialStatus represents the Comment's status when it was initially created.
"""
initialStatus: COMMENT_STATUS

"""
statusHistory returns a CommentModerationActionConnection that will list
the history of moderator actions performed on the Comment, with the most
Expand Down
Loading

0 comments on commit b3e42ff

Please sign in to comment.