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.6.0 - DSA: develop into main #4423

Merged
merged 363 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
363 commits
Select commit Hold shift + click to select a range
9f32e94
WIP: updating pipeline tests
marcushaddon Oct 22, 2023
860f81b
Merge pull request #4367 from coralproject/feat/CORL-2916-illegal-con…
kabeaty Oct 23, 2023
4605066
Merge branch 'feat/dsa-launch-pad' into feat/CORL-2934-moderating-ill…
kabeaty Oct 23, 2023
99677f0
add styles and formatting to report history
kabeaty Oct 23, 2023
81818a7
add ability to change report status from singlereport page
kabeaty Oct 23, 2023
e2c9fd9
add ability to download report info; also delete report notes
kabeaty Oct 23, 2023
dab645d
add report shared to report history; show reports tab only when dsa e…
kabeaty Oct 24, 2023
c529e95
some cleanup
kabeaty Oct 24, 2023
598e590
refactor reportstable
kabeaty Oct 24, 2023
1073be5
add autoloadmore to reports table
kabeaty Oct 24, 2023
47c652b
add localizations for reports table
kabeaty Oct 24, 2023
7456322
add single report localizations
kabeaty Oct 24, 2023
ff21e84
add more localization and comments throughout
kabeaty Oct 24, 2023
00f3340
remove comment
marcushaddon Oct 24, 2023
3106951
check if target user exists before creating notifications
nick-funk Oct 24, 2023
c8266b8
ensure whitespace displayed for report data
kabeaty Oct 25, 2023
aba8eb1
add reports link back button to single report page
kabeaty Oct 25, 2023
b2a7012
add empty reports table message; title not available; loading spinner
kabeaty Oct 25, 2023
436b1f0
refactor for organization
kabeaty Oct 25, 2023
f704ea7
add in initial decision modal
kabeaty Oct 25, 2023
21491ac
WIP: adapting external moderation phase
marcushaddon Oct 25, 2023
815b451
preliminarily hook up notification seen state resolvers
nick-funk Oct 24, 2023
00e7ddb
use bell icon for notifications
nick-funk Oct 25, 2023
310bedf
handle hasNewNotifications within the local relay state
nick-funk Oct 25, 2023
068cebd
update fixtures to handle new notification resolvers
nick-funk Oct 25, 2023
cd33c2b
preliminarily visualize seen state on notifications
nick-funk Oct 25, 2023
f182afb
use memo for notification seen state
nick-funk Oct 25, 2023
5b678e6
add reports table completed filter; add lastUpdated column; report hi…
kabeaty Oct 26, 2023
663c2f9
add fields to models
marcushaddon Oct 2, 2023
8beed40
update models for new requirements
marcushaddon Oct 26, 2023
94f8394
resolve conflicts
marcushaddon Oct 26, 2023
58342b9
update to download dsareport csv
kabeaty Oct 27, 2023
bce8f24
update to new RejectionReason model
marcushaddon Oct 27, 2023
11895b7
map external moderation phase api to new internal model
marcushaddon Oct 27, 2023
9504b97
clean up
marcushaddon Oct 27, 2023
136da3e
skip external moderation phase if dsa enabled
marcushaddon Oct 27, 2023
45ef2bf
WIP making dsa and external moderation mutually exclusive
marcushaddon Oct 27, 2023
f5ef572
add initial makereportdecision
kabeaty Oct 30, 2023
7785a0f
add links to stream and moderation for reported comment
kabeaty Oct 30, 2023
89608a2
add resolvers for DSA deports associated to a notification
nick-funk Oct 30, 2023
186689f
fix typos
kabeaty Oct 30, 2023
1c62aed
Merge pull request #4382 from coralproject/feat/rejection-reason-models
kabeaty Oct 30, 2023
f709446
Merge branch 'feat/dsa-launch-pad' into feat/CORL-2934-moderating-ill…
kabeaty Oct 30, 2023
92aeae7
explain external moderation absense on frontend
marcushaddon Oct 30, 2023
0071c52
add dsa notification details comments to schema
nick-funk Oct 30, 2023
9f825eb
WIP: positioning dropdown
marcushaddon Oct 30, 2023
a9ab148
update notification styles to better match figma designs
nick-funk Oct 30, 2023
27091a0
change status modal; create comm mod actions on decision made; update…
kabeaty Oct 31, 2023
1609bd1
update download dsareport linting
kabeaty Oct 31, 2023
da57277
add null/undefined check when setting lastSeenNotificationDate
nick-funk Oct 31, 2023
bfde8bb
WIP: implementing design
marcushaddon Oct 31, 2023
aee29f9
gdpr updates; make decision flow updates; style and copy updates
kabeaty Nov 1, 2023
c80f9cb
refactor reportmakedecisionmodal into own component
kabeaty Nov 1, 2023
c808692
updates to report history ux
kabeaty Nov 1, 2023
f6c8d6f
small style and copy updates
kabeaty Nov 1, 2023
8af1579
implement detailedExplanation tab
marcushaddon Nov 1, 2023
1ed656c
remove eslint disable
marcushaddon Nov 1, 2023
05776e8
fix test selector
marcushaddon Nov 1, 2023
e9fcfc4
implement preliminary comment styling for stream notifications
nick-funk Nov 1, 2023
daa73ea
add title to notifications tab content area
nick-funk Nov 1, 2023
71c75a8
break reportedcomment and changestatusmodal into own components
kabeaty Nov 2, 2023
9ad3fbb
add more localizations
kabeaty Nov 2, 2023
7790a5e
report status localization updates
kabeaty Nov 2, 2023
95670a0
update make report decision reject/approve
kabeaty Nov 2, 2023
c879e5e
Merge branch 'feat/dsa-launch-pad' into feat/dsa-notifications
nick-funk Nov 2, 2023
c8cf99d
rename loader function for single DSA Report
nick-funk Nov 2, 2023
1f9b5d0
persist commentStatus onto notification
nick-funk Nov 2, 2023
5a845a7
more localization
kabeaty Nov 2, 2023
593e150
improve report csv layout and filename
kabeaty Nov 2, 2023
990b952
rename `publicID` to `referenceID`
nick-funk Nov 3, 2023
d21fa29
localize dsareport csv download copy
kabeaty Nov 3, 2023
f1fdab0
linting
kabeaty Nov 3, 2023
b6cfd49
update gdpr delete for dsareports; update icons
kabeaty Nov 3, 2023
7641aea
improve reportmakedecisionmodal readability
kabeaty Nov 3, 2023
3f8acb1
update changestatusmodal design and copy
kabeaty Nov 6, 2023
bd2ac51
update dsareports on gdpr delete only if dsa enabled
kabeaty Nov 6, 2023
13f8017
refactor notifications css for brevity
nick-funk Nov 6, 2023
14b6b1e
improve readability of lastSeenNotificationDate state logic
nick-funk Nov 6, 2023
2350c0b
allow DSA feature state be overridden by tests
nick-funk Nov 6, 2023
e07e71e
move localization to common
marcushaddon Nov 6, 2023
e2313ad
fix linting
kabeaty Nov 6, 2023
7de607a
feature parity on stream side
marcushaddon Nov 6, 2023
0940a63
add initial dsaReport table tests
kabeaty Nov 6, 2023
3a2e869
add single dsareports initial tests
kabeaty Nov 6, 2023
6212b88
updates to update dsa report on account delete; and report download
kabeaty Nov 7, 2023
6dfe16f
add tests for adding notes, changing status, and making decision on a…
kabeaty Nov 7, 2023
4b37b41
remove comment
kabeaty Nov 7, 2023
6e9bb23
remove comment
marcushaddon Nov 7, 2023
d2fae9a
include reason when system rejecting
marcushaddon Nov 8, 2023
bc7759e
implement stateful reject button for dsa
marcushaddon Nov 8, 2023
d1c5437
add legalhammer icon to makedecision button
kabeaty Nov 9, 2023
7131567
update status icons in reportstable
kabeaty Nov 9, 2023
81b2b64
Remove backtocomments button from illegal content report form
kabeaty Nov 9, 2023
eca2f4c
update test
kabeaty Nov 9, 2023
b85002d
Merge pull request #4377 from coralproject/feat/CORL-2948-emit-modera…
marcushaddon Nov 9, 2023
167cb14
Merge pull request #4376 from coralproject/feat/dsa-notifications
nick-funk Nov 9, 2023
4d7b6e7
address review feedback
kabeaty Nov 9, 2023
4009dfa
Merge branch 'feat/dsa-launch-pad' into feat/CORL-2934-moderating-ill…
kabeaty Nov 9, 2023
2c7f12d
Merge pull request #4379 from coralproject/feat/CORL-2934-moderating-…
kabeaty Nov 9, 2023
9912155
preliminarily send notification for comments decided as illegal
nick-funk Nov 9, 2023
766a332
preliminarily format legal grounds/explanation into notifications
nick-funk Nov 9, 2023
cc532c0
improve validation for adding additional comments
kabeaty Nov 10, 2023
e1c79f5
fix popover ref issue
marcushaddon Nov 10, 2023
7621a52
notify reporting users of the decisions made on DSA reports
nick-funk Nov 10, 2023
5862ccc
provide default visibility state for comments tied to notifications
nick-funk Nov 10, 2023
b6966d3
remove errant console.log
nick-funk Nov 10, 2023
73b0a16
Merge branch 'develop' into feat/dsa-launch-pad
kabeaty Nov 13, 2023
c2ed718
fix linting
kabeaty Nov 13, 2023
cdd59ca
fix args after merge in develop
kabeaty Nov 13, 2023
6e0d743
WIP: fixed test
marcushaddon Nov 13, 2023
f565256
plumb i18n through
marcushaddon Nov 13, 2023
fa82a39
Merge branch 'feat/dsa-launch-pad' into reject-reason-backend
marcushaddon Nov 13, 2023
768fe95
fix schema syntax error
marcushaddon Nov 13, 2023
14c867a
address comments
marcushaddon Nov 13, 2023
321d718
update status change dropdown and status icons
kabeaty Nov 13, 2023
f13ea54
update snapshot
marcushaddon Nov 13, 2023
b18e52c
Merge pull request #4372 from coralproject/reject-reason-backend
marcushaddon Nov 13, 2023
e879bdd
Update decision styles for completed reports
kabeaty Nov 14, 2023
1a87a22
send through rejection reason when decision made on illegal content r…
kabeaty Nov 14, 2023
2a63a26
update decision section styles of single reports table
kabeaty Nov 14, 2023
beb9bf2
update svgicon fill/color and address some todo
kabeaty Nov 14, 2023
d616623
remove unused icon; refactor
kabeaty Nov 14, 2023
0a73efc
Merge pull request #4393 from coralproject/feat/CORL-2934-reason-mode…
kabeaty Nov 14, 2023
c7f9868
update decision icon styles in single report page
kabeaty Nov 14, 2023
177d156
Merge branch 'feat/dsa-launch-pad' into feat/hookup-more-dsa-notifica…
nick-funk Nov 14, 2023
15a715d
remove errant comma
nick-funk Nov 14, 2023
904451f
update icon used for void status
kabeaty Nov 14, 2023
fad3f77
handle DSA rejection reasons in notifications
nick-funk Nov 14, 2023
6dd50e8
add ability to delete additional comment
kabeaty Nov 14, 2023
d0cbc39
persist notification type on documents
nick-funk Nov 14, 2023
c4dd0f1
update report link copy
kabeaty Nov 14, 2023
81a9a0d
Merge pull request #4391 from coralproject/feat/hookup-more-dsa-notif…
kabeaty Nov 14, 2023
64f2783
update report illegal content link
kabeaty Nov 14, 2023
f221395
make DetailedExplanation select field readonly
marcushaddon Nov 14, 2023
53006ae
fix test
kabeaty Nov 14, 2023
6a2a586
add method of redress to DSA tenant settings
nick-funk Nov 14, 2023
b181d22
preliminarily show different icons for notification types
nick-funk Nov 14, 2023
391959e
update copy for dsa report decision notifications
nick-funk Nov 14, 2023
8288277
preliminarily add copy for illegal rejection notifications
nick-funk Nov 14, 2023
0509153
use new copy for general comment rejection notifications
nick-funk Nov 15, 2023
c1a62df
plumg rejectionReason and decisionDetails into notifications
nick-funk Nov 15, 2023
859fa81
handle rejected comment notification formatting stream side
nick-funk Nov 15, 2023
856c89a
format dsa report decision notifications stream side
nick-funk Nov 15, 2023
103bb87
remove title and body from notifications
nick-funk Nov 15, 2023
d334460
update tests
kabeaty Nov 15, 2023
f2ba4e6
disable approve and feature comment rejection notifications
nick-funk Nov 15, 2023
14f10b3
Merge branch 'feat/dsa-notifications-copy-update' into feat/DSA-confi…
nick-funk Nov 15, 2023
e3907fa
Merge pull request #4394 from coralproject/feat/CORL-2934-design-copy…
kabeaty Nov 15, 2023
90f9075
make linter happy with disabled notifications
nick-funk Nov 15, 2023
dc018d5
Merge pull request #4396 from coralproject/feat/dsa-notifications-cop…
kabeaty Nov 15, 2023
e3a501e
update reportform copy
kabeaty Nov 16, 2023
f4802eb
update confirmation screen
kabeaty Nov 16, 2023
5ca290c
update bonafide belief validation; report history download copy
kabeaty Nov 16, 2023
b4cbb78
include illegal content markers for rejected comments in user history…
kabeaty Nov 16, 2023
a18f568
Merge branch 'feat/dsa-launch-pad' into feat/DSA-config-method-of-red…
nick-funk Nov 16, 2023
95b3614
update add additional comments flow
kabeaty Nov 16, 2023
7ddbfd9
update additional comments validation copy
kabeaty Nov 16, 2023
c2866a6
update report decision modal to match designs
kabeaty Nov 16, 2023
60637ec
add cursor pointer on hover styles to reports table
kabeaty Nov 16, 2023
d8c867d
make sure lawbroken reports table cell isnt too big
kabeaty Nov 16, 2023
87d1eed
clicking on Comments tab always goes back to all comments
kabeaty Nov 16, 2023
6ef109b
add email and url options to DSA method of redress config
nick-funk Nov 16, 2023
0e76a29
set right margin on text inputs for dsa methodOfRedress
nick-funk Nov 16, 2023
3d076b3
update link to report illegal content icon
kabeaty Nov 16, 2023
1f35832
show methodOfRedress in notifications tab
nick-funk Nov 16, 2023
656931a
set default methodOfRedress for tenant
nick-funk Nov 16, 2023
6bb79de
update server fixtures for new method of redress format
nick-funk Nov 16, 2023
531a53b
go to top report form on load; add returnToComments on confirm screen…
kabeaty Nov 16, 2023
ac458e1
add icon and otherwise update report submission error styles
kabeaty Nov 16, 2023
f897edf
update styling and copy for rejected comment notifications
nick-funk Nov 16, 2023
8095e5e
update rejected comment notification description copy
nick-funk Nov 16, 2023
2f18e80
update comment rejection notification title text
nick-funk Nov 16, 2023
8a033b0
use the new custom rejected comment icon created by Sam
nick-funk Nov 16, 2023
5e409d0
only update Comments tab when active tab
kabeaty Nov 17, 2023
e45894b
update archived comment report link too
kabeaty Nov 17, 2023
f6ff88c
update decision modal report placeholders
kabeaty Nov 17, 2023
be74f81
update tests with updated copy
kabeaty Nov 17, 2023
98e67f0
update fixtures to include illegal actionCounts
kabeaty Nov 17, 2023
903410c
update tests
kabeaty Nov 17, 2023
d3eb9f8
archived fixes
kabeaty Nov 17, 2023
ceeb89c
reject also needs isArchived
kabeaty Nov 17, 2023
8a10276
update DSA config with new description copy
nick-funk Nov 17, 2023
5c5c87d
require reason in view conversation modal
marcushaddon Nov 17, 2023
28d60ac
add url, email placeholders for DSA method of redress fields
nick-funk Nov 17, 2023
e80e2ac
show reported state on archived stories
nick-funk Nov 17, 2023
534ec5f
remoe unused css class
marcushaddon Nov 17, 2023
20d2bbe
optimize retrieving action presence from archived stories
nick-funk Nov 17, 2023
5646ac2
improve action presence data loader arg params
nick-funk Nov 17, 2023
c222e65
Merge branch 'feat/moderation-reason-fixes' into feat/CORL-2967-view-…
marcushaddon Nov 17, 2023
918f98f
close reason modal on reason
marcushaddon Nov 17, 2023
f45322d
save rejectionReason when rejecting comments to delete user account
marcushaddon Nov 17, 2023
3cf8196
translate status text in csv download; add completed status change on…
kabeaty Nov 20, 2023
7a641d5
update dsa reports tab permissions
kabeaty Nov 20, 2023
e1e3126
Merge pull request #4404 from coralproject/fix/show-reported-state-on…
nick-funk Nov 20, 2023
4092c15
Merge pull request #4399 from coralproject/fix/dsa-notifications-fina…
nick-funk Nov 20, 2023
cfe783c
update to include settings
kabeaty Nov 20, 2023
7b175c2
remove comment
kabeaty Nov 20, 2023
b6bdc40
show placeholder text when user has no notifications
nick-funk Nov 20, 2023
f03ac12
Merge pull request #4402 from coralproject/feat/CORL-2934-more-polish
kabeaty Nov 20, 2023
67e67a5
Merge pull request #4403 from coralproject/feat/dsa-archived-fixes
kabeaty Nov 20, 2023
af3b376
make method of redress options a navigable link
nick-funk Nov 20, 2023
e3e154b
use GQLRejectionReason type
marcushaddon Nov 20, 2023
586bbd6
Merge pull request #4407 from coralproject/dsa/reports-tab-permissions
kabeaty Nov 20, 2023
4f1e9f6
set target="_blank" and rel="noreferrer" on method of redress links
nick-funk Nov 20, 2023
4ce4d1f
Merge pull request #4408 from coralproject/fix/dsa-no-notifications-p…
nick-funk Nov 20, 2023
1afaa49
add updated reasons
marcushaddon Nov 20, 2023
ffb0391
fix typos
kabeaty Nov 20, 2023
5a14b47
Merge pull request #4405 from coralproject/feat/CORL-2967-view-conver…
kabeaty Nov 20, 2023
2d61ee2
Merge pull request #4409 from coralproject/feat/new-rejection-reasons
kabeaty Nov 20, 2023
f8acd90
add further rejection reasons to notifications
nick-funk Nov 20, 2023
294fb31
allow null comment in notifications resolver
nick-funk Nov 20, 2023
60aad2c
don't send notification for reject twice during dsa report decision
nick-funk Nov 20, 2023
2ecf35c
localize rejection reason during account deletion
marcushaddon Nov 20, 2023
d7e7e55
Revert "localize rejection reason during account deletion"
marcushaddon Nov 20, 2023
338a9c2
localize rejection reason during account deletion
marcushaddon Nov 20, 2023
45fb8a5
remove disable input on error
kabeaty Nov 21, 2023
c251571
update illegal content report button copy and styles
kabeaty Nov 21, 2023
7c6c619
fix void csv download
kabeaty Nov 21, 2023
877ccf6
update test
kabeaty Nov 21, 2023
905fbb8
add notification copy updates and bolding for report reviewed
kabeaty Nov 21, 2023
893443c
size the notifications tab consistent with all the other tabs
nick-funk Nov 21, 2023
ff7d056
add strong styles for firefox
kabeaty Nov 21, 2023
fc51c24
Merge pull request #4410 from coralproject/fix/dsa-notifications-more…
kabeaty Nov 21, 2023
db50f62
Merge pull request #4411 from coralproject/fix/dsa-notifications-hand…
kabeaty Nov 21, 2023
bcbcb50
Merge pull request #4412 from coralproject/fix/dsa-notifications-stop…
kabeaty Nov 21, 2023
7c3f112
Merge pull request #4414 from coralproject/fix/dsa-download-void-repo…
kabeaty Nov 21, 2023
fb77bad
Merge pull request #4415 from coralproject/fix/dsa-add-additional
kabeaty Nov 21, 2023
e43d3ba
Merge pull request #4416 from coralproject/fix/dsa-copy-update
kabeaty Nov 21, 2023
b79aa1d
Merge pull request #4417 from coralproject/fix/dsa-notifications-copy…
kabeaty Nov 21, 2023
fa80a70
Merge pull request #4418 from coralproject/fix/dsa-notifications-tab-…
kabeaty Nov 21, 2023
a94bc96
initial updates for rejection modal
kabeaty Nov 21, 2023
6494468
set reason code null on back to select new reason
kabeaty Nov 21, 2023
aad7398
update test
kabeaty Nov 21, 2023
521af72
update copy for dsa admin config
kabeaty Nov 21, 2023
a769a4a
include reason when rejecting all comments during ban
marcushaddon Nov 21, 2023
2973649
fix switched arguments
marcushaddon Nov 21, 2023
f1e045c
add period for consistency
marcushaddon Nov 21, 2023
f0d7cf5
update test
kabeaty Nov 21, 2023
56f9741
match FTL to inline code
marcushaddon Nov 21, 2023
5e04ee6
mock i18n in tests
kabeaty Nov 21, 2023
1d43a1a
Merge branch 'fix/spam-ban-mod-reason' of github.com:coralproject/tal…
kabeaty Nov 21, 2023
11d1863
Merge pull request #4419 from coralproject/fix/dsa-reject-button-updates
kabeaty Nov 21, 2023
a41f37d
Merge pull request #4420 from coralproject/fix/dsa-configure-copy-update
kabeaty Nov 21, 2023
f938884
Merge pull request #4413 from coralproject/fix/localize-rejection-reason
kabeaty Nov 21, 2023
e787421
Merge branch 'feat/dsa-launch-pad' into fix/spam-ban-mod-reason
kabeaty Nov 21, 2023
575a5f1
Merge pull request #4421 from coralproject/fix/spam-ban-mod-reason
kabeaty Nov 21, 2023
855d69f
Merge pull request #4356 from coralproject/feat/dsa-launch-pad
nick-funk Nov 22, 2023
a838acb
update package json to 8.6.0
nick-funk Nov 22, 2023
6caa252
Merge pull request #4422 from coralproject/release-8.6.0
nick-funk Nov 22, 2023
46de21b
Merge branch 'main' into develop
nick-funk Nov 22, 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
14 changes: 14 additions & 0 deletions INDEXES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ The goal of this document is to date-mark the indexes you add to support the cha

If you are releasing, you can use this readme to check all the indexes prior to the release you are deploying and have a good idea of what indexes you might need to deploy to Mongo along with your release of a new Coral Docker image to kubernetes.

## 2023-10-18

```
db.notifications.createIndex({ tenantID: 1, id: 1 }, { unique: true });
```

- This index creates the uniqueness constraint for the `tenantID` and `id` fields on the notifications collection

```
db.notifications.createIndex({ tenantID: 1, ownerID: 1, createdAt: 1 });
```

- This index speeds up the retrieval of notifications by `tenantID`, `ownerID`, and `createdAt` which is the most common way of retrieving notifications for pagination in the notifications tab on the stream.

## 2023-03-28

```
Expand Down
4 changes: 2 additions & 2 deletions client/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 client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "8.5.3",
"version": "8.6.0",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
4 changes: 2 additions & 2 deletions client/scripts/precommitLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ sgf((err, results) => {

const eslintFiles = [];
for (const item of results) {
const { filename } = item;
const { filename, status } = item;

// only include valid, filtered extensions
// this is primarily to keep eslint rampaging
// over non-source files
if (!matchesExtension(extensions, filename)) {
if (!matchesExtension(extensions, filename) || status === "Deleted") {
continue;
}

Expand Down
5 changes: 3 additions & 2 deletions client/src/core/client/admin/App/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ import styles from "./Main.css";
interface Props {
viewer: PropTypesOf<typeof UserMenuContainer>["viewer"] &
PropTypesOf<typeof NavigationContainer>["viewer"];
settings: PropTypesOf<typeof NavigationContainer>["settings"];
children: React.ReactNode;
}

const Main: FunctionComponent<Props> = ({ children, viewer }) => (
const Main: FunctionComponent<Props> = ({ children, viewer, settings }) => (
<div className={styles.root}>
<AppBar gutterBegin gutterEnd>
<Begin itemGutter="double">
<div className={styles.logoContainer}>
<LogoHorizontal />
</div>
<NavigationContainer viewer={viewer} />
<NavigationContainer viewer={viewer} settings={settings} />
</Begin>
<End>
<DecisionHistoryButton />
Expand Down
10 changes: 9 additions & 1 deletion client/src/core/client/admin/App/MainRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const MainRoute: React.FunctionComponent<Props> = (props) => {
return (
<>
{ErrorReporterSetUser}
<Main viewer={props.data && props.data.viewer}>{props.children}</Main>
<Main
viewer={props.data && props.data.viewer}
settings={props.data && props.data.settings}
>
{props.children}
</Main>
</>
);
};
Expand All @@ -33,6 +38,9 @@ const enhanced = withRouteConfig<Props>({
...UserMenuContainer_viewer
...NavigationContainer_viewer
}
settings {
...NavigationContainer_settings
}
}
`,
})(MainRoute);
Expand Down
6 changes: 6 additions & 0 deletions client/src/core/client/admin/App/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import NavigationLink from "./NavigationLink";
interface Props {
showConfigure: boolean;
showDashboard: boolean;
showReports: boolean;
}

const Navigation: FunctionComponent<Props> = (props) => (
Expand All @@ -31,6 +32,11 @@ const Navigation: FunctionComponent<Props> = (props) => (
<NavigationLink to="/admin/dashboard">Dashboard</NavigationLink>
</Localized>
)}
{props.showReports && (
<Localized id="navigation-reports">
<NavigationLink to="/admin/reports">DSA Reports</NavigationLink>
</Localized>
)}
</AppBarNavigation>
);

Expand Down
64 changes: 47 additions & 17 deletions client/src/core/client/admin/App/Navigation/NavigationContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,73 @@
import React from "react";
import React, { FunctionComponent } from "react";
import { graphql } from "react-relay";

import { Ability, can } from "coral-admin/permissions/tenant";
import { withFragmentContainer } from "coral-framework/lib/relay";
import { GQLUSER_ROLE } from "coral-common/client/src/core/client/framework/schema/__generated__/types";
import { useLocal, withFragmentContainer } from "coral-framework/lib/relay";
import {
SignOutMutation,
withSignOutMutation,
} from "coral-framework/mutations";

import { NavigationContainer_settings as SettingsData } from "coral-admin/__generated__/NavigationContainer_settings.graphql";
import { NavigationContainer_viewer as ViewerData } from "coral-admin/__generated__/NavigationContainer_viewer.graphql";
import { NavigationContainerLocal } from "coral-admin/__generated__/NavigationContainerLocal.graphql";

import Navigation from "./Navigation";

interface Props {
signOut: SignOutMutation;
viewer: ViewerData | null;
settings: SettingsData | null;
}

class NavigationContainer extends React.Component<Props> {
public render() {
return (
<Navigation
showDashboard={
!!this.props.viewer && can(this.props.viewer, Ability.VIEW_STATISTICS)
}
showConfigure={
!!this.props.viewer &&
can(this.props.viewer, Ability.CHANGE_CONFIGURATION)
}
/>
);
}
}
const NavigationContainer: FunctionComponent<Props> = ({
viewer,
settings,
}) => {
const [{ dsaFeaturesEnabled }] = useLocal<NavigationContainerLocal>(
graphql`
fragment NavigationContainerLocal on Local {
dsaFeaturesEnabled
}
`
);
return (
<Navigation
showDashboard={!!viewer && can(viewer, Ability.VIEW_STATISTICS)}
showConfigure={!!viewer && can(viewer, Ability.CHANGE_CONFIGURATION)}
showReports={
!!dsaFeaturesEnabled &&
!!viewer &&
can(viewer, Ability.MODERATE_DSA_REPORTS) &&
// Exclude single-site moderators
!(
settings?.multisite &&
viewer.role === GQLUSER_ROLE.MODERATOR &&
viewer.moderationScopes &&
viewer.moderationScopes.sites &&
viewer.moderationScopes.sites.length === 1
)
}
/>
);
};

const enhanced = withSignOutMutation(
withFragmentContainer<Props>({
viewer: graphql`
fragment NavigationContainer_viewer on User {
role
moderationScopes {
sites {
id
}
}
}
`,
settings: graphql`
fragment NavigationContainer_settings on Settings {
multisite
}
`,
})(NavigationContainer)
Expand Down
12 changes: 9 additions & 3 deletions client/src/core/client/admin/components/Comment/InReplyTo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Localized } from "@fluent/react/compat";
import cn from "classnames";
import React, { FunctionComponent } from "react";

import { EmailActionReplyIcon, SvgIcon } from "coral-ui/components/icons";
Expand All @@ -7,19 +8,24 @@ import { BaseButton, Flex } from "coral-ui/components/v2";
import styles from "./InReplyTo.css";

interface Props {
className?: string;
children: string;
onUsernameClick: () => void;
}

const InReplyTo: FunctionComponent<Props> = ({ children, onUsernameClick }) => {
const InReplyTo: FunctionComponent<Props> = ({
className,
children,
onUsernameClick,
}) => {
const Username = () => (
<Localized
id="common-username"
attrs={{ "aria-label": true }}
vars={{ username: children }}
>
<BaseButton onClick={onUsernameClick} className={styles.usernameButton}>
<span className={styles.username}>{children}</span>
<span className={cn(styles.username, className)}>{children}</span>
</BaseButton>
</Localized>
);
Expand All @@ -29,7 +35,7 @@ const InReplyTo: FunctionComponent<Props> = ({ children, onUsernameClick }) => {
<SvgIcon
className={styles.icon}
size="xs"
filled
filled="currentColor"
Icon={EmailActionReplyIcon}
/>{" "}
<Localized
Expand Down
Loading
Loading