Skip to content

Commit b3e42ff

Browse files
authored
Merge pull request #4595 from coralproject/develop
v9.0.2
2 parents a4684e0 + 5610d9e commit b3e42ff

File tree

18 files changed

+201
-36
lines changed

18 files changed

+201
-36
lines changed

client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coralproject/talk",
3-
"version": "9.0.1",
3+
"version": "9.0.2",
44
"author": "The Coral Project",
55
"homepage": "https://coralproject.net/",
66
"sideEffects": [

client/src/core/client/admin/components/ModerateCard/MarkersContainer.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useMemo } from "react";
33
import { graphql } from "react-relay";
44

55
import { withFragmentContainer } from "coral-framework/lib/relay";
6+
import { GQLCOMMENT_STATUS } from "coral-framework/schema";
67
import {
78
Flex,
89
HorizontalGutter,
@@ -27,21 +28,29 @@ const markers: Array<
2728
(c: MarkersContainer_comment) => React.ReactElement<any> | null
2829
> = [
2930
(c) =>
30-
(c.status === "PREMOD" && (
31+
(c.status === GQLCOMMENT_STATUS.PREMOD && (
3132
<Localized id="moderate-marker-preMod" key={keyCounter++}>
3233
<Marker color="pending">Pre-Mod</Marker>
3334
</Localized>
3435
)) ||
3536
null,
3637
(c) =>
37-
(c.status === "PREMOD" &&
38+
(c.status === GQLCOMMENT_STATUS.PREMOD &&
3839
c.author &&
3940
c.author.premoderatedBecauseOfEmailAt && (
4041
<Localized id="moderate-marker-preMod-userEmail" key={keyCounter++}>
4142
<Marker color="pending">User email</Marker>
4243
</Localized>
4344
)) ||
4445
null,
46+
(c) =>
47+
(c.status !== GQLCOMMENT_STATUS.PREMOD &&
48+
c.initialStatus === GQLCOMMENT_STATUS.PREMOD && (
49+
<Localized id="moderate-marker-preMod" key={keyCounter++}>
50+
<Marker color="pending">Pre-Mod</Marker>
51+
</Localized>
52+
)) ||
53+
null,
4554
(c) =>
4655
(c.revision &&
4756
c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_LINKS && (
@@ -244,6 +253,7 @@ const enhanced = withFragmentContainer<MarkersContainerProps>({
244253
comment: graphql`
245254
fragment MarkersContainer_comment on Comment {
246255
...ModerateCardDetailsContainer_comment
256+
initialStatus
247257
status
248258
tags {
249259
code

client/src/core/client/admin/components/UserHistoryDrawer/UserDrawerAccountHistory.tsx

+58-23
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,31 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
5050
user,
5151
viewer,
5252
}) => {
53-
const system = (
54-
<Localized
55-
id="moderate-user-drawer-account-history-system"
56-
elems={{
57-
icon: (
53+
const system = useMemo(
54+
() => (
55+
<Localized
56+
id="moderate-user-drawer-account-history-system"
57+
elems={{
58+
icon: (
59+
<SvgIcon
60+
size="md"
61+
className={styles.coralIcon}
62+
Icon={CoralMarkIcon}
63+
/>
64+
),
65+
}}
66+
>
67+
<span>
5868
<SvgIcon
5969
size="md"
6070
className={styles.coralIcon}
6171
Icon={CoralMarkIcon}
62-
/>
63-
),
64-
}}
65-
>
66-
<span>
67-
<SvgIcon size="md" className={styles.coralIcon} Icon={CoralMarkIcon} />{" "}
68-
System
69-
</span>
70-
</Localized>
72+
/>{" "}
73+
System
74+
</span>
75+
</Localized>
76+
),
77+
[]
7178
);
7279

7380
const { localeBundles } = useCoralContext();
@@ -80,12 +87,12 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
8087
minute: "numeric",
8188
second: "numeric",
8289
});
83-
const addSeconds = (date: Date, seconds: number) => {
84-
return new Date(date.getTime() + seconds * 1000);
85-
};
8690

8791
const deletionDescriptionMapping = useCallback(
8892
(updateType: string, createdAt: string) => {
93+
const addSeconds = (date: Date, seconds: number) => {
94+
return new Date(date.getTime() + seconds * 1000);
95+
};
8996
const mapping: { [key: string]: string } = {
9097
REQUESTED: getMessage(
9198
localeBundles,
@@ -117,7 +124,13 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
117124
};
118125
return mapping[updateType];
119126
},
120-
[getMessage, localeBundles, addSeconds, deletionFormatter]
127+
[localeBundles, deletionFormatter]
128+
);
129+
130+
const accountDomainBannedMessage = getMessage(
131+
localeBundles,
132+
"moderate-user-drawer-account-history-account-domain-banned",
133+
"Account domain banned"
121134
);
122135

123136
const combinedHistory = useMemo(() => {
@@ -190,7 +203,15 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
190203
takenBy: record.createdBy ? record.createdBy.username : system,
191204
description:
192205
isSiteBanned && !!user.status.ban.sites
193-
? user.status.ban.sites.map((s) => s.name).join(", ")
206+
? // does the site ban have sites? If so, add to description
207+
user.status.ban.sites.map((s) => s.name).join(", ")
208+
: // is the ban created?
209+
record.active
210+
? // If the ban is created, is it created by the system?
211+
record.createdBy
212+
? ""
213+
: // If the ban is created by the system, show the account domain banned message
214+
accountDomainBannedMessage
194215
: "",
195216
};
196217
} else {
@@ -201,10 +222,19 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
201222
},
202223
date: new Date(record.createdAt),
203224
takenBy: record.createdBy ? record.createdBy.username : system,
204-
description:
205-
siteBan && record.sites
225+
description: siteBan
226+
? // does the site ban have sites? If so, add to description
227+
record.sites
206228
? record.sites.map((s) => s.name).join(", ")
207-
: "",
229+
: ""
230+
: // is the ban created?
231+
record.active
232+
? // If the ban is created, is it created by the system?
233+
record.createdBy
234+
? ""
235+
: // If the ban is created by the system, show the account domain banned message
236+
accountDomainBannedMessage
237+
: "",
208238
});
209239
}
210240
});
@@ -301,7 +331,12 @@ const UserDrawerAccountHistory: FunctionComponent<Props> = ({
301331
}
302332

303333
return dateSortedHistory;
304-
}, [system, user.status, deletionDescriptionMapping]);
334+
}, [
335+
system,
336+
user.status,
337+
deletionDescriptionMapping,
338+
accountDomainBannedMessage,
339+
]);
305340
const formatter = useDateTimeFormatter({
306341
year: "numeric",
307342
month: "long",

common/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "common",
3-
"version": "9.0.1",
3+
"version": "9.0.2",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "common",
3-
"version": "9.0.1",
3+
"version": "9.0.2",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

docs/docs/development.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: A guide to developing and extending Coral.
88
Running Coral for development is very similar to installing Coral via Source as
99
described in our [Getting Started](/#source) guide.
1010

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

1414
```bash

docs/docs/installation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Built with ❤️ by Coral by [Vox Media](https://product.voxmedia.com/).
1919

2020
- MongoDB ^4.2
2121
- Redis ^3.2
22-
- NodeJS ^14.18
23-
- NPM ^8.0
22+
- NodeJS ^18.16.0
23+
- PNPM ^8.0
2424

2525
## Running
2626

@@ -114,7 +114,7 @@ Then start Coral with:
114114

115115
```bash
116116
cd server
117-
ppnpm run start:development
117+
pnpm run start:development
118118
```
119119

120120
Then head on over to http://localhost:3000 to install Coral!

docs/docs/mobile.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: Native Mobile Apps
55

66
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:
77

8-
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`
8+
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.
99
2. Add the domain to the list of permitted domains for your site under **Configure** > **Organization** > **Site Details**
1010
3. Create a web view in your native application which points to this URL
1111
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`:

locales/en-US/admin.ftl

+1
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,7 @@ moderate-user-drawer-account-history-system = <icon></icon> System
12051205
moderate-user-drawer-account-history-suspension-ended = Suspension ended
12061206
moderate-user-drawer-account-history-suspension-removed = Suspension removed
12071207
moderate-user-drawer-account-history-banned = Banned
1208+
moderate-user-drawer-account-history-account-domain-banned = Account domain banned
12081209
moderate-user-drawer-account-history-ban-removed = Ban removed
12091210
moderate-user-drawer-account-history-site-banned = Site banned
12101211
moderate-user-drawer-account-history-site-ban-removed = Site ban removed

locales/fr-FR/stream.ftl

+90
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,17 @@ profile-account-notifications-updated = Vos paramètres de notification ont ét
530530
profile-account-notifications-button = Mettre à jour mes paramètres de notification
531531
profile-account-notifications-button-update = Mise à jour
532532

533+
profile-account-notifications-inPageNotifications = Notifications
534+
profile-account-notifications-includeInPageWhen = M'alerter quand
535+
536+
profile-account-notifications-inPageNotifications-on = Badges activés
537+
profile-account-notifications-inPageNotifications-off = Badges désactivés
538+
539+
profile-account-notifications-showReplies-fromAnyone = de n'importe qui
540+
profile-account-notifications-showReplies-fromStaff = d'un membre de l'équipe
541+
profile-account-notifications-showReplies =
542+
.aria-label = Montrer les réponses venant de
543+
533544
## Report Comment Popover
534545
comments-reportPopover =
535546
.description = Un dialogue pour les commentaires signalés
@@ -794,3 +805,82 @@ stream-footer-links-profile = Profile et réponses
794805
stream-footer-links-discussions = Plus de discussions
795806
.title = Lire plus de discussions
796807

808+
809+
## Notifications
810+
811+
notifications-title = Notifications
812+
notifications-loadMore = Charger plus de notifications
813+
notifications-loadNew = Charger nouvelles notifications
814+
815+
notifications-adjustPreferences = Ajuster les paramètres de notifications dans Mon Profil &gt;<button>Préférences.</button>
816+
817+
notification-comment-toggle-default-open = - Commentaire
818+
notification-comment-toggle-default-closed = + Commentaire
819+
820+
notifications-comment-showRemovedComment = + Afficher le commentaire supprimé
821+
notifications-comment-hideRemovedComment = - Cacher le commentaire supprimé
822+
823+
notification-comment-description-featured = votre commentaire sur "{ $title }" a été mis en avant par un membre de notre équipe.
824+
notification-comment-description-default = sur "{ $title }"
825+
notification-comment-media-image = Image
826+
notification-comment-media-embed = Embed
827+
notification-comment-media-gif = Gif
828+
829+
notifications-yourIllegalContentReportHasBeenReviewed =
830+
Votre signalement de contenu potentiellement illégal a été examiné
831+
notifications-yourCommentHasBeenRejected =
832+
Votre commentaire a été rejeté
833+
notifications-yourCommentHasBeenApproved =
834+
Votre commentaire a été approuvé
835+
notifications-yourCommentHasBeenFeatured =
836+
Votre commentaire a été mis en avant
837+
notifications-yourCommentHasReceivedAReply =
838+
Nouvelle réponse de { $author }
839+
notifications-defaultTitle = Notification
840+
841+
notifications-rejectedComment-body =
842+
Le contenu de votre commentaire ne respecte pas les règles de notre communauté. Le commentaire a été supprimé.
843+
notifications-rejectedComment-wasPending-body =
844+
Le contenu de votre commentaire ne respecte pas les règles de notre communauté.
845+
notifications-reasonForRemoval = Raison de la suppression
846+
notifications-legalGrounds = Motifs légaux
847+
notifications-additionalExplanation = Explication supplémentaire
848+
849+
notifications-repliedComment-hideReply = - Cacher la réponse
850+
notifications-repliedComment-showReply = + Afficher la réponse
851+
notifications-repliedComment-hideOriginalComment = - Cacher mon commentaire
852+
notifications-repliedComment-showOriginalComment = + Afficher mon commentaire
853+
854+
notifications-dsaReportLegality-legal = Contenu légal
855+
notifications-dsaReportLegality-illegal = Contenu potentiellement illégal
856+
notifications-dsaReportLegality-unknown = Inconnu
857+
858+
notifications-rejectionReason-offensive = Ce commentaire contient du langage offesant
859+
notifications-rejectionReason-abusive = Ce commentaire contient du langage abusif
860+
notifications-rejectionReason-spam = Ce commentaire est du spam
861+
notifications-rejectionReason-bannedWord = Mot banni
862+
notifications-rejectionReason-ad = Ce commentaire est une publicité
863+
notifications-rejectionReason-illegalContent = Ce commentaire a du contenu potentiellement illégal
864+
notifications-rejectionReason-harassmentBullying = Ce commentaire contient du harcélement
865+
notifications-rejectionReason-misinformation = Ce commentaire contient des informations inexactes
866+
notifications-rejectionReason-hateSpeech = Ce commentaire contient un discours haineux
867+
notifications-rejectionReason-irrelevant = Ce commentaire n'est pas pertinent à la discussion
868+
notifications-rejectionReason-other = Autre
869+
notifications-rejectionReason-other-customReason = Autre - { $customReason }
870+
notifications-rejectionReason-unknown = Inconnu
871+
872+
notifications-reportDecisionMade-legal =
873+
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é.
874+
notifications-reportDecisionMade-illegal =
875+
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é.
876+
877+
notifications-methodOfRedress-none =
878+
Toutes les décisions de modération sont finales et sans appel
879+
notifications-methodOfRedress-email =
880+
Pour contester une décision qui apparaît ici, veuillez contacter <a>{ $email }</a>
881+
notifications-methodOfRedress-url =
882+
Pour contester une décision qui apparaît ici, veuillez visiter <a>{ $url }</a>
883+
884+
notifications-youDoNotCurrentlyHaveAny = Vous n'avez actuellement aucune notification
885+
886+
notifications-floatingIcon-close = fermer

server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coralproject/talk",
3-
"version": "9.0.1",
3+
"version": "9.0.2",
44
"author": "The Coral Project",
55
"homepage": "https://coralproject.net/",
66
"sideEffects": [

server/src/core/server/graph/resolvers/Comment.ts

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const Comment: GQLCommentTypeResolver<comment.Comment> = {
8181
c.revisions.length > 0
8282
? { revision: getLatestRevision(c), comment: c }
8383
: null,
84+
initialStatus: (c) => (c.revisions.length > 0 ? c.revisions[0].status : null),
8485
canModerate: (c, input, ctx) => {
8586
if (!ctx.user) {
8687
return false;

server/src/core/server/graph/resolvers/CommentRevision.ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ export const CommentRevision: Required<
2121
metadata: (w) => w.revision.metadata || {},
2222
createdAt: (w) => w.revision.createdAt,
2323
media: (w) => w.revision.media,
24+
status: (w) => w.revision.status,
2425
};

server/src/core/server/graph/schema/schema.graphql

+10
Original file line numberDiff line numberDiff line change
@@ -4129,6 +4129,11 @@ type CommentRevision {
41294129
createdAt is the time that the CommentRevision was created.
41304130
"""
41314131
createdAt: Time!
4132+
4133+
"""
4134+
status is the status of the CommentRevision.
4135+
"""
4136+
status: COMMENT_STATUS
41324137
}
41334138

41344139
enum TAG {
@@ -4304,6 +4309,11 @@ type Comment @cacheControl(maxAge: 5) {
43044309
"""
43054310
status: COMMENT_STATUS!
43064311

4312+
"""
4313+
initialStatus represents the Comment's status when it was initially created.
4314+
"""
4315+
initialStatus: COMMENT_STATUS
4316+
43074317
"""
43084318
statusHistory returns a CommentModerationActionConnection that will list
43094319
the history of moderator actions performed on the Comment, with the most

0 commit comments

Comments
 (0)