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

v8.5.0 #4329

Merged
merged 134 commits into from
Aug 28, 2023
Merged

v8.5.0 #4329

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
ea04c8f
only show multi site ban options to multi site users
marcushaddon Jul 5, 2023
3a82316
initial spam ban changes
kabeaty Jul 5, 2023
13b056d
add spam ban confirm view
kabeaty Jul 10, 2023
3e36dd9
update moderationdropdown view logic
kabeaty Jul 10, 2023
4b4cbdc
add more localization; fix tests
kabeaty Jul 10, 2023
ffe2757
frontend only solution to removing banned user's comments from queue
marcushaddon Jul 10, 2023
9504193
remove commnet
marcushaddon Jul 10, 2023
5f66d54
remove console.logs
marcushaddon Jul 10, 2023
8c2e2f4
delete comments
marcushaddon Jul 10, 2023
7b66db0
include comment.author.allCommentsRejected to single moderate route
marcushaddon Jul 10, 2023
0ba89d6
add error for cannot ban mod account with privileges
kabeaty Jul 11, 2023
36cda70
test spam ban details and confirmation view
kabeaty Jul 11, 2023
e62f46e
add test for site mod can spam ban commenter
kabeaty Jul 11, 2023
d155a82
add test for mod cannot ban mod with site privileges error
kabeaty Jul 11, 2023
68884da
use variable for spam confirm text
kabeaty Jul 11, 2023
10dbb35
Merge branch 'develop' into feat/CORL-2838-spam-ban-stream-mod
kabeaty Jul 11, 2023
a702a6e
add missing error translation
kabeaty Jul 11, 2023
e31d4ef
address comments
marcushaddon Jul 11, 2023
0575b1e
remove codegen file
marcushaddon Jul 11, 2023
d94cf57
add icons for spam confirm input alert, error msg
kabeaty Jul 11, 2023
5c73869
fix tests
kabeaty Jul 11, 2023
29b0d98
spam confirmation text not case-sensitive
kabeaty Jul 11, 2023
9615f1d
fix failing tests
marcushaddon Jul 11, 2023
687d5a5
add test for hiding comments
marcushaddon Jul 11, 2023
c8d400e
remove it.only
marcushaddon Jul 11, 2023
943f224
remove unneeded optional chaining
marcushaddon Jul 11, 2023
8352b31
Merge branch 'develop' into feat/CORL-2835-rejected-comments-sync-wit…
marcushaddon Jul 11, 2023
bf3c883
consolidate error msgs; allow re-bans
kabeaty Jul 12, 2023
d01785f
update errorCode in moderation test
kabeaty Jul 13, 2023
2c5c7cd
some refactors
kabeaty Jul 13, 2023
ee7ba82
more refactors
kabeaty Jul 13, 2023
0930c34
fix linting; cleanup
kabeaty Jul 13, 2023
1c8dd7f
address comments
marcushaddon Jul 14, 2023
bd8630b
enable hiding of specific sites comments in mod queue
marcushaddon Jul 21, 2023
468b6d3
Merge branch 'develop' into feat/CORL-2835-rejected-comments-sync-wit…
tessalt Jul 24, 2023
ef89b57
improve consistency redis cache key for comment count
kabeaty Jul 24, 2023
c72a65f
cleanup
kabeaty Jul 24, 2023
18d7b57
Merge branch 'feat/CORL-2835-rejected-comments-sync-with-queue' of gi…
marcushaddon Jul 24, 2023
659a77e
Merge pull request #4285 from coralproject/fix/CORL-2853-single-site-…
tessalt Jul 24, 2023
82e9c3b
remove stray file
marcushaddon Jul 24, 2023
9ed9b82
document new local schema field
marcushaddon Jul 24, 2023
727beba
Merge pull request #4296 from coralproject/feat/CORL-2838-spam-ban-st…
tessalt Jul 25, 2023
a3ea525
fix linting error
marcushaddon Jul 25, 2023
86bb2ee
Merge branch 'develop' into feat/CORL-2835-rejected-comments-sync-wit…
marcushaddon Jul 25, 2023
2e7424f
Merge pull request #4300 from coralproject/fix/CORL-2875-improve-coun…
tessalt Aug 1, 2023
5d74e83
Fix up some Dutch translations
rmens Aug 1, 2023
ec48601
Fix up some account strings too
rmens Aug 1, 2023
9b34663
Another small one
rmens Aug 1, 2023
c9598fc
This is even better
rmens Aug 1, 2023
99fcf9d
initial update redis cache comment counts
kabeaty Aug 1, 2023
ccf268e
pass config through where needed
kabeaty Aug 1, 2023
3c2337e
correctly name commentEmbed redis cache key
kabeaty Aug 1, 2023
d73d0e6
update the commentembed redis cache keys too
kabeaty Aug 1, 2023
e0f1b4e
Fix up some e-mails too
rmens Aug 2, 2023
e3c59de
fix linting
kabeaty Aug 2, 2023
17c5388
update to use redis cache key constants for count and comment embed
kabeaty Aug 2, 2023
96f0066
linting and type fixes
kabeaty Aug 2, 2023
9081e7f
add break when comment count is updated
kabeaty Aug 2, 2023
befdc7e
only clear comment embed cache key if jsonp_response_cache set true
kabeaty Aug 2, 2023
217caf0
initial commit to add reject button in conversation modal admin
kabeaty Aug 3, 2023
42923c3
add translations; update disabled styles for reject button
kabeaty Aug 3, 2023
42f07fc
pass rejectAllComments to updateUserBan
marcushaddon Aug 3, 2023
d2d6464
Merge branch 'develop' into feat/CORL-2835-rejected-comments-sync-wit…
marcushaddon Aug 3, 2023
260f345
add tests for conversation modal and reject buttons
kabeaty Aug 4, 2023
ae573ed
add missing deps to callback
kabeaty Aug 4, 2023
0825da5
update test; refactor
kabeaty Aug 7, 2023
f77828a
feat: update workers to use promise based callbacks instead of timeouts
wyattjoh Aug 8, 2023
6b758ca
initial commit to add custom flair badge config to admin
kabeaty Aug 8, 2023
50ae6ba
fix linting; update placeholder; update error msg
kabeaty Aug 8, 2023
9e4a11d
add localization for flair badge config
kabeaty Aug 8, 2023
379b2e4
show flair badge img in stream if present
kabeaty Aug 9, 2023
e85cc9c
update styles to accommodate flair badges
kabeaty Aug 9, 2023
29bd1ae
add comments; remove unused
kabeaty Aug 10, 2023
63c5f4e
add custom flair badges info to sso docs
kabeaty Aug 10, 2023
b22123c
add custom flair badge admin configuration tests
kabeaty Aug 10, 2023
55ba208
add test for rendering custom flair badges in stream
kabeaty Aug 10, 2023
56e9485
add stable classname to flair badge img
kabeaty Aug 10, 2023
42e06d5
make admin flair badge preview same size as stream
kabeaty Aug 11, 2023
396348c
simplify `renders username and body` fixture for speed
nick-funk Aug 14, 2023
53ece0a
reference singleCommentStory for rest of test
nick-funk Aug 14, 2023
d37cc9a
update flair badges to be identified by unique names
nick-funk Aug 14, 2023
680e8b8
fix broken flair badges toggle in Configure > General
nick-funk Aug 14, 2023
d5754e7
Update flair tests and fix flair badge input validation
nick-funk Aug 14, 2023
bbb7d50
update test fixture to use new flair identifiers
nick-funk Aug 14, 2023
3433ee3
update docs for new flair badge name, url pairing
nick-funk Aug 15, 2023
012b36b
constrain flair badge names to alpha-numeric, `-`, and `.`
nick-funk Aug 15, 2023
61459ad
allow flair badge errors to clear if resolved
nick-funk Aug 15, 2023
3f4a0f0
Update flair form input labels
nick-funk Aug 15, 2023
ecc66f1
only show create flair badge input validation on submit
nick-funk Aug 15, 2023
dca7344
replace flair badge callouts with validation error components
nick-funk Aug 15, 2023
d392ea2
remove unnecessary final form components from flair config
nick-funk Aug 15, 2023
f69b1fb
update flair config tests for show validation errors on submit
nick-funk Aug 15, 2023
db78722
Replace gcr with gar
iambrianchan Aug 15, 2023
9a5bb31
Change the name of the step to Login to GAR
iambrianchan Aug 16, 2023
19631f0
Use the GAR_JSON_KEY for the build-test-deploy workflow
iambrianchan Aug 16, 2023
71458c7
Merge pull request #4318 from coralproject/bchan/gar
iambrianchan Aug 16, 2023
6c69a34
Merge pull request #4317 from coralproject/fix/CORL-2882-flaky-slow-test
tessalt Aug 17, 2023
ccd268c
Merge branch 'develop' into patch-1
tessalt Aug 17, 2023
f73984c
Merge pull request #4310 from coralproject/feat/CORL-2844-add-reject-…
tessalt Aug 17, 2023
c8e2fef
Merge branch 'develop' into feat/CORL-2835-rejected-comments-sync-wit…
tessalt Aug 17, 2023
9ea46c7
Merge pull request #4308 from coralproject/fix/CORL-2875-fix-comment-…
tessalt Aug 18, 2023
b177389
Merge pull request #4291 from coralproject/feat/CORL-2835-rejected-co…
tessalt Aug 18, 2023
ac13f34
Merge branch 'develop' into feat/CORL-2859-flair-badges
nick-funk Aug 18, 2023
9e31852
Merge pull request #4312 from coralproject/wyattjoh/promise-worker-th…
tessalt Aug 21, 2023
3c4d953
Merge pull request #4316 from coralproject/feat/CORL-2859-flair-badges
tessalt Aug 21, 2023
ecc5b97
Merge branch 'develop' into fix/CORL-2877-comment-counts-use-redis-cache
kabeaty Aug 21, 2023
5c6e378
Merge branch 'develop' into fix/CORL-2877-comment-counts-use-redis-cache
tessalt Aug 21, 2023
8983837
Merge pull request #4309 from coralproject/fix/CORL-2877-comment-coun…
tessalt Aug 21, 2023
0527451
Merge branch 'develop' into patch-1
tessalt Aug 22, 2023
e5af8e3
add defaults for flair badge config
kabeaty Aug 22, 2023
39370ab
Merge pull request #4307 from rmens/patch-1
tessalt Aug 22, 2023
88ddf0a
Merge pull request #4321 from coralproject/fix/CORL-2859-flair-badges…
tessalt Aug 22, 2023
b9b666f
update refresh and close button display
kabeaty Aug 22, 2023
9ec9d58
make sure broken image urls preview for flair badges
nick-funk Aug 23, 2023
1a985f7
update reject button and comment spacing in admin conversation modal
kabeaty Aug 24, 2023
0bf9bf2
Revert "Merge pull request #4312 from coralproject/wyattjoh/promise-w…
nick-funk Aug 24, 2023
596bd71
optimize CommentContainer.spec.tsx test initialization
nick-funk Aug 24, 2023
18414e9
Merge pull request #4326 from coralproject/fix/revert-wordlist-worker…
tessalt Aug 24, 2023
abae2e6
Merge pull request #4325 from coralproject/fix/CORL-2844-reject-butto…
tessalt Aug 24, 2023
e0e0552
create flair image preview component with error states
nick-funk Aug 24, 2023
b159049
Merge pull request #4323 from coralproject/fix/CORL-2887-refresh-icon…
tessalt Aug 24, 2023
e9a1d16
show not found svg for flair bage image previews
nick-funk Aug 24, 2023
6246a83
Merge branch 'develop' into fix/CORL-2895-broken-image-preview
nick-funk Aug 24, 2023
ce7d87f
Merge pull request #4327 from coralproject/fix/optimize-comment-conta…
tessalt Aug 25, 2023
849a2ce
use svg icon instead of direct icon component
nick-funk Aug 25, 2023
55e4134
refactor FlairBadgeNotFoundIcon into ImageFileWarningIcon
nick-funk Aug 25, 2023
cc338ac
Merge branch 'develop' into fix/CORL-2895-broken-image-preview
nick-funk Aug 25, 2023
901dc46
remove stroke width
nick-funk Aug 25, 2023
d9aad73
clean up import to all come from `coral-ui/components/icons`;
nick-funk Aug 25, 2023
a039463
alphabet sort the icons exports
nick-funk Aug 25, 2023
168e7fc
Merge pull request #4324 from coralproject/fix/CORL-2895-broken-image…
tessalt Aug 25, 2023
60e8a3b
bump to 8.5.0
tessalt Aug 22, 2023
994bfcb
Merge pull request #4322 from coralproject/release-8.5.0
tessalt Aug 28, 2023
a50fff7
Merge branch 'main' into develop
tessalt Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
merge_group:

env:
IMAGE_REPOSITORY: 'gcr.io/the-coral-project/coral'
IMAGE_REPOSITORY: 'us-east1-docker.pkg.dev/the-coral-project/coral/talk'
IMAGE_CACHE_REPOSITORY: 'coralproject/ci'
DOCKERHUB_USERNAME: 'coralproject'

Expand All @@ -27,12 +27,12 @@ jobs:
with:
ssh-private-key: ${{ secrets.REPO_PATCHED_DEPLOY_KEY }}
-
name: Login to GCR
name: Login to GAR
uses: docker/login-action@v2
with:
registry: gcr.io
registry: us-east1-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
password: ${{ secrets.GAR_JSON_KEY }}
-
name: Login to Docker Hub
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCR_JSON_KEY }}'
credentials_json: '${{ secrets.GAR_JSON_KEY }}'
-
name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v1'
Expand Down
10 changes: 6 additions & 4 deletions docs/docs/sso.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ You will then have to generate a JWT with the following claims:
about status changes on a user account such as bans or suspensions.
- `user.username` **(required)** - the username that should be used when being
presented inside Coral to moderators and other users. There are no username validations or restrictions enforced by Coral when you're using SSO.
- `user.badges` _(optional)_ - array of strings to be displayed as badges beside
username inside Coral, visible to other users and moderators. For example, to indicate
a user's subscription status. If you include the claim, but you are not passing a badge value, then use an empty array instead of null.
- `user.badges` _(optional)_ - array of strings to be displayed as badges and custom flair badges beside username inside Coral,
visible to other users and moderators. Badges are configured by passing through strings and can be used to indicate a user's subscription status.
- Custom flair badges are configured by passing through names that link to the desired flair badge image.
- To use custom flair badges, they must also be enabled in the admin, and each custom flair badge name, image URL must be added in the admin as well. If you include the badges claim, but you are not passing a badge value, then use an empty array instead of null.
- `user.role` _(optional)_ - one of "COMMENTER", "STAFF", "MODERATOR", "ADMIN". Will create/update
Coral user with this permission level. When users have both an assigned role greather than COMMENTER and a badge, both will be displayed.
- `user.url` _(optional)_ - url for user account management, where a user will
Expand All @@ -55,7 +56,8 @@ An example of the claims for this token would be:
"user": {
"id": "628bdc61-6616-4add-bfec-dd79156715d4",
"email": "[email protected]",
"username": "bob"
"username": "bob",
"badges": ["subscriber", "https://www.example/com/image.jpg"]
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "8.4.2",
"version": "8.5.0",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
159 changes: 90 additions & 69 deletions src/core/client/admin/components/BanModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Localized } from "@fluent/react/compat";
import { FORM_ERROR } from "final-form";
import React, {
FunctionComponent,
useCallback,
Expand Down Expand Up @@ -221,27 +222,40 @@ const BanModal: FunctionComponent<Props> = ({
const onFormSubmit = useCallback(async () => {
switch (updateType) {
case UpdateType.ALL_SITES:
await banUser({
userID, // Should be defined because the modal shouldn't open if author is null
message: customizeMessage ? emailMessage : getDefaultMessage,
rejectExistingComments,
siteIDs: viewerIsScoped
? viewer?.moderationScopes?.sites?.map(({ id }) => id)
: [],
});
try {
await banUser({
userID, // Should be defined because the modal shouldn't open if author is null
message: customizeMessage ? emailMessage : getDefaultMessage,
rejectExistingComments,
siteIDs: viewerIsScoped
? viewer?.moderationScopes?.sites?.map(({ id }) => id)
: [],
});
} catch (err) {
return { [FORM_ERROR]: err.message };
}
break;
case UpdateType.SPECIFIC_SITES:
await updateUserBan({
userID,
message: customizeMessage ? emailMessage : getDefaultMessage,
banSiteIDs,
unbanSiteIDs,
});
try {
await updateUserBan({
userID,
message: customizeMessage ? emailMessage : getDefaultMessage,
banSiteIDs,
unbanSiteIDs,
rejectExistingComments,
});
} catch (err) {
return { [FORM_ERROR]: err.message };
}
break;
case UpdateType.NO_SITES:
await removeUserBan({
userID,
});
try {
await removeUserBan({
userID,
});
} catch (err) {
return { [FORM_ERROR]: err.message };
}
}
if (banDomain) {
void createDomainBan({
Expand Down Expand Up @@ -326,59 +340,66 @@ const BanModal: FunctionComponent<Props> = ({
>
{/* BAN FROM/REJECT COMMENTS */}
<Flex direction="column">
{/* ban from header */}
<Localized id="community-banModal-banFrom">
<Label className={styles.banFromHeader}>Ban from</Label>
</Localized>
<Flex
direction="row"
className={styles.sitesOptions}
justifyContent="flex-start"
spacing={5}
>
{/* sites options */}
{showAllSitesOption && (
<FormField>
<Localized id="community-banModal-allSites">
<RadioButton
checked={updateType === UpdateType.ALL_SITES}
onChange={() =>
setUpdateType(UpdateType.ALL_SITES)
}
disabled={userBanStatus?.active}
>
All sites
</RadioButton>
</Localized>
</FormField>
)}
<FormField>
<Localized id="community-banModal-specificSites">
<RadioButton
checked={updateType === UpdateType.SPECIFIC_SITES}
onChange={() =>
setUpdateType(UpdateType.SPECIFIC_SITES)
}
>
Specific Sites
</RadioButton>
{isMultisite && (
<>
<Localized id="community-banModal-banFrom">
<Label className={styles.banFromHeader}>
Ban from
</Label>
</Localized>
</FormField>
{!viewerIsScoped && userHasAnyBan && (
<FormField>
<Localized id="community-banModal-noSites">
<RadioButton
checked={updateType === UpdateType.NO_SITES}
onChange={() =>
setUpdateType(UpdateType.NO_SITES)
}
>
No Sites
</RadioButton>
</Localized>
</FormField>
)}
</Flex>
<Flex
direction="row"
className={styles.sitesOptions}
justifyContent="flex-start"
spacing={5}
>
{/* sites options */}
{showAllSitesOption && (
<FormField>
<Localized id="community-banModal-allSites">
<RadioButton
checked={updateType === UpdateType.ALL_SITES}
onChange={() =>
setUpdateType(UpdateType.ALL_SITES)
}
disabled={userBanStatus?.active}
>
All sites
</RadioButton>
</Localized>
</FormField>
)}
<FormField>
<Localized id="community-banModal-specificSites">
<RadioButton
checked={
updateType === UpdateType.SPECIFIC_SITES
}
onChange={() =>
setUpdateType(UpdateType.SPECIFIC_SITES)
}
>
Specific Sites
</RadioButton>
</Localized>
</FormField>
{!viewerIsScoped && userHasAnyBan && (
<FormField>
<Localized id="community-banModal-noSites">
<RadioButton
checked={updateType === UpdateType.NO_SITES}
onChange={() =>
setUpdateType(UpdateType.NO_SITES)
}
>
No Sites
</RadioButton>
</Localized>
</FormField>
)}
</Flex>
</>
)}
{/* reject comments option */}
{updateType !== UpdateType.NO_SITES && (
<Localized
Expand Down
Loading
Loading