Compare commits

...
606 Commits
Author SHA1 Message Date
Wyatt Johnson 7446712109 Merge pull request #1131 from coralproject/wyattjoh-patch-1
Disable e2e
2017-10-25 14:10:39 -06:00
Wyatt Johnson 6647e22d1c Update circle.yml 2017-10-25 14:05:04 -06:00
Belén Curcio 1e718532f3 Merge pull request #1129 from coralproject/community-pagination-
Adding a pause after admin login - Cross browser compat [E2E]
2017-10-25 16:05:27 -03:00
Belén Curcio 6d797b44c8 Merge branch 'master' into community-pagination- 2017-10-25 15:59:33 -03:00
Belen Curcio dbd7f26311 Adding pause after login 2017-10-25 15:57:57 -03:00
Kim Gardner 11f774ecab Merge pull request #1123 from coralproject/community-pagination-
Community/Stories Refactor and Paginate Component
2017-10-25 19:23:14 +01:00
Chi Vinh Le d472223ee3 Fix/Implement sorting for stories 2017-10-25 19:32:47 +02:00
Chi Vinh Le b4daf8fc98 Move searchValue to Redux 2017-10-25 19:19:59 +02:00
Chi Vinh Le e41c224e3d Remove unused 2017-10-25 19:14:25 +02:00
Chi Vinh Le 20b5525c48 Refactor and fix query 2017-10-25 19:07:14 +02:00
Chi Vinh Le 23da613f2b Declaratively set page 2017-10-25 18:02:18 +02:00
Chi Vinh Le df079d29bd Set current page declaratively for People 2017-10-25 17:38:58 +02:00
Kiwi e782df815b Merge branch 'master' into community-pagination- 2017-10-25 17:09:34 +02:00
Kiwi 9bfc17d332 Merge pull request #1128 from coralproject/viewing-options-bug
Viewing Options Styling bug
2017-10-25 17:09:21 +02:00
Chi Vinh Le 3ff47dc610 Fix ci 2017-10-25 16:47:51 +02:00
Kim Gardner ed929fa2c6 Merge branch 'master' into viewing-options-bug 2017-10-25 14:32:07 +01:00
Kim Gardner 369e974a0c Merge branch 'master' into community-pagination- 2017-10-25 14:32:03 +01:00
Kim Gardner 2a90956a1d Merge pull request #1127 from coralproject/iefixes
IE & Edge fixes
2017-10-25 14:31:46 +01:00
Belen Curcio 833922f0aa Missing reference to the dropdownContainer class 2017-10-25 09:35:08 -03:00
Kiwi f6f9d380f1 Merge branch 'master' into iefixes 2017-10-25 14:22:06 +02:00
Chi Vinh Le 823bf18335 Add edge to ci 2017-10-25 14:19:13 +02:00
Chi Vinh Le 16bf887161 Add ie to ci testing 2017-10-25 13:06:00 +02:00
Chi Vinh Le 27eb159a75 Add special popup handling for ie 11 2017-10-25 13:04:41 +02:00
Wyatt Johnson 04540c658e Merge branch 'master' into community-pagination- 2017-10-24 11:30:07 -06:00
Kim Gardner 327c87cda6 Merge pull request #1126 from coralproject/mailer-fix
Mail Service Fix
2017-10-24 18:17:15 +01:00
Kim Gardner b43b84acff Merge branch 'master' into community-pagination- 2017-10-24 18:05:53 +01:00
Wyatt Johnson 1dec169520 added port parsing for smtp 2017-10-24 11:03:15 -06:00
Kim Gardner edce550587 Merge pull request #1099 from coralproject/email-verification
Email Verification Resend
2017-10-24 17:53:19 +01:00
Chi Vinh Le 934b630ce2 Simplified Spinner for IE and Edge for Spinner (using css hacks) 2017-10-24 18:47:55 +02:00
Belen Curcio 812483931d ref 2017-10-24 13:13:44 -03:00
Wyatt Johnson 01c5bc4e26 Merge branch 'master' into email-verification 2017-10-24 10:09:52 -06:00
Wyatt Johnson dd7ca9fd0c added docs 2017-10-24 10:08:03 -06:00
Belen Curcio 7ef9e2783b Initial e2e 2017-10-24 12:58:27 -03:00
Belen Curcio be994d033b Adding classes 2017-10-24 12:58:15 -03:00
Belen Curcio cd0ce14254 Merge branch 'community-pagination-' of github.com:coralproject/talk into community-pagination- 2017-10-24 12:32:12 -03:00
Belen Curcio a0929fd773 Updated tests 2017-10-24 12:30:07 -03:00
Belén Curcio adc06911f3 Merge branch 'master' into community-pagination- 2017-10-24 12:25:12 -03:00
Chi Vinh Le ca1ce9ba76 Dont cache auth 2017-10-24 17:23:10 +02:00
Belen Curcio f3bf9d28a7 Search Value 2017-10-24 11:47:18 -03:00
Belen Curcio 61108337cc Even tinier 2017-10-24 11:42:21 -03:00
Belen Curcio 2aed5d1224 Merge branch 'community-pagination-' of github.com:coralproject/talk into community-pagination- 2017-10-24 11:36:11 -03:00
Belen Curcio 3777b4b1ce Filter Streams fully working 2017-10-24 11:35:27 -03:00
Belen Curcio 55b2208a49 Pagination and refactor for Stories 2017-10-24 11:29:17 -03:00
Kim Gardner 5037af9100 Merge pull request #1125 from coralproject/userDetailBugs
Fix UserDetail bugs
2017-10-24 14:49:27 +01:00
Belen Curcio fed6654f52 Support pagination for search 2017-10-24 10:45:25 -03:00
Kim Gardner 7ba42f059c Merge branch 'master' into userDetailBugs 2017-10-24 14:30:09 +01:00
Kim Gardner cf2746fc28 Merge pull request #1124 from coralproject/fix-doc-formatting
Fix formatting typo in docs
2017-10-24 14:23:08 +01:00
Chi Vinh Le b7b9da9509 Change fetchPolicy 2017-10-24 15:16:45 +02:00
Kim Gardner 24ec898a15 Fix formatting 2017-10-24 14:14:26 +01:00
Chi Vinh Le 46359b4a1b Show errors 2017-10-24 14:49:32 +02:00
Chi Vinh Le b189c9d2b0 Add cursor pointer and increase clickable area 2017-10-24 12:08:46 +02:00
Kiwi 85890b4e6e Merge branch 'master' into email-verification 2017-10-24 12:01:59 +02:00
Belén Curcio 6d3cdb176e Merge branch 'master' into community-pagination- 2017-10-24 00:23:53 -03:00
Belen Curcio 38abf63cc9 removing unused files 2017-10-24 00:21:26 -03:00
Belen Curcio 34334b8152 Pagination only shows when there are results to show 2017-10-24 00:18:03 -03:00
Belen Curcio 0b973f24ff Replacing paginate from Stories 2017-10-24 00:14:47 -03:00
Belen Curcio abff1c763a More styling 2017-10-24 00:12:18 -03:00
Belen Curcio 9f4a913655 Passing props 2017-10-24 00:03:35 -03:00
Belen Curcio d363c977dc Refactor 2017-10-23 23:47:43 -03:00
Belen Curcio f004573ed2 Replacing Pagination Component 2017-10-23 23:47:05 -03:00
Kim Gardner fb9419f2ad Merge pull request #1098 from coralproject/talk-product-guide-features
Talk Product Guide - features and configuration
2017-10-23 19:41:58 +01:00
Kim Gardner 9fc0fc37db Fix merge conflicts 2017-10-23 19:30:36 +01:00
Kim Gardner c442b8bb70 Merge branch 'master' into talk-product-guide-features 2017-10-23 19:27:05 +01:00
Kim Gardner e1f897ec17 Merge pull request #1104 from facuesr/bulk-approve-reject-actions
Bulk approve/reject actions for Moderators
2017-10-23 19:26:00 +01:00
Kiwi 1803c740fc Merge branch 'master' into bulk-approve-reject-actions 2017-10-23 19:29:24 +02:00
Chi Vinh Le d75ae3aca8 Revive resend verification feature 2017-10-23 18:46:41 +02:00
Kiwi a3216dd33e Merge branch 'master' into email-verification 2017-10-23 18:45:11 +02:00
Kim Gardner 6b7ceb99c9 Merge branch 'master' into talk-product-guide-features 2017-10-23 17:00:32 +01:00
Kim Gardner 4ae9928224 Merge pull request #1121 from coralproject/config-fix
Config Fix
2017-10-23 16:58:36 +01:00
Wyatt Johnson dae8dc0509 patched config bug 2017-10-23 09:51:34 -06:00
Kim Gardner 017d560421 Merge branch 'master' into bulk-approve-reject-actions 2017-10-23 15:52:20 +01:00
Kiwi 3f59ed1e46 Merge branch 'master' into email-verification 2017-10-23 11:56:40 +02:00
Facu 9c38bab83b notify error messages 2017-10-20 17:01:52 -03:00
Wyatt Johnson a9cb206415 formatting 2017-10-20 13:14:00 -06:00
Wyatt Johnson c1b954965f Fixed incorrect plugin naming 2017-10-20 11:40:55 -06:00
Kim Gardner e0713a5ec4 Update auth section 2017-10-20 17:56:24 +01:00
Kim Gardner 0ee56fe8d3 Merge branch 'master' into talk-product-guide-features 2017-10-20 17:53:31 +01:00
Kim Gardner 88390f13c7 Merge pull request #1119 from coralproject/turn-off-flagged-edited-notification
Turn off notifications for comments flagged and edited
2017-10-20 17:02:04 +01:00
Chi Vinh Le 7e709ec41d Merge branch 'turn-off-flagged-edited-notification' of ssh://github.com/coralproject/talk into turn-off-flagged-edited-notification 2017-10-20 17:56:07 +02:00
Chi Vinh Le 1bfecdd77c Don't show notification when featuring comment 2017-10-20 17:55:37 +02:00
Kim Gardner 487e1e34db Merge branch 'master' into talk-product-guide-features 2017-10-20 16:48:49 +01:00
Kiwi c054992741 Merge branch 'master' into turn-off-flagged-edited-notification 2017-10-20 17:33:09 +02:00
Kim Gardner 12b83d3904 Merge pull request #1120 from coralproject/disable-ie-e2e
Temporarily disable IE in browserstack ci
2017-10-20 16:30:27 +01:00
Kim Gardner 7ebba3018f Merge branch 'talk-product-guide-features' of git+ssh://github.com/coralproject/talk into talk-product-guide-features 2017-10-20 16:26:23 +01:00
Kim Gardner 0e089b8ff8 Merge branch 'master' into talk-product-guide-features 2017-10-20 16:25:08 +01:00
Chi Vinh Le 5695599f74 Temporarily disable IE in browserstack ci 2017-10-20 17:23:31 +02:00
Chi Vinh Le bef3e3e33c Turn off notifications for flagged and edited 2017-10-20 17:19:44 +02:00
Kiwi 8dbd1789e0 Merge pull request #1118 from coralproject/improve-e2e
Disable network logging
2017-10-20 15:01:03 +02:00
Chi Vinh Le ee548d7180 Disable network logging 2017-10-20 14:45:12 +02:00
Kim Gardner 8ce9f2d4bb Clean up docs, fix links, remove Tutorials section for now 2017-10-20 11:28:03 +01:00
Kim Gardner 76f9e1487c Merge branch 'master' into email-verification 2017-10-19 21:55:14 +01:00
Kim Gardner e729da8e01 Merge branch 'master' into talk-product-guide-features 2017-10-19 21:54:50 +01:00
Facu 011d8830fb Merge branch 'master' into bulk-approve-reject-actions 2017-10-19 14:12:08 -03:00
Kim Gardner 5713e2e2f6 Merge pull request #1116 from coralproject/no-comments
No Comments Text
2017-10-19 16:16:21 +01:00
Belen Curcio f23a5132d6 Missing proptypes 2017-10-19 11:35:40 -03:00
Belen Curcio 101b6cbe59 Missing proptypes 2017-10-19 11:26:22 -03:00
Belen Curcio 7494752019 Translations, Proptypes, NoComments Component 2017-10-19 11:20:09 -03:00
Belen Curcio 11999d751a No inline styling 2017-10-19 11:01:27 -03:00
Belen Curcio 2a85b9fdd2 Adding missing proptypes 2017-10-19 10:58:24 -03:00
Belen Curcio fdddd5f8af Adding missing proptypes 2017-10-19 10:44:17 -03:00
Kim Gardner 6086bfd3cf Merge branch 'master' into talk-product-guide-features 2017-10-19 12:00:03 +01:00
Kim Gardner 2a8dc3b506 Merge pull request #1090 from coralproject/e2e-browserstack
E2e browserstack
2017-10-19 11:58:53 +01:00
Kim Gardner 1a31d9eb97 Merge branch 'master' into email-verification 2017-10-19 11:49:10 +01:00
Kim Gardner bceebca39f Merge branch 'master' into bulk-approve-reject-actions 2017-10-19 11:48:58 +01:00
Kim Gardner 1df48e27f1 Fix merge conflicts 2017-10-19 11:45:59 +01:00
Kim Gardner 5da8475806 Merge pull request #1115 from coralproject/settings-fix
Setup fixes
2017-10-18 23:21:57 +01:00
Wyatt Johnson 1dea6267d7 fixes to the toObject, added test 2017-10-18 16:07:20 -06:00
Kim Gardner 8d5d73312d Merge branch 'master' into talk-product-guide-features 2017-10-18 22:42:36 +01:00
Kim Gardner 3a18cd88ad Merge branch 'master' into bulk-approve-reject-actions 2017-10-18 22:42:31 +01:00
Kim Gardner a1ee09ad9b Merge pull request #1113 from coralproject/snyk
Replacing Snyk with NSP
2017-10-18 22:22:18 +01:00
Wyatt Johnson ae09d5c72e replaced snyk with nsp 2017-10-18 15:09:19 -06:00
Wyatt Johnson 2965877346 fix issues detected by snyk 2017-10-18 14:57:54 -06:00
Wyatt Johnson 0b9c058ad8 fixed package.json/yarn.lock 2017-10-18 14:53:51 -06:00
Wyatt Johnson 5657fde7dc Merge branch 'master' into e2e-browserstack 2017-10-18 13:25:59 -06:00
Wyatt Johnson a69dd02e52 adjusted the circle.yml 2017-10-18 13:16:21 -06:00
Kim Gardner 71cf565018 Merge branch 'master' into bulk-approve-reject-actions 2017-10-18 19:57:28 +01:00
Kim Gardner b4865546d4 Merge pull request #1112 from coralproject/my-profile-tab-fix
Load username from graph and not auth
2017-10-18 19:31:07 +01:00
Wyatt Johnson b97b5e97f2 load username from graph and not auth 2017-10-18 12:23:16 -06:00
Belén Curcio 0265b9bc56 Merge branch 'master' into bulk-approve-reject-actions 2017-10-18 14:05:19 -03:00
Kiwi f06e171def Merge branch 'master' into e2e-browserstack 2017-10-18 18:45:22 +02:00
Kiwi 9930bf5e7a Merge pull request #1111 from coralproject/snyk-fix-3586ed18
[Snyk] Fix for 1 vulnerable dependency path
2017-10-18 18:45:03 +02:00
snyk-bot 2227ec423f fix: package.json & .snyk to reduce vulnerabilities
The following vulnerabilities are ignored:
- https://snyk.io/vuln/npm:tunnel-agent:20170305

Latest report for coralproject/talk:
https://snyk.io/test/github/coralproject/talk
2017-10-18 16:36:12 +00:00
Chi Vinh Le 8fafa93cf5 Fix package.json 2017-10-18 23:35:54 +07:00
Chi Vinh Le 2991fe4ca5 Pingelig 2017-10-18 23:27:46 +07:00
Chi Vinh Le 1126ab48ad Add edge version to comment 2017-10-18 23:26:16 +07:00
Chi Vinh Le 91f6c5a088 Remove edge from ci testing 2017-10-18 23:24:46 +07:00
Chi Vinh Le c8325c91a4 Merge branch 'master' into e2e-browserstack
Conflicts:
	package.json
2017-10-18 23:23:47 +07:00
Chi Vinh Le 039c1b82d1 Merge branch 'e2e-browserstack' of ssh://github.com/coralproject/talk into e2e-browserstack 2017-10-18 23:18:09 +07:00
Chi Vinh Le 4fbb0678e0 Stabilize browserstack testing 2017-10-18 23:17:14 +07:00
Kiwi fb82ef7faf Merge pull request #1110 from coralproject/snyk-fix-d774546f
[Snyk] Fix for 4 vulnerable dependency paths
2017-10-18 17:58:20 +02:00
snyk-bot b362da56ab fix: package.json & .snyk to reduce vulnerabilities
The following vulnerabilities are ignored:
- https://snyk.io/vuln/npm:marked:20170907
- https://snyk.io/vuln/npm:shelljs:20140723

Latest report for coralproject/talk:
https://snyk.io/test/github/coralproject/talk
2017-10-18 15:49:54 +00:00
Wyatt Johnson 5f9f712a9b Merge branch 'master' into email-verification 2017-10-18 09:34:32 -06:00
Kim Gardner 94d253fdbc Merge branch 'master' into bulk-approve-reject-actions 2017-10-18 14:18:41 +01:00
Belen Curcio 86e5e5e955 Adding wait for a button selector 2017-10-18 09:19:32 -03:00
Belen Curcio c3b2eb5a98 Using respect instead of like reaction 2017-10-18 09:17:05 -03:00
Belén Curcio 627ae50fda Merge branch 'master' into e2e-browserstack 2017-10-18 09:02:00 -03:00
Belen Curcio 367c2df3da Modifying test conf 2017-10-18 08:53:25 -03:00
Belen Curcio 14a8fcd475 Removing test output 2017-10-18 08:51:38 -03:00
Kim Gardner 82d0d427ec Merge pull request #1101 from coralproject/bump-version-3-7-0
Update version 3.7.0
2017-10-18 11:12:47 +01:00
Facu 4b068b22b7 Merge branch 'master' into bulk-approve-reject-actions 2017-10-17 17:10:22 -03:00
Belen Curcio 2c757e9d57 Missing classes 2017-10-17 15:18:53 -03:00
Belen Curcio 8633a0f457 Missing classes 2017-10-17 14:54:06 -03:00
Chi Vinh Le a7b33fdc3e Typos 2017-10-17 22:49:03 +07:00
Chi Vinh Le ce131dd067 Run all browsers before failing 2017-10-17 22:48:00 +07:00
Chi Vinh Le afb591d990 Quote path 2017-10-17 22:29:31 +07:00
Chi Vinh Le fac0f53ea8 Sort reports by browser 2017-10-17 22:24:45 +07:00
Chi Vinh Le 89feea70fd Only run browserstack on master 2017-10-17 22:22:54 +07:00
Chi Vinh Le 77dae9922c Integrate reports with circle ci 2017-10-17 21:59:50 +07:00
Chi Vinh Le 427c6e10a4 Integrate browserstack into ci 2017-10-17 21:38:50 +07:00
Chi Vinh Le 30fe43624f Use better env names 2017-10-17 20:53:50 +07:00
Chi Vinh Le 2723be2eb9 Integrate local e2e in CI 2017-10-17 20:10:38 +07:00
Chi Vinh Le 1542888080 yarn e2e-local is now e2e, add new yarn e2e-browserstack 2017-10-17 19:34:55 +07:00
Chi Vinh Le 3a58088420 Fix paths, add headless env 2017-10-17 19:29:46 +07:00
Chi Vinh Le db91e2a27a Env test for e2e-local 2017-10-17 18:54:53 +07:00
Kim Gardner 39a2092310 Add faq 2017-10-17 12:32:56 +01:00
Kim Gardner a586756ac9 Add FAQ and Tutorial sections 2017-10-17 12:27:33 +01:00
Chi Vinh Le 5197cab2b4 Add tags 2017-10-17 18:26:43 +07:00
Chi Vinh Le 8cf04c5c66 Use sections for install e2e 2017-10-17 16:58:50 +07:00
Kim Gardner 3a8ed3033a Fix styling 2017-10-17 10:28:56 +01:00
Chi Vinh Le 7ffc7a76f5 Unify names 2017-10-17 16:15:53 +07:00
Kim Gardner 988cb870bb Global Configuration docs 2017-10-17 10:13:40 +01:00
Chi Vinh Le 343f009150 Refactor serve 2017-10-17 15:57:34 +07:00
Kim Gardner a167b6ce2c Add Stream Configuration docs 2017-10-16 18:20:25 +01:00
Chi Vinh Le 94f0205d9c Unused config 2017-10-16 22:31:40 +07:00
Chi Vinh Le f38e718373 First isolated e2e 2017-10-16 22:27:49 +07:00
Kim Gardner c8f432268b Add Nav for Configuring Talk section 2017-10-14 18:41:50 +01:00
Kim Gardner 759338dc02 Added more Moderator Features 2017-10-14 18:36:17 +01:00
Kim Gardner aa0c41c342 Add section Moderator Features 2017-10-14 18:25:41 +01:00
Kim Gardner 840f3f7145 Merge branch 'master' into bump-version-3-7-0 2017-10-14 17:46:21 +01:00
Kim Gardner ca2c2469bf Merge branch 'master' into talk-product-guide-features 2017-10-14 17:46:10 +01:00
Kim Gardner 606871e4b7 Merge branch 'master' into e2e-browserstack 2017-10-14 17:46:00 +01:00
Kim Gardner 1a8f954707 Merge pull request #1106 from coralproject/reject-rate-fix
Reject Rate Fixes
2017-10-14 17:09:05 +01:00
Kim Gardner 20cd38e47b Merge branch 'master' into reject-rate-fix 2017-10-14 16:58:47 +01:00
Belen Curcio 70d92978c0 Adding admin tests 2017-10-13 21:14:27 -03:00
Belen Curcio b750d9e9a9 Output path 2017-10-13 21:14:10 -03:00
Belen Curcio 887dd3825c Missing propTypes and classes 2017-10-13 21:13:59 -03:00
Belen Curcio adae679bc7 Merge branch 'e2e-browserstack' of github.com:coralproject/talk into e2e-browserstack 2017-10-13 21:12:26 -03:00
Belen Curcio da8dee175d Adding admin tests 2017-10-13 21:07:58 -03:00
Belen Curcio 316971302b Using testData from Install 2017-10-13 21:07:39 -03:00
Belen Curcio bdbffba902 Missing propTypes and classes 2017-10-13 21:07:09 -03:00
Belen Curcio 703fabf586 Adding globals 2017-10-13 21:06:56 -03:00
Wyatt Johnson 2ec1d3fa51 Reject Rate Fixes
- Corrected query to select all statuses (default was accepted/none)
- Fixed up some missing prop-types
- Improved count code
2017-10-13 11:26:02 -06:00
Kiwi 93f2c95700 Merge pull request #1082 from coralproject/dropdown
Dropdown and Option Component
2017-10-13 19:11:48 +02:00
Chi Vinh Le fce1d60d09 Increase contrast in viewing options 2017-10-14 00:06:18 +07:00
Chi Vinh Le f9967dbc48 Increase focus contrast 2017-10-13 23:47:53 +07:00
Chi Vinh Le 4fdb2d5af6 Merge branch 'dropdown' of ssh://github.com/coralproject/talk into dropdown 2017-10-13 23:22:59 +07:00
Chi Vinh Le 00512bfaf0 Support arrow keys 2017-10-13 23:22:07 +07:00
Belén Curcio 37148f69d5 Merge branch 'master' into dropdown 2017-10-13 13:02:56 -03:00
Chi Vinh Le 08d6eadbb7 Fix Stories Dropdown handlers 2017-10-13 22:53:53 +07:00
Kim Gardner 5dd08d84e5 Added Commenter Features section 2017-10-13 16:48:21 +01:00
Chi Vinh Le 10cba651e6 Better accessbility 2017-10-13 22:39:53 +07:00
Kim Gardner 06d0da9286 Reorganize file order and reinstate h2s 2017-10-13 15:50:13 +01:00
Facu 1660d6c1d1 Merge remote-tracking branch 'origin/master' into bulk-approve-reject-actions 2017-10-13 11:46:26 -03:00
Facu 9d36426a1b format UserDetail css 2017-10-13 11:41:47 -03:00
Kim Gardner b721b4e10a Merge branch 'master' into talk-product-guide-features 2017-10-13 15:18:08 +01:00
Belén Curcio 8e72381081 Merge branch 'master' into e2e-browserstack 2017-10-13 10:56:37 -03:00
Belen Curcio 0dfff2ce53 Nightwatch Config global timeout 2017-10-13 10:55:02 -03:00
Belen Curcio 54971f37ad Adding Install tests 2017-10-13 10:54:26 -03:00
Belen Curcio cac6eecde2 Missing propTypes and classes 2017-10-13 10:53:44 -03:00
Kim Gardner 3efd86a4cb Update version 3.7.0 2017-10-13 14:38:34 +01:00
Kiwi 299b083816 Merge pull request #1091 from Goyapa/dismiss-shortcuts-help-menu
Fix Shortcuts help menu doesn't dismiss forever.
2017-10-13 15:21:58 +02:00
Kiwi 7d2a0cf7cc Merge branch 'master' into dismiss-shortcuts-help-menu 2017-10-13 15:16:48 +02:00
Belen Curcio 7c02f21210 Removed yarn error 2017-10-13 10:01:42 -03:00
Belen Curcio a7ad7a2267 Updated drivers 2017-10-13 10:01:27 -03:00
Belen Curcio f0ac56221c Updated yarn 2017-10-13 09:59:27 -03:00
Belen Curcio cd45bf6042 Adding standalone selenium in case someone wants to run then locally 2017-10-13 09:58:48 -03:00
Belen Curcio 895eb5a69a Adding local nightwatch config 2017-10-13 09:58:19 -03:00
Michael Macherey f6be48a4a8 Merge remote-tracking branch 'origin/master' into dismiss-shortcuts-help-menu 2017-10-13 14:05:04 +02:00
Michael Macherey 2dcab1fb12 add noop function, handle undefined 2017-10-13 14:00:28 +02:00
Belén Curcio d8bce3f4ce Merge branch 'master' into e2e-browserstack 2017-10-13 08:07:21 -03:00
Belen Curcio 8f3aa789f5 Merge branch 'dropdown' of github.com:coralproject/talk into dropdown 2017-10-13 08:04:05 -03:00
Belen Curcio be6b1466c6 render label 2017-10-13 08:03:47 -03:00
Belen Curcio 233bc68128 Merge branch 'master' of github.com:coralproject/talk into e2e-browserstack 2017-10-13 08:02:58 -03:00
Belén Curcio 7fd09c3534 Merge branch 'master' into dropdown 2017-10-13 07:59:17 -03:00
Kiwi 8102ef7157 Merge pull request #1078 from dagjaneiro/cannot-ignore-staff
Cannot ignore staff members
2017-10-13 12:57:02 +02:00
Kiwi 1edf320779 Merge branch 'master' into cannot-ignore-staff 2017-10-13 12:47:55 +02:00
Kiwi d8a443e790 Merge pull request #1100 from coralproject/fix-withMutation-hoc
Prevent calling updators when there is an error
2017-10-13 12:44:40 +02:00
Chi Vinh Le 2fd7829b88 Prevent calling updators when there is an error 2017-10-13 17:33:59 +07:00
Daniel Janeiro 27c6d830d9 Remove error handling code
Remove error handling code since the withMutation HoC already handles
errors for us.
2017-10-13 01:13:53 +01:00
Wyatt Johnson 910acdd52b added cli tools for verifying email address 2017-10-12 15:49:21 -06:00
Wyatt Johnson 675e8fa604 Merge branch 'master' into talk-product-guide-features 2017-10-12 15:38:44 -06:00
Wyatt Johnson 5e74a044f3 Merge branch 'master' into cannot-ignore-staff 2017-10-12 15:38:18 -06:00
Wyatt Johnson 9d5739b396 better support for email verification 2017-10-12 15:27:57 -06:00
Facu e0e481373b bulk approve/reject actions for moderators 2017-10-12 17:59:04 -03:00
Michael Macherey 8e466befb4 Fix Shortcuts help menu doesn't dismiss forever. 2017-10-12 20:30:23 +02:00
Belen Curcio c98cb02a4a Adding dropdown to ViewOptions 2017-10-12 13:52:17 -03:00
Belen Curcio 351ebc9105 Find label based on value 2017-10-12 13:40:43 -03:00
Belen Curcio 27ef2ad0d4 Find label based on value 2017-10-12 13:33:18 -03:00
Belen Curcio 798acaf320 Support for Keyboard and Accesibility 2017-10-12 13:18:07 -03:00
Belen Curcio 21122016da Adding tabIndex to clickable buttons 2017-10-12 13:07:14 -03:00
Belen Curcio c9ae622ec3 merge conflicts 2017-10-12 13:00:16 -03:00
Kim Gardner b5a0483603 Update nav 2017-10-12 16:58:12 +01:00
Kim Gardner 987acb64f5 Merge pull request #1097 from coralproject/configure-styling-fix
Fix configure styling issues
2017-10-12 16:51:43 +01:00
Kim Gardner 43d92e5b76 Merge branch 'master' into configure-styling-fix 2017-10-12 16:27:06 +01:00
Kim Gardner 618b8b5135 Merge pull request #1096 from coralproject/long-usernames
Handle really long usernames in Community > People page
2017-10-12 16:06:26 +01:00
Chi Vinh Le 24d73b2770 Use page objects + one more test 2017-10-12 21:56:56 +07:00
Belen Curcio 36be112744 Keyboard accesible 2017-10-12 11:04:17 -03:00
Kiwi caac76bb3f Merge branch 'master' into configure-styling-fix 2017-10-12 16:04:07 +02:00
Chi Vinh Le 3035ba0bcf Fix configure styling issues 2017-10-12 20:57:34 +07:00
Belén Curcio 562586c130 Merge branch 'master' into long-usernames 2017-10-12 10:32:02 -03:00
Belen Curcio a7064bbfdb Adding missing proptypes and ellipsis 2017-10-12 10:29:23 -03:00
Kim Gardner 1b30327fe0 Merge pull request #1094 from coralproject/change-flagged-usernames-copy
Flagged Usernames --> Reported Usernames
2017-10-12 14:24:49 +01:00
Kim Gardner e1f7d1da99 Merge branch 'master' into change-flagged-usernames-copy 2017-10-12 14:17:35 +01:00
Kim Gardner bbfb4c8ae0 Merge pull request #1095 from coralproject/fix-typo
Fix some typos, copy, styling in Docs
2017-10-12 14:17:25 +01:00
Belén Curcio dbcd0aacb1 Merge branch 'master' into change-flagged-usernames-copy 2017-10-12 10:13:23 -03:00
Belén Curcio b0f6ab2b48 Merge branch 'master' into fix-typo 2017-10-12 10:12:40 -03:00
Belen Curcio 612adb2990 Merge branch 'dropdown' of github.com:coralproject/talk into dropdown 2017-10-12 10:08:43 -03:00
Belen Curcio c4e3904a95 Update 2017-10-12 10:08:21 -03:00
Belén Curcio 0d9d2d4871 Merge branch 'master' into dropdown 2017-10-12 10:07:39 -03:00
Kim Gardner 69acb6d5a0 Fix typos and clean up styling 2017-10-12 14:06:09 +01:00
Kim Gardner 58aff2487a Merge pull request #1093 from coralproject/user-search
User Search Improvements
2017-10-12 13:39:50 +01:00
Kim Gardner 4f72f5d4ae Merge branch 'master' into user-search 2017-10-12 13:25:23 +01:00
Kim Gardner 27c44e942e Merge pull request #1086 from coralproject/count-whitespace-to-char-max
Count leading and trailing whitespace towards char count
2017-10-12 13:22:49 +01:00
Kim Gardner 22bbe5c614 Merge branch 'master' into user-search 2017-10-12 13:15:21 +01:00
Kim Gardner bccce1d9bd Merge branch 'master' into count-whitespace-to-char-max 2017-10-12 13:11:28 +01:00
Kim Gardner a914cf1591 Merge branch 'master' into dropdown 2017-10-12 13:10:25 +01:00
Kim Gardner ba7ee5d327 Merge pull request #1092 from coralproject/snyk-patch
SNYK Patch of yarn.lock
2017-10-12 13:09:51 +01:00
Kim Gardner f035a9d1e9 Flagged Usernames --> Reported Usernames 2017-10-12 13:05:13 +01:00
Kim Gardner 1c6f3b80c4 Merge branch 'master' into snyk-patch 2017-10-12 11:27:58 +01:00
Kim Gardner 1b00cdbea3 Merge pull request #1063 from coralproject/talk-product-guide
Talk Product Guide - part 1
2017-10-12 11:27:02 +01:00
Kiwi 1e41ae9402 Merge branch 'master' into count-whitespace-to-char-max 2017-10-12 10:26:23 +02:00
Wyatt Johnson 86f48cea96 Modified user search to include whole word search 2017-10-11 16:41:09 -06:00
Wyatt Johnson 94f4c57038 patched 2017-10-11 15:38:08 -06:00
Wyatt Johnson 97eee92499 updated docs 2017-10-11 15:32:25 -06:00
Kim Gardner 5dfc5d87ad Merge branch 'master' into dropdown 2017-10-11 17:04:04 +01:00
Chi Vinh Le e4399b734e Use TALK_ROOT_URL, global timeout, other improvements 2017-10-11 21:02:46 +07:00
Kim Gardner 09ecd2a055 Merge branch 'master' into talk-product-guide 2017-10-11 14:20:18 +01:00
Kiwi 1fffa1427d Merge pull request #1089 from coralproject/add-testing-info-to-readme
Small Readme tweaks
2017-10-11 15:03:39 +02:00
Chi Vinh Le cde3c4e17e Move logs to test/e2e 2017-10-11 20:01:27 +07:00
Kim Gardner ac28106251 Add docs on Toxic Comments 2017-10-11 13:56:35 +01:00
Chi Vinh Le 3abbe3119d E2e with nightwatch and browserstack 2017-10-11 19:50:13 +07:00
Kim Gardner 1dd1a0d986 Update Trust details and update nav 2017-10-11 13:43:48 +01:00
Kim Gardner a7d87f4ee1 Add Trust Product Docs 2017-10-11 13:34:15 +01:00
Kim Gardner 025d0cf812 Merge branch 'master' into talk-product-guide 2017-10-11 12:41:24 +01:00
Kim Gardner 8ac93c9785 Merge branch 'master' into count-whitespace-to-char-max 2017-10-11 11:26:50 +01:00
Kim Gardner 1ec71ebd00 Merge branch 'master' into cannot-ignore-staff 2017-10-11 11:26:45 +01:00
Kim Gardner 48d4eeddf3 Merge branch 'master' into dropdown 2017-10-11 11:26:35 +01:00
Kim Gardner 0615be9ab4 Merge branch 'master' into add-testing-info-to-readme 2017-10-11 11:26:07 +01:00
Kim Gardner e0dc41b721 Merge pull request #1088 from coralproject/add-testing-info-to-readme
Add Testing section to Readme with Browserstack logo
2017-10-11 11:22:09 +01:00
Kim Gardner b46ad5448c Update readme 2017-10-11 11:08:19 +01:00
Kiwi 8e9e61a610 Update README.md 2017-10-11 12:05:25 +02:00
Kim Gardner 341e8d9af6 Cleanup license text 2017-10-11 10:40:28 +01:00
Kim Gardner 674d7837f6 Change logo size 2017-10-11 10:38:23 +01:00
Kim Gardner b827abffbb Update Readme 2017-10-11 10:32:35 +01:00
Kim Gardner a48bfbaa69 Merge branch 'master' into dropdown 2017-10-11 09:49:19 +01:00
Kim Gardner dcfdec4df1 Merge branch 'master' into cannot-ignore-staff 2017-10-11 09:49:06 +01:00
Kim Gardner 0fde69608a Merge branch 'master' into count-whitespace-to-char-max 2017-10-11 09:29:19 +01:00
Kim Gardner 0225d38560 Merge pull request #1083 from coralproject/refactor-configure
Refactor Configure, Add Slots
2017-10-11 09:26:37 +01:00
Chi Vinh Le 34178919dc Count leading and trailing whitespace towards char count 2017-10-11 15:16:21 +07:00
Chi Vinh Le 7b76450eb5 Merge branch 'master' into refactor-configure
Conflicts:
	client/coral-admin/src/routes/Configure/components/Configure.css
	client/coral-admin/src/routes/Moderation/components/Moderation.js
2017-10-11 14:17:36 +07:00
Kiwi 3adc3e87cd Merge pull request #1084 from coralproject/danish-lang-config
Update i18n config to support new Danish translation
2017-10-11 09:03:50 +02:00
Kiwi b25fa9c7f3 Merge branch 'master' into danish-lang-config 2017-10-11 08:51:07 +02:00
Kiwi f712e426e2 Merge pull request #1081 from PepeFranco/ReadersNotifications
Added notifications when flagging failed
2017-10-11 08:50:52 +02:00
Kiwi a9882c8904 Merge branch 'master' into danish-lang-config 2017-10-11 08:45:16 +02:00
Kiwi a0f9242f02 Merge branch 'master' into ReadersNotifications 2017-10-11 08:44:36 +02:00
Wyatt Johnson fa6c0afe93 Merge pull request #1085 from coralproject/snyk-fix-cdba6ef9
[Snyk Update] New fixes for 4 vulnerable dependency paths
2017-10-11 00:36:52 -06:00
Chi Vinh Le 1d2f7b5298 Use correct import path 2017-10-11 13:34:27 +07:00
snyk-bot 5f9d47a199 fix: package.json & .snyk to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/npm:mime:20170907


The following vulnerabilities are fixed with a Snyk patch:
- https://snyk.io/vuln/npm:marked:20170112

Latest report for coralproject/talk:
https://snyk.io/test/github/coralproject/talk
2017-10-11 02:07:15 +00:00
Wyatt Johnson 29d7494385 fixed more yaml issues, added lint step 2017-10-10 14:04:37 -06:00
Kim Gardner 6145fd2855 Merge branch 'danish-lang-config' of git+ssh://github.com/coralproject/talk into danish-lang-config 2017-10-10 19:27:24 +01:00
Jose Franco 14d2b63f2e Merge branch 'master' into ReadersNotifications 2017-10-10 12:58:43 -05:00
PepeFranco cf59bb213c Changed FlagButton to use getErrorMessages util for failed flagging instead of custom messages 2017-10-10 12:55:32 -05:00
PepeFranco cecf2f4606 Merge branch 'ReadersNotifications' of https://github.com/PepeFranco/talk into ReadersNotifications 2017-10-10 12:54:51 -05:00
Kim Gardner bd7dfdbe55 Fix yml indentation 2017-10-10 18:52:53 +01:00
Wyatt Johnson 98ee3c7b55 Merge branch 'master' into danish-lang-config 2017-10-10 11:44:05 -06:00
Wyatt Johnson 0fc0e9c467 Merge branch 'master' into cannot-ignore-staff 2017-10-10 11:30:00 -06:00
Kim Gardner 398dedf75b Merge pull request #1080 from facuesr/ie11-issues
Fix issue 1071
2017-10-10 18:19:50 +01:00
Kim Gardner d11ac54e1d Merge branch 'master' into cannot-ignore-staff 2017-10-10 18:19:11 +01:00
Kim Gardner 764d562497 Merge branch 'master' into ReadersNotifications 2017-10-10 18:18:58 +01:00
Kim Gardner 4548134e3f Merge branch 'master' into dropdown 2017-10-10 18:18:34 +01:00
Kim Gardner 4efcd624c3 Merge branch 'master' into talk-product-guide 2017-10-10 18:14:37 +01:00
Kim Gardner 48af316380 Merge branch 'master' into ie11-issues 2017-10-10 18:13:28 +01:00
Kim Gardner 98f46409ca Merge pull request #1070 from coralproject/viewing-options
Viewing Options, and bug fixing
2017-10-10 18:13:09 +01:00
Kim Gardner dee5651709 Merge branch 'master' into ie11-issues 2017-10-10 18:09:54 +01:00
Belen Curcio c5cee13bd7 Accesibility 2017-10-10 13:24:56 -03:00
Kim Gardner e40a30d200 Fixes and cleanup 2017-10-10 17:17:04 +01:00
Belen Curcio 0d66e42313 Merge branch 'viewing-options' of github.com:coralproject/talk into viewing-options 2017-10-10 13:16:37 -03:00
Belen Curcio 154949ff47 Update 2017-10-10 13:12:55 -03:00
Kim Gardner 33e25403e7 Rename file to da.yml 2017-10-10 17:04:27 +01:00
PepeFranco c8dc1f84e6 Merge branch 'master' of https://github.com/coralproject/talk into ReadersNotifications 2017-10-10 11:03:15 -05:00
Belen Curcio 7fcc7753f8 Update 2017-10-10 12:50:31 -03:00
Kim Gardner 569260a4b9 Fix configuration and alphabetize languages 2017-10-10 16:47:33 +01:00
Belen Curcio 2028e56f48 using props, not state for selected 2017-10-10 12:40:09 -03:00
Belen Curcio 1c535bda89 Lowering down the animation 2017-10-10 12:27:32 -03:00
Belen Curcio 1f9ff3f36d Merge branch 'dropdown' of github.com:coralproject/talk into dropdown 2017-10-10 12:27:18 -03:00
Belen Curcio 18b18a7aef Removing global listeners 2017-10-10 12:26:41 -03:00
Belen Curcio f2ea269f7a Merge branch 'master' of github.com:coralproject/talk into dropdown 2017-10-10 12:26:29 -03:00
Belen Curcio bbad09d271 Missing proptype 2017-10-10 12:26:06 -03:00
Belén Curcio 932cec27de Merge branch 'master' into dropdown 2017-10-10 12:25:18 -03:00
Kim Gardner 2063c4a90e Fixes per code review 2017-10-10 16:24:49 +01:00
Belén Curcio 4d0d0735e8 Merge branch 'master' into viewing-options 2017-10-10 12:20:59 -03:00
Kiwi bd73140f23 Merge branch 'master' into ReadersNotifications 2017-10-10 15:38:54 +02:00
Kim Gardner b77c330823 Update i18n code 2017-10-10 14:02:07 +01:00
Kim Gardner 9f02165aa6 Merge branch 'master' of git+ssh://github.com/coralproject/talk into danish-lang-config 2017-10-10 14:01:12 +01:00
Kim Gardner 522857f0d6 Merge pull request #1079 from Rarer/Danish-Translation
Danish translation
2017-10-10 13:59:58 +01:00
Kim Gardner f1e81575cb Update i18n config to support Danish 2017-10-10 13:56:47 +01:00
Kim Gardner 69ace56172 Merge branch 'master' into Danish-Translation 2017-10-10 13:08:44 +01:00
Kim Gardner 0a991c938a Merge branch 'master' into talk-product-guide 2017-10-10 13:08:23 +01:00
Kim Gardner 6a2b6bb845 Merge branch 'master' into ReadersNotifications 2017-10-10 13:07:37 +01:00
Kim Gardner 78857e8de0 Merge branch 'master' into ie11-issues 2017-10-10 13:07:03 +01:00
Kim Gardner 3c7e0462f5 Merge branch 'master' into cannot-ignore-staff 2017-10-10 13:06:54 +01:00
Kim Gardner c0a54b6538 Merge branch 'master' into viewing-options 2017-10-10 13:06:18 +01:00
Kim Gardner 15f07b1360 Merge pull request #1068 from tylerbrewer2/fix-shortcut-icon
fix hidden shortcut icon
2017-10-10 13:05:20 +01:00
Chi Vinh Le 61604a7d07 Export ConfigureCard in plugin-api 2017-10-10 17:06:45 +07:00
Chi Vinh Le dfcb9e24df Refactor components 2017-10-10 17:00:25 +07:00
Belen Curcio 7b38bac525 Stories Dropdown, Proptypes and tiny refactor 2017-10-10 03:18:28 -03:00
Belen Curcio 16847f9fec Translations and PropTypes 2017-10-10 02:48:12 -03:00
Belen Curcio 71af62585a Adding Dropdown and Option Compoennt 2017-10-10 02:47:51 -03:00
Belén Curcio 29c7c9e810 Merge branch 'master' into viewing-options 2017-10-10 00:18:03 -03:00
PepeFranco c81d9c0bd1 Added notifications when flagging failed 2017-10-09 21:59:47 -05:00
Facu 0519b1d1ff fix 1071 2017-10-09 15:41:06 -03:00
Morten Nissen 046a17801e Fixed some mistakes, and general proof reading 2017-10-09 20:38:29 +02:00
Chi Vinh Le 21342b8b81 Fix title styling 2017-10-09 23:56:16 +07:00
Chi Vinh Le ec436bcb39 Refactor Configure styles 2017-10-09 23:50:43 +07:00
Chi Vinh Le 59eff3e29e Refactor moderationSettings styles 2017-10-09 23:37:37 +07:00
Chi Vinh Le 574cbf8e79 Refactor TechSettings styles 2017-10-09 23:28:32 +07:00
Chi Vinh Le b3fc920919 Refactor EmbedLink styles 2017-10-09 23:26:15 +07:00
Chi Vinh Le 1d089ee151 Refactor Domainlist styles 2017-10-09 23:00:21 +07:00
Chi Vinh Le 0434ecf755 Refactor Wordlist styles 2017-10-09 22:58:58 +07:00
Tyler Brewer 48c291a9c3 Merge branch 'master' into fix-shortcut-icon 2017-10-09 11:01:26 -04:00
Chi Vinh Le c0ff9c1beb Merge branch 'master' into refactor-configure
Conflicts:
	client/coral-admin/src/routes/Moderation/components/Moderation.js
2017-10-09 21:30:03 +07:00
Chi Vinh Le 3d3e0491a4 Remove updateWordlist and add test 2017-10-09 21:13:47 +07:00
Chi Vinh Le c52e42c644 Allow changing wordlist and domains using the updateSettings mutation 2017-10-09 16:51:27 +07:00
Kiwi 77d30bdbc1 Merge pull request #1066 from gerardogalvez/moderate-shortcuts
Add moderator shortcuts to open search and switch between queues.
2017-10-09 08:59:03 +02:00
Daniel Janeiro efdf7a6b25 Handle IgnoreUser mutation errors
We now check if the IgnoreUser mutation returned an error before
updating the apollo store. If the mutation returns an error we keep
the store as it is, otherwise the user is added to the ignore list.
2017-10-07 23:02:33 +01:00
Daniel Janeiro 7eaad1541b Implement cannot ignore staff in users service
`UsersService.ignoreUsers` now checks if any user provided is a staff
member. In case it is it throws a ErrCannotIgnoreStaff error.
2017-10-07 23:02:25 +01:00
Daniel Janeiro 0c7b35ffde Add cannot ignore staff error 2017-10-07 21:51:58 +01:00
Gerardo Galvez e4ff48ea88 Merge branch 'moderate-shortcuts' of https://github.com/gerardogalvez/talk into moderate-shortcuts 2017-10-06 20:20:48 -05:00
Gerardo Galvez cbd7337dbc Add spanish translations and cleaner way to get the activeTabIndex 2017-10-06 20:19:30 -05:00
Morten Nissen c0e9836a57 Added danish translation 2017-10-07 01:50:11 +02:00
Belén Curcio c7bf3c1a3c Merge branch 'master' into moderate-shortcuts 2017-10-06 18:07:30 -03:00
Tyler Brewer bb78ba9b0b Merge branch 'master' into fix-shortcut-icon 2017-10-06 16:09:59 -04:00
Kiwi 62834ae412 Merge pull request #1067 from lancekruegger/Issue-1024-forgot-password-flow
Update forgot password flow to match site styling
2017-10-06 21:43:14 +02:00
David Erwin 0c62ff0f9f Merge branch 'master' into Issue-1024-forgot-password-flow 2017-10-06 15:38:26 -04:00
Kiwi 380f20d525 Merge pull request #1072 from kamos1/fix-1037
fix issue 1037
2017-10-06 21:35:45 +02:00
Lance Ruegger 252ec8f6ac Change full constructor to use class property, fix typo in handleChangeEmail, pass value to TextField to ensure they stay in sync. 2017-10-06 12:26:03 -07:00
kamos1 e95e0381c2 remove removeNewLine and add .trim to length variable 2017-10-06 13:25:32 -06:00
kamos1 8ab31d7009 add trim to prevent empty spaces, tabs and other whitespace characters 2017-10-06 13:19:37 -06:00
kamos1 57f8a64cf4 fix issue 1037 2017-10-06 12:24:58 -06:00
Chi Vinh Le 0a190a9838 Add slots 2017-10-07 01:01:14 +07:00
Chi Vinh Le 6ff2e38003 Little Optimization 2017-10-07 00:54:46 +07:00
Chi Vinh Le 3a28eae384 Move activeSection to redux 2017-10-07 00:47:50 +07:00
Chi Vinh Le 5fbabcaa1b Simplify Configure 2017-10-07 00:31:44 +07:00
Kim Gardner 387316849a Merge branch 'master' into moderate-shortcuts 2017-10-06 17:34:46 +01:00
Kim Gardner 26c1d22ec3 Merge branch 'master' into fix-shortcut-icon 2017-10-06 17:30:28 +01:00
Chi Vinh Le eae5b85d1a Turn ModerationSettings into container 2017-10-06 23:08:56 +07:00
Belen Curcio dbe6e675c9 Modal Keys should show on tablet 2017-10-06 13:02:18 -03:00
Chi Vinh Le 2c8366d6b7 Turn TechSettings to container 2017-10-06 22:32:02 +07:00
Chi Vinh Le ae3d1c1819 Turn StreamSettings to container 2017-10-06 22:17:51 +07:00
Kim Gardner 916596fe53 Merge branch 'master' into Issue-1024-forgot-password-flow 2017-10-06 15:36:38 +01:00
Belen Curcio 0f6bbb21a3 Fix drawer too 2017-10-06 11:05:38 -03:00
Belen Curcio c2cbf91cad Merge branch 'master' of github.com:coralproject/talk into viewing-options 2017-10-06 11:02:46 -03:00
Belen Curcio fe689c5888 Margin Top 2017-10-06 10:52:16 -03:00
Belen Curcio e1f5fe1f77 Responsive Ready 2017-10-06 10:50:48 -03:00
Belen Curcio 848c04539c Select working 2017-10-06 10:35:04 -03:00
Belen Curcio e4b225b4c2 ViewingOptions, Cards, Proptypes and MediaQueries 2017-10-06 10:10:08 -03:00
Kiwi 787f11118c Merge pull request #1059 from Rishabh04-02/master
displaying time in X minutes Y seconds
2017-10-06 14:38:20 +02:00
Kiwi cca0a6df71 Merge branch 'master' into master 2017-10-06 13:43:21 +02:00
Chi Vinh Le 5073ef6c1b Implement save settings 2017-10-06 18:27:10 +07:00
Kim Gardner 596cd57274 Merge pull request #1065 from amorimgustavo/patch-1
Update pt_BR.yml
2017-10-06 12:14:17 +01:00
Kim Gardner b02ccd792c Merge branch 'master' into patch-1 2017-10-06 12:09:41 +01:00
Kiwi ad5a6c539a Merge branch 'master' into master 2017-10-06 12:04:42 +02:00
tylerbrewer2 a4591ecb55 fix hidden shortcut icon 2017-10-05 20:51:54 -04:00
Lance Ruegger 6c95502b4e Change DOM input to coral-ui TextField to inherit styling, add prop-types validation, convert from using ref to using state. 2017-10-05 17:36:38 -07:00
Gerardo Gálvez 931b5ad3ac Merge branch 'master' into moderate-shortcuts 2017-10-05 17:18:18 -05:00
Gerardo Galvez c0bb5e5cb2 Add moderator shortcuts to open search and switch between queues. 2017-10-05 16:57:46 -05:00
Wyatt Johnson 1b33b62af0 Merge pull request #1057 from vickychijwani/slackbot
Slack notifications plugin for new comments
2017-10-05 15:27:04 -06:00
Vicky Chijwani bf0901e77f Wrap Slack call in process.nextTick() to avoid blocking comment creation. 2017-10-06 02:17:45 +05:30
amorimgustavo f164ad8013 Update pt_BR.yml
Hello Folks,

Just edited some (several actually :) messages in your pt_BR.yml for your consideration.

You may consider using:

- "Banido" instead of "proibido"
- "Perfil" or "Usuario" instead of "Bio"
- "Opinião" instead of "Feedback"
- "Denunciar" instead of "Reportar"
- "Usuários(as)" instead of "Comentaristas"
- "Listas" instead of "Hilos" or "Filas"
- "Conversas" instead of "Histórias"

Hope you like those suggestions.

Cheers.
Gustavo
2017-10-05 17:10:42 -03:00
Rishabh04-02 f1bad9e8f2 modifications - displaying time
modifications in displaying like X minutes Y seconds
2017-10-05 23:07:51 +05:30
Kim Gardner ba51645c87 Merge branch 'master' into slackbot 2017-10-05 17:08:17 +01:00
Kim Gardner bc0a188c57 Merge branch 'master' into master 2017-10-05 17:06:41 +01:00
Kim Gardner f497fdb277 Merge pull request #1056 from tylerbrewer2/fix-nav-width
fix admin navigation width
2017-10-05 17:06:17 +01:00
Kim Gardner a677c698bf Merge branch 'master' into master 2017-10-05 16:53:52 +01:00
Kim Gardner 73b4cfd2c4 Merge branch 'master' into slackbot 2017-10-05 16:53:43 +01:00
Kim Gardner 5f758d3437 Merge branch 'master' into fix-nav-width 2017-10-05 16:53:02 +01:00
Kim Gardner e8808f9232 Merge pull request #1061 from coralproject/clean-up-readme
Clean up README
2017-10-05 16:52:30 +01:00
Wyatt Johnson 6713397d02 Merge branch 'master' into clean-up-readme 2017-10-05 08:39:47 -06:00
Chi Vinh Le 9c00050f6a Load settings from graph 2017-10-05 21:05:05 +07:00
Kim Gardner 6259c1869d Merge pull request #1062 from dusty-wil/master
#1043 - Better error message for 1 character comments
2017-10-05 14:43:24 +01:00
Kim Gardner 2e7a59a6e1 Merge branch 'master' into talk-product-guide 2017-10-05 13:53:44 +01:00
dusty-wil 1ad942f06c Merge branch 'master' into master 2017-10-05 08:46:58 -04:00
Kim Gardner 6ffab51bcf Cleanup titles 2017-10-05 13:41:54 +01:00
Kim Gardner 71de5a33a9 Update nav 2017-10-05 13:40:53 +01:00
Kim Gardner a1978571e8 First part of Product Guide 2017-10-05 13:38:08 +01:00
Dusty Williams 1510ade47a revised error message for comments less than two characters in length - dmw 2017-10-05 08:33:29 -04:00
Kim Gardner f330c385e5 Clean up README 2017-10-05 12:29:27 +01:00
Belen Curcio 886df1cdca Now every section is full width :D 2017-10-05 08:21:17 -03:00
Belen Curcio 91a25fc3c1 max-width 2017-10-05 08:00:08 -03:00
Belén Curcio 474a3a12ef Merge branch 'master' into master 2017-10-05 07:34:49 -03:00
Belén Curcio 9b9e9c0292 Merge branch 'master' into fix-nav-width 2017-10-05 07:34:04 -03:00
Kim Gardner 34292f467d Merge pull request #1052 from lancekruegger/max-resize-other-box
Add a max-width to flag-reason text box to prevent cutoff
2017-10-05 11:30:33 +01:00
Belén Curcio c72dfdddf3 Merge branch 'master' into max-resize-other-box 2017-10-05 07:25:09 -03:00
Kim Gardner ec74262089 Merge branch 'master' into fix-nav-width 2017-10-05 10:53:43 +01:00
Rishabh04-02 b3486ce614 displaying time in X minutes Y seconds 2017-10-05 10:48:12 +05:30
tylerbrewer2 85f9000a64 fix admin navigation width 2017-10-04 20:22:39 -04:00
Vicky Chijwani 95580f5ffe Add Slack notifications plugin for new comments. 2017-10-05 05:32:37 +05:30
Kim Gardner 57b7829189 Merge pull request #1054 from PepeFranco/patch-2
Updated running-advanced-configuration.md
2017-10-04 23:40:50 +01:00
Jose Franco 551ac9dd90 Update running-advanced-configuration.md 2017-10-04 17:31:48 -05:00
Wyatt Johnson 2568f65fe5 Merge pull request #1053 from PepeFranco/defaultLanguage
Added env variable TALK_DEFAULT_LAN
2017-10-04 15:27:45 -06:00
PepeFranco 8d6f79ab79 Fixed typo from LAN to LANG 2017-10-04 16:16:07 -05:00
PepeFranco 841ab53ea7 Added env variable TALK_DEFAULT_LAN 2017-10-04 15:42:02 -05:00
Lance Ruegger 5147ca6b86 Add a max-width to the flag-reason text box to prevent cutoff 2017-10-04 11:04:47 -07:00
Kiwi 197d94ffb1 Merge pull request #1004 from coralproject/jest-unit-test
Introduce Jest Unit Testing Framework
2017-10-04 18:22:09 +02:00
Kiwi d23d3be4ef Merge branch 'master' into jest-unit-test 2017-10-04 13:13:09 +02:00
Kiwi ff9ae03522 Merge pull request #1009 from coralproject/revert-1008-revert-1002-es6-modules-tree-shaking
Es6 modules + tree shaking
2017-10-04 13:12:53 +02:00
Wyatt Johnson a50c16c00f Merge pull request #1010 from coralproject/revert-1007-revert-1005-rm-babelrc-subscriber
Revert "Revert "Remove .babelrc from plugin""
2017-10-03 14:56:22 -06:00
Wyatt Johnson d75257a832 Revert "Revert "Remove .babelrc from plugin"" 2017-10-03 14:55:20 -06:00
Wyatt Johnson 074fbca231 Revert "Revert "Es6 modules + tree shaking"" 2017-10-03 14:54:08 -06:00
Wyatt Johnson 8a02618d8a Merge pull request #1008 from coralproject/revert-1002-es6-modules-tree-shaking
Revert "Es6 modules + tree shaking"
2017-10-03 14:43:09 -06:00
Wyatt Johnson b5ab829f9b Revert "Es6 modules + tree shaking" 2017-10-03 14:36:36 -06:00
Wyatt Johnson 4bfc20b782 Merge pull request #1007 from coralproject/revert-1005-rm-babelrc-subscriber
Revert "Remove .babelrc from plugin"
2017-10-03 14:26:46 -06:00
Wyatt Johnson c6526a71ba Revert "Remove .babelrc from plugin" 2017-10-03 14:21:55 -06:00
Wyatt Johnson 3060f5097f Merge pull request #1006 from coralproject/featured-permission-fix
Fixes Featured Tag Permissions
2017-10-03 14:20:30 -06:00
Wyatt Johnson b11783d54f Fixes Featured Tag Permissions
- When a comment is created, there is a possibility of injecting a tag into the payload, this removes that permission error
2017-10-03 14:15:42 -06:00
Kiwi bd01d5f3fe Merge branch 'master' into jest-unit-test 2017-10-03 18:53:42 +02:00
Kim Gardner 53baa02ada Merge pull request #1005 from coralproject/rm-babelrc-subscriber
Remove .babelrc from plugin
2017-10-03 17:35:29 +01:00
Chi Vinh Le d2b6e0b235 Remove .babelrc from plugin 2017-10-03 23:29:46 +07:00
Chi Vinh Le 52595bb3f8 Merge branch 'master' into jest-unit-test 2017-10-03 22:48:14 +07:00
Wyatt Johnson 62f1cd43cf Merge pull request #1002 from coralproject/es6-modules-tree-shaking
Es6 modules + tree shaking
2017-10-03 09:47:31 -06:00
Kiwi 8b39613148 Merge branch 'master' into es6-modules-tree-shaking 2017-10-03 17:39:06 +02:00
Kim Gardner 1d986e7a0b Merge pull request #1003 from coralproject/fix-edited-marker
Fix styling of edited marker
2017-10-03 16:36:32 +01:00
Chi Vinh Le 79d312df50 Fix styling of edited marker 2017-10-03 22:25:37 +07:00
Chi Vinh Le faf75c5c2f Upgrade linters 2017-10-03 22:08:55 +07:00
Chi Vinh Le 33920afc74 Port form chai to jest 2017-10-03 21:54:15 +07:00
Chi Vinh Le bd83e9e118 Add first Snapshot testing 2017-10-03 21:31:10 +07:00
Chi Vinh Le 2be8750d0e Add yarn jest-watch 2017-10-03 21:30:55 +07:00
Chi Vinh Le 14ce9b1e77 relax language 2017-10-03 21:19:19 +07:00
Chi Vinh Le 51e40ce185 Merge branch 'es6-modules-tree-shaking' into jest-unit-test 2017-10-03 21:16:08 +07:00
Chi Vinh Le 511cdd6197 Remove .babelrc from talk-plugin-flag-details 2017-10-03 21:10:33 +07:00
Chi Vinh Le c1f7ef4f32 Introduce Jest Unit Testing framework 2017-10-03 21:08:02 +07:00
Chi Vinh Le 5a4bf7a223 Merge branch 'es6-modules-tree-shaking' of ssh://github.com/coralproject/talk into es6-modules-tree-shaking 2017-10-03 20:57:09 +07:00
Chi Vinh Le 11d2f05f73 Remove babel-plugin-add-module-exports 2017-10-03 20:55:44 +07:00
Kiwi d07c7de292 Merge branch 'master' into es6-modules-tree-shaking 2017-10-03 15:52:10 +02:00
Chi Vinh Le 942b65648b Adapt plugins-loader to es6 2017-10-03 20:43:19 +07:00
Chi Vinh Le b1753ecdce Pass es6 to webpack and profit from tree shaking 2017-10-03 20:43:19 +07:00
Chi Vinh Le 7ea05e699e Remove deprecated commonjs imports and exports 2017-10-03 20:43:18 +07:00
Kim Gardner eb969f8050 Merge pull request #999 from coralproject/subscriber-badge
Subscriber Badge Plugin and User Tags bug
2017-10-03 05:00:00 +01:00
Belen Curcio dde1f7b5be Assigned by removed 2017-10-02 16:26:21 -03:00
Belen Curcio 343d4418b0 eslint updated 2017-10-02 16:23:56 -03:00
Kim Gardner 4c28e43e62 Merge branch 'master' into subscriber-badge 2017-10-02 18:31:15 +01:00
Kim Gardner 1030ca1fa2 Merge pull request #1001 from coralproject/toxicity-detail
Revamp comment details and implement toxicity detail
2017-10-02 18:25:53 +01:00
Chi Vinh Le b1bc97c8d5 Improve styling 2017-10-02 22:34:12 +07:00
Chi Vinh Le 18b802c555 Merge branch 'master' into toxicity-detail 2017-10-02 22:30:49 +07:00
Chi Vinh Le 1c16a75f6b Merge branch 'master' into toxicity-detail
Conflicts:
	plugin-api/beta/client/components/index.js
2017-10-02 22:27:57 +07:00
Chi Vinh Le 8724cfe325 Add talk-plugin-flag-details as default plugins 2017-10-02 22:22:55 +07:00
Chi Vinh Le d3d7f909d8 Translations 2017-10-02 22:22:00 +07:00
Chi Vinh Le c2f22bbf98 Implement user flag details as slot component 2017-10-02 21:37:47 +07:00
Chi Vinh Le 9b39017f25 Export viewUserDetail in plugin-api 2017-10-02 20:54:49 +07:00
Chi Vinh Le 075d62a32a Move CommentDetails to plugin-api 2017-10-02 20:50:43 +07:00
Kim Gardner 2d92284622 Merge branch 'master' into subscriber-badge 2017-10-02 13:00:45 +01:00
Kim Gardner e99b79687f Merge pull request #1000 from coralproject/shorcuts
Admin Shortcuts working
2017-10-02 13:00:29 +01:00
Kim Gardner 9182d5b09c Merge branch 'master' into subscriber-badge 2017-10-02 11:59:21 +01:00
Kim Gardner 89b87b01df Merge branch 'master' into shorcuts 2017-10-02 11:58:07 +01:00
Kim Gardner 257f361998 Merge pull request #997 from vickychijwani/patch-1
Fix double preposition in string
2017-10-02 11:32:13 +01:00
Belen Curcio 02dff0c726 linting 2017-10-02 01:32:36 -03:00
Belen Curcio 17f5800363 Shorcuts working again! 2017-10-02 01:24:59 -03:00
Belen Curcio 7aaad6ccd9 Adds subscriber plugin 2017-10-02 01:06:08 -03:00
Belen Curcio 43cb0efe7e bug: usertags 2017-10-02 01:03:20 -03:00
Vicky Chijwani 06ced883ba Fix double preposition in French and Portuguese translations 2017-10-01 05:16:43 +05:30
Vicky Chijwani f7e6f67f4e Fix double preposition in string
This string is followed by a relative time duration with a preposition included, like "in 1 week".
2017-10-01 05:06:10 +05:30
Wyatt Johnson 307fe58cf3 Merge pull request #989 from coralproject/use-talk-linting-preset
Use eslint-config-talk preset
2017-09-29 11:21:06 -06:00
Wyatt Johnson 48f2cce893 Merge branch 'master' into use-talk-linting-preset 2017-09-29 11:02:18 -06:00
Wyatt Johnson b597f730f6 Merge pull request #996 from coralproject/new-docs
Updated docs
2017-09-29 11:02:06 -06:00
Chi Vinh Le d396f43fe3 Merge branch 'master' into use-talk-linting-preset
Conflicts:
	package.json
2017-09-29 23:55:33 +07:00
Chi Vinh Le 799a21fecd Upgrade eslint-config-talk 2017-09-29 23:52:41 +07:00
Chi Vinh Le 7d41421526 adminCommentMoreFlagDetails slot and more 2017-09-29 23:34:40 +07:00
Chi Vinh Le 9bd55b267e excludeIf now returns a new component 2017-09-29 23:33:37 +07:00
Chi Vinh Le 90470b8331 Make IfSlotIsEmpty and IfSloIsNotEmpty accept an array of slot names 2017-09-29 23:33:12 +07:00
Kim Gardner df737ad201 Merge branch 'master' into new-docs 2017-09-29 16:56:44 +01:00
Kim Gardner 09ee854302 Merge pull request #984 from ryanyun/add-class-names
introduce classes for easier CSS selection for custom styling
2017-09-29 16:56:03 +01:00
Wyatt Johnson f88bd8b485 Merge branch 'master' into new-docs 2017-09-29 08:59:36 -06:00
Ryan Yun 36ba7367d1 add talk-embed-stream- prefix to classes 2017-09-29 10:57:23 -04:00
Chi Vinh Le f9693c7154 Refactor and pluginize comment details 2017-09-29 19:42:44 +07:00
Kim Gardner 445107ef64 Merge branch 'master' into add-class-names 2017-09-29 13:36:12 +01:00
Kim Gardner 1c3be913d3 Merge pull request #981 from coralproject/bump-version-3-6-0
Bump version to 3.6.0
2017-09-29 13:35:31 +01:00
Kim Gardner 09f9782505 Merge branch 'master' into new-docs 2017-09-29 12:21:37 +01:00
Kim Gardner 1d6e9527e5 Merge branch 'master' into bump-version-3-6-0 2017-09-29 12:21:16 +01:00
Kim Gardner d0ce832319 Merge pull request #990 from coralproject/update-translation-pt
Add translation of "new" queue in Portuguese
2017-09-29 12:21:05 +01:00
Wyatt Johnson 2e7ee6bb8b Updated docs 2017-09-28 23:38:01 -06:00
Wyatt Johnson ad3958a2e0 Merge branch 'master' into update-translation-pt 2017-09-28 09:45:12 -06:00
Wyatt Johnson 58acdef043 Merge branch 'master' into bump-version-3-6-0 2017-09-28 09:44:09 -06:00
Ryan Yun 99aad0f74b Merge branch 'master' into add-class-names 2017-09-28 11:38:14 -04:00
Chi Vinh Le 5d718f6dd4 Only shw user flags in detail 2017-09-28 22:02:06 +07:00
Kim Gardner 44ce71ef14 Merge pull request #974 from coralproject/redis-cluster-support
Redis Cluster Support
2017-09-28 15:44:02 +01:00
Kim Gardner 47cde9a842 Merge branch 'master' into redis-cluster-support 2017-09-28 15:38:51 +01:00
Chi Vinh Le 219399a231 Refactor ComemntDetail and implement ToxicDetail 2017-09-27 22:50:45 +07:00
Ryan Yun 95114bc847 Merge branch 'add-class-names' of github.com:ryanyun/talk into add-class-names 2017-09-27 11:21:19 -04:00
Ryan Yun 12047d1ae1 fix typo for dynamic class names for like and respect buttons 2017-09-27 11:20:57 -04:00
Kim Gardner 0362dad14b Merge branch 'master' into add-class-names 2017-09-27 16:06:21 +01:00
Kim Gardner 97b81cc1cc Merge pull request #991 from coralproject/featured-comment-content-slot
Use commentContent slot in Featured Comments
2017-09-27 16:05:51 +01:00
Kim Gardner 8d6b9dd23c Merge branch 'master' into featured-comment-content-slot 2017-09-27 10:54:37 +01:00
Kim Gardner 9adf11e1d1 Merge branch 'master' into update-translation-pt 2017-09-27 10:53:52 +01:00
Kim Gardner ef49d9a3d2 Merge pull request #988 from coralproject/password-reset-fix
Password reset fixes
2017-09-26 17:42:06 +01:00
Wyatt Johnson 921eea59c8 Merge branch 'master' into password-reset-fix 2017-09-26 10:36:47 -06:00
Kim Gardner c5cd88f4c0 Merge pull request #986 from coralproject/cleanup-dependencies
Cleanup dependencies
2017-09-26 17:25:10 +01:00
Kim Gardner 762f4f7898 Merge branch 'master' into cleanup-dependencies 2017-09-26 17:15:13 +01:00
Kiwi e400ae37f4 Merge branch 'master' into password-reset-fix 2017-09-26 18:14:20 +02:00
Kiwi 45b0ec48de Merge branch 'master' into featured-comment-content-slot 2017-09-26 18:11:21 +02:00
Kim Gardner f3f8c6b24e Merge pull request #985 from coralproject/mod-indicator
Moderate Indicator
2017-09-26 17:03:34 +01:00
Belen Curcio baa5bddd19 Merge branch 'mod-indicator' of github.com:coralproject/talk into mod-indicator 2017-09-26 12:43:05 -03:00
Belen Curcio bea7d75db7 Polling to update the Header Indicator 2017-09-26 12:42:39 -03:00
Belén Curcio 8e5edd65c7 Merge branch 'master' into mod-indicator 2017-09-26 12:36:59 -03:00
Wyatt Johnson 9ae59ef998 added parent url to the login popup 2017-09-26 09:35:33 -06:00
Chi Vinh Le 0f382bd742 Use commentContent slot in Featured Comments 2017-09-26 22:31:54 +07:00
Kim Gardner 55b1f4831a Add translation of "new" queue in Portuguese 2017-09-26 16:30:09 +01:00
Wyatt Johnson 3d2575413d Merge branch 'master' into password-reset-fix 2017-09-26 09:07:07 -06:00
Kiwi c40393347a Merge branch 'master' into use-talk-linting-preset 2017-09-26 14:39:25 +02:00
Chi Vinh Le 8c05e3df87 Use eslint-config-talk preset 2017-09-26 19:35:24 +07:00
Kim Gardner fa4adda61e Merge branch 'master' into redis-cluster-support 2017-09-26 12:26:24 +01:00
Kim Gardner ea06b334f6 Merge pull request #987 from coralproject/fix-contains-link-styling
Fix contains links styling
2017-09-26 12:25:30 +01:00
Wyatt Johnson 203d3c7ee9 bug fixes 2017-09-25 16:12:40 -06:00
Wyatt Johnson 825e1b5e5c Fixes to password reset flow 2017-09-25 14:50:33 -06:00
Chi Vinh Le 3db406bf26 Rename Community Query 2017-09-26 03:31:04 +07:00
Belén Curcio c5e078f1e1 Merge branch 'master' into mod-indicator 2017-09-25 13:49:56 -03:00
Belen Curcio e6f18d8558 Updates 2017-09-25 13:49:26 -03:00
Ryan Yun 76f259a2aa Merge branch 'master' into add-class-names 2017-09-25 12:34:20 -04:00
Ryan Yun 3f90f72bee update classes to follow talk naming convention 2017-09-25 12:33:59 -04:00
Chi Vinh Le f211bdf34e Fix contains links styling 2017-09-25 23:20:32 +07:00
Kiwi d2e5633d91 Merge branch 'master' into cleanup-dependencies 2017-09-25 18:20:07 +02:00
Kiwi b01e919029 Merge pull request #983 from coralproject/modqueue-live-new-comments
Modqueue live new comments
2017-09-25 18:19:46 +02:00
Wyatt Johnson 62b407179f Merge branch 'master' into redis-cluster-support 2017-09-25 10:10:09 -06:00
Belén Curcio 536ef70415 Merge branch 'master' into mod-indicator 2017-09-25 12:50:29 -03:00
Chi Vinh Le 981c319810 Clean dependencies 2017-09-25 21:34:35 +07:00
Belen Curcio 19e23479ee Showing the indicators 2017-09-22 17:45:28 -03:00
Belen Curcio 86687f10d8 Working indicators 2017-09-22 17:38:46 -03:00
Belen Curcio 3b6bcba055 Indicator for Community 2017-09-22 17:25:59 -03:00
Belen Curcio acdfaeee9f Moving the initial query up 2017-09-22 16:58:06 -03:00
Chi Vinh Le 792d0b9a2d Add comments 2017-09-23 02:18:45 +07:00
Chi Vinh Le 9be2379f30 Merge branch 'modqueue-live-new-comments' of ssh://github.com/coralproject/talk into modqueue-live-new-comments 2017-09-23 02:03:49 +07:00
Chi Vinh Le 1658b2594b PropType fixes 2017-09-23 02:03:34 +07:00
Kiwi d9e2fba569 Merge branch 'master' into modqueue-live-new-comments 2017-09-22 20:59:04 +02:00
Chi Vinh Le d9cabeafe2 Add translation and style fixes 2017-09-23 01:57:20 +07:00
Chi Vinh Le 171a6d506b Add proptypes 2017-09-23 01:09:32 +07:00
Chi Vinh Le a19de7bfb4 Don't scroll smooth when switching view mode 2017-09-23 00:53:27 +07:00
Ryan Yun 6138768588 add class names to moderation link 2017-09-22 12:34:27 -04:00
Ryan Yun 4c5f8b3359 add class name to submit button on configure comment stream form 2017-09-22 12:31:55 -04:00
Ryan Yun 605c87a799 featured and all comments have same left and right action container class names 2017-09-22 12:16:31 -04:00
Chi Vinh Le 1e0451ceba More styling refactor 2017-09-22 22:58:49 +07:00
Ryan Yun d60b869937 add class name to featured tag 2017-09-22 11:48:04 -04:00
Chi Vinh Le 9f4c97e138 Improve single view, keyboard navigation and refactor styles 2017-09-22 22:42:28 +07:00
Ryan Yun 66518f50dd add class name to off topic tag 2017-09-22 11:41:54 -04:00
Ryan Yun 7328926ad7 link button needs a span tag around button label 2017-09-22 11:20:06 -04:00
Ryan Yun a736c1620e add static class names for respected and liked buttons 2017-09-22 11:16:56 -04:00
Ryan Yun d359d915fe add class name for configure container 2017-09-22 11:11:22 -04:00
Ryan Yun 235b2e1068 add class name for my profile container 2017-09-22 11:10:39 -04:00
Kim Gardner f183aeb748 Merge pull request #979 from coralproject/pluginize-timestamp
Allow replacing comment timestamp
2017-09-22 14:24:15 +01:00
Chi Vinh Le 143adc7c6f Live update modqueue on new comments 2017-09-21 23:39:04 +07:00
Kim Gardner 91714705ea Merge branch 'master' into bump-version-3-6-0 2017-09-21 14:20:38 +01:00
Kim Gardner 64cc85eb24 Merge branch 'master' into pluginize-timestamp 2017-09-21 14:20:22 +01:00
Kim Gardner 7a043dac5b Merge pull request #982 from coralproject/remove-count
Remove count from Replies button and Change copy from Load More button
2017-09-21 14:19:57 +01:00
Belen Curcio edd3e7f6fe More copuy 2017-09-21 09:20:15 -03:00
Belen Curcio 3ef9bd5e52 Removing Count from replies button 2017-09-21 09:14:02 -03:00
Kim Gardner b60196e455 Bump version 2017-09-21 12:42:45 +01:00
Kim Gardner d315458e0e Merge branch 'master' into pluginize-timestamp 2017-09-21 12:41:42 +01:00
Wyatt Johnson abdb4cbe3e Merge pull request #980 from coralproject/version-bump
Update package.json
2017-09-20 16:27:33 -06:00
Wyatt Johnson 20380cd62f Update package.json 2017-09-20 16:23:07 -06:00
Wyatt Johnson 271f0cc237 Merge branch 'master' into redis-cluster-support 2017-09-20 13:54:41 -06:00
Kiwi 864aa2be28 Merge branch 'master' into pluginize-timestamp 2017-09-20 20:51:25 +02:00
Wyatt Johnson 4c8894d6e9 Merge pull request #978 from coralproject/fix-userdetail-all-tab
Fix empty user detail all tab
2017-09-20 12:48:46 -06:00
Chi Vinh Le dd5d06aa95 Request status=null 2017-09-21 01:43:04 +07:00
Chi Vinh Le 7e536cfb31 Rename PubDate to CommentTimestamp 2017-09-21 01:37:57 +07:00
Chi Vinh Le 5fa4b4d734 Remove styling that affects the slot.. 2017-09-21 01:24:59 +07:00
Chi Vinh Le e7c78a2465 Pluginize timestamp 2017-09-20 22:53:04 +07:00
Kim Gardner 95fadbd05a Merge branch 'master' into redis-cluster-support 2017-09-20 16:28:08 +01:00
Wyatt Johnson 6d04b4add3 Redis Cluster Support
- Deprecated unused `redis` options in favour of options from `ioredis`.
- Added support for ioredis Cluster.
- Enabled more extended redis client configuration.
2017-09-19 15:28:03 -06:00
658 changed files with 13444 additions and 29555 deletions
+10 -4
View File
@@ -1,9 +1,8 @@
{
"presets": [
"es2015"
["es2015", {modules: false}]
],
"plugins": [
"add-module-exports",
"transform-class-properties",
"transform-decorators-legacy",
"transform-object-assign",
@@ -11,5 +10,12 @@
"transform-async-to-generator",
"transform-react-jsx",
"syntax-dynamic-import"
]
}
],
"env": {
"test": {
"plugins": [
["transform-es2015-modules-commonjs", "dynamic-import-node"]
]
}
}
}
+2
View File
@@ -26,5 +26,7 @@ plugins/*
!plugins/talk-plugin-toxic-comments
!plugins/talk-plugin-remember-sort
!plugins/talk-plugin-deep-reply-count
!plugins/talk-plugin-subscriber
!plugins/talk-plugin-flag-details
node_modules
+1 -73
View File
@@ -1,75 +1,3 @@
{
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaVersion": 2017
},
"plugins": [
"json",
"promise",
"react"
],
"rules": {
"promise/no-return-wrap": "error",
"promise/param-names": "error",
"promise/catch-or-return": "warn",
"promise/no-native": "off",
"promise/no-nesting": "warn",
"promise/no-promise-in-callback": "warn",
"promise/no-callback-in-promise": "warn",
"react/display-name": "off",
// We'll keeping using this, as we'll switch over to Preact and we don't
// need to worry about deprecation.
"react/no-find-dom-node": "off",
// TODO: Use default after fixing the errors.
"react/prop-types": "warn",
"array-callback-return": "warn",
"arrow-parens": ["warn", "always"],
"comma-spacing": ["error", {"after": true}],
"curly": "error",
"eol-last": "warn",
"eqeqeq": ["error", "smart"],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"lines-around-comment": ["warn", {"beforeLineComment": true}],
"newline-per-chained-call": ["error", {"ignoreChainWithDepth": 2}],
"no-console": "off",
"no-const-assign": "error",
"no-duplicate-imports": "error",
"no-eval": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"no-lonely-if": "error",
"no-multiple-empty-lines": ["error", {"max": 1}],
"no-nested-ternary": "warn",
"no-path-concat": "error",
"no-script-url": "error",
"no-tabs": "error",
"no-template-curly-in-string": "warn",
"no-throw-literal": "error",
"no-unneeded-ternary": "warn",
"no-unsafe-negation": "warn",
"no-unused-vars": ["error", {"argsIgnorePattern": "^_|next", "varsIgnorePattern": "^_"}],
"no-var": "error",
"object-curly-spacing": "warn",
"prefer-template": "warn",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"space-in-parens": ["error", "never"],
"space-infix-ops": ["error"],
"space-unary-ops": ["error", {"words": true, "nonwords": false}],
"spaced-comment": ["warn", "always", {"line": {"exceptions": ["-", "="]}}],
"template-curly-spacing": "warn",
"yoda": "warn"
}
"extends": "@coralproject/eslint-config-talk"
}
+7
View File
@@ -15,6 +15,10 @@ client/coral-framework/graphql/introspection.json
*.DS_STORE
coverage/
test/e2e/reports/
test/e2e/bslocal.log
test/e2e/selenium-debug.log
browserstack.err
plugins.json
plugins/*
@@ -43,5 +47,8 @@ plugins/*
!plugins/talk-plugin-toxic-comments
!plugins/talk-plugin-remember-sort
!plugins/talk-plugin-deep-reply-count
!plugins/talk-plugin-subscriber
!plugins/talk-plugin-flag-details
!plugins/talk-plugin-slack-notifications
**/node_modules/*
+5
View File
@@ -0,0 +1,5 @@
{
"exceptions": [
"https://nodesecurity.io/advisories/531"
]
}
@@ -1,7 +1,4 @@
---
title: Contributor Covenant Code of Conduct
permalink: /docs/development/code-of-conduct/
---
# Contributor Covenant Code of Conduct
## Our Pledge
@@ -46,7 +43,7 @@ Other inappropriate behavior:
* Impersonation of someone else
* Violating someones privacy
If you feel that someone has harassed you or otherwise treated you or someone else inappropriately, please alert the project lead at [andrewl@mozillafoundation.org](mailto:andrewl@mozillafoundation.org).
If you feel that someone has harassed you or otherwise treated you or someone else inappropriately, please alert the project lead at [andrewl@mozillafoundation.org](mailto:andrewl@mozillafoundation.org).
## Our Responsibilities
@@ -71,11 +68,11 @@ If youre too frustrated to have a direct conversation, there are a number of
* Contact the project lead, Andrew Losowsky, [andrewl@mozillafoundation.org](mailto:andrewl@mozillafoundation.org), or the technical lead. We will work with you to help you figure out how to ensure that any conflict doesnt interfere with your work, in confidence if you would prefer.
* Talk to Chris Lawrence. Chris oversees the project. He can be contacted at [clawrence@mozillafoundation.org](mailto:clawrence@mozillafoundation.org).
* Talk to Chris Lawrence. Chris oversees the project. He can be contacted at [clawrence@mozillafoundation.org](mailto:clawrence@mozillafoundation.org).
If you feel you have been unfairly accused of violating this code of conduct, you should contact Chris with a concise description of your grievance.
## Conclusion
We welcome your feedback on this and every other aspect of what we do as The Coral Project, and we thank you for working with us to make it a safe, enjoyable, and friendly experience for everyone involved in the project and what we do.
Above text is licensed CC BY-SA 4.0, adapted from the SRCCON code of conduct, FreeBSDs code of conduct, Vox Medias product team code of conduct, Mediums code of conduct, as well as adapted from the Contributor Covenant.
Above text is licensed CC BY-SA 4.0, adapted from the SRCCON code of conduct, FreeBSDs code of conduct, Vox Medias product team code of conduct, Mediums code of conduct, as well as adapted from the Contributor Covenant.
@@ -1,13 +1,10 @@
---
title: Contributor's Guide
permalink: /docs/development/contributing/
---
# Contributor's Guide
Welcome! We are very excited that you are interested in contributing to Talk.
This document is a companion to help you approach contributing. If it does not do so, please [let us know how we can improve it](https://github.com/coralproject/talk/issues)!
By contributing to this project you agree to the [Code of Conduct](https://coralproject.net/code-of-conduct).
By contributing to this project you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
## What should I Contribute?
@@ -33,7 +30,7 @@ Please file issues if:
### What should I include?
Coral has adopted an iterative, agile development philosophy. All contributions that make it into the Talk repo should start with a story or this form:
Coral has adopted an iterative, agile development philosophy. All contributions that make it into the Talk repository should start with a story or this form:
> As a [type of person] I'd like to be able to [do something] so that I can [get some result].
@@ -56,15 +53,24 @@ We are looking for _documentarians_ to:
* create new / missing sections, and
* take the lead in making sections, or the over all structure better.
Information about how to update docs can be found in our [FAQ]({{ "/docs/faq" | absolute_url }}#how-do-i-contribute-to-these-docs).
Our documentation is stored in markdown files in the [docs](docs) directory. We
use Jekyll to provide our docs. To preview:
```shell
cd docs
bundle install
bundle exec jekyll serve
```
Then visit http://127.0.0.1:4000/talk/.
If you'd like to discuss a contribution, please [file an issue](https://github.com/coralproject/talk/issues) describing the changes you would like to see.
## Contributing Translations
Talk's tranlations are stored in `.yml` files [here](https://github.com/coralproject/talk/tree/master/locales).
Talk's translations are stored in `.yml` files [here](https://github.com/coralproject/talk/tree/master/locales).
Translations can be submitted via pull request. If you do not use github, you can use 'en.yml' as a template and [email](https://coralproject.net/contact) the translations to us. We can import it into the repo.
Translations can be submitted via pull request. If you do not use github, you can use 'en.yml' as a template and [email](https://coralproject.net/contact) the translations to us. We can import it into the repository.
## I want to contribute but I'm not sure what to do!
@@ -84,4 +90,4 @@ Have a favorite analytics engine? Data science service? CMS? Auth platform? Depl
### Favorite Features?
Do you have a favorite feature of an existing platform that's not yet been done in Talk? Sounds like Talk needs that feature.
Do you have a favorite feature of an existing platform that's not yet been done in Talk? Sounds like Talk needs that feature.
+26 -20
View File
@@ -1,29 +1,31 @@
# Talk [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk)
# Talk
[![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore)
[![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8)
Online comments are broken. Our open-source Talk tool rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here.](https://coralproject.net/products/talk.html)
Online comments are broken. Our open-source Talk tool rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/products/talk.html).
Third party licenses are available via the `/client/3rdpartylicenses.txt`
endpoint when the server is running with built assets.
Built with <3 by The Coral Project & Mozilla.
## Try Talk!
## Getting Started
- Developer Documentation & Setup Guides: https://coralproject.github.io/talk/ (includes Installation Guide, Quickstart, Plugin Guide, API Docs, and more)
Check out our Docs: https://coralproject.github.io/talk/
## Roadmap and Release Schedule
- Talk Roadmap: https://www.pivotaltracker.com/n/projects/1863625
## Learn More about Coral
## Relevant Links
- Blog: https://blog.coralproject.net/
- Community Forums: https://community.coralproject.net/
- Website: https://coralproject.net
- Blog: https://blog.coralproject.net
- Community Guides for Journalism: https://guides.coralproject.net/
- Project: https://coralproject.net/
- Roadmap: https://www.pivotaltracker.com/n/projects/1863625
## End-to-End Testing
Talk uses [Nightwatch](http://nightwatchjs.org/) to write e2e tests. The testing infrastructure that allows us to run our tests in real browsers is provided with love by our friends at Browserstack.
![](/public/img/browserstack_logo.png)
## License
@@ -33,8 +35,12 @@ endpoint when the server is running with built assets.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.
See the License for the specific language governing permissions and limitations under the License.
See the License for the specific language governing permissions
and limitations under the License.
+5 -13
View File
@@ -6,13 +6,9 @@ const merge = require('lodash/merge');
const helmet = require('helmet');
const compression = require('compression');
const cookieParser = require('cookie-parser');
const {
BASE_URL,
BASE_PATH,
MOUNT_PATH,
STATIC_URL,
HELMET_CONFIGURATION,
} = require('./url');
const {HELMET_CONFIGURATION} = require('./config');
const {MOUNT_PATH} = require('./url');
const {applyLocals} = require('./services/locals');
const routes = require('./routes');
const debug = require('debug')('talk:app');
@@ -57,12 +53,8 @@ app.set('view engine', 'ejs');
// ROUTES
//==============================================================================
// Apply the BASE_PATH, BASE_URL, and MOUNT_PATH on the app.locals, which will
// make them available on the templates and the routers.
app.locals.BASE_URL = BASE_URL;
app.locals.BASE_PATH = BASE_PATH;
app.locals.MOUNT_PATH = MOUNT_PATH;
app.locals.STATIC_URL = STATIC_URL;
// Add the locals to the app renderer.
applyLocals(app.locals);
debug(`mounting routes on the ${MOUNT_PATH} path`);
+3 -175
View File
@@ -1,161 +1,7 @@
#!/usr/bin/env node
const program = require('./commander');
const app = require('../app');
const debug = require('debug')('talk:cli:serve');
const errors = require('../errors');
const {createServer} = require('http');
const scraper = require('../services/scraper');
const mailer = require('../services/mailer');
const MigrationService = require('../services/migration');
const SetupService = require('../services/setup');
const kue = require('../services/kue');
const mongoose = require('../services/mongoose');
const util = require('./util');
const cache = require('../services/cache');
const {createSubscriptionManager} = require('../graph/subscriptions');
const {
PORT
} = require('../config');
/**
* Get port from environment and store in Express.
*/
const port = normalizePort(PORT);
app.set('port', port);
/**
* Create HTTP server.
*/
const server = createServer(app);
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
let bind = typeof port === 'string'
? `Pipe ${port}`
: `Port ${port}`;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(`${bind} requires elevated privileges`);
break;
case 'EADDRINUSE':
console.error(`${bind} is already in use`);
break;
}
throw error;
}
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
let port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "listening" event.
*/
async function onListening() {
// Start the cache instance.
await cache.init();
let addr = server.address();
let bind = typeof addr === 'string'
? `pipe ${addr}`
: `port ${addr.port}`;
debug(`API Server Listening on ${bind}`);
}
/**
* Start the app.
*/
async function startApp(program) {
try {
// Check to see if the application is installed. If the application
// has been installed, then it will throw errors.ErrSettingsNotInit, this
// just means we don't have to check that the migrations have run.
await SetupService.isAvailable();
debug('setup is currently available, migrations not being checked');
} catch (e) {
// Check the error.
switch (e) {
case errors.ErrInstallLock, errors.ErrSettingsInit:
debug('setup is not currently available, migrations now being checked');
// The error was expected, just continue.
break;
default:
// The error was not expected, throw the error!
throw e;
}
// Now try and check the migration status.
try {
// Verify that the minimum migration version is met.
await MigrationService.verify();
} catch (e) {
console.error(e);
process.exit(1);
}
debug('migrations do not have to be run');
}
/**
* Listen on provided port, on all network interfaces.
*/
server.on('error', onError);
server.on('listening', onListening);
server.on('listening', () => {
});
server.listen(port, () => {
// Mount the websocket server if requested.
if (program.websockets) {
debug(`Websocket Server Listening on ${port}`);
// Mount the subscriptions server on the application server.
createSubscriptionManager(server);
}
});
}
const serve = require('../serve');
//==============================================================================
// Setting up the program command line arguments.
@@ -166,24 +12,6 @@ program
.option('-w, --websockets', 'enable the websocket (subscriptions) handler on this thread')
.parse(process.argv);
// Start the application serving.
startApp(program);
// Start serving.
serve({jobs: program.jobs, websockets: program.websockets});
// Enable job processing on the thread if enabled.
if (program.jobs) {
// Start the scraper processor.
scraper.process();
// Start the mail processor.
mailer.process();
}
// Define a safe shutdown function to call in the event we need to shutdown
// because the node hooks are below which will interrupt the shutdown process.
// Shutdown the mongoose connection, the app server, and the scraper.
util.onshutdown([
() => program.jobs ? kue.Task.shutdown() : null,
() => mongoose.disconnect(),
() => server.close()
]);
+1 -1
View File
@@ -195,7 +195,7 @@ const performSetup = async () => {
password: user.password
}
});
console.log('Settings created.');
console.log(`User ${newUser.id} created.`);
console.log('\nTalk is now installed!');
+31 -1
View File
@@ -241,13 +241,21 @@ function listUsers() {
});
users.forEach((user) => {
let state = user.disabled ? 'Disabled' : 'Enabled';
const profile = user.profiles.find(({provider}) => provider === 'local');
if (profile && profile.metadata && profile.metadata.confirmed_at) {
state += ', Verified';
} else {
state += ', Unverified';
}
table.push([
user.id,
user.username,
user.profiles.map((p) => p.provider).join(', '),
user.roles.join(', '),
user.status,
user.disabled ? 'Disabled' : 'Enabled'
state
]);
});
@@ -396,6 +404,23 @@ function enableUser(userID) {
});
}
/**
* Verifies an email address for a user.
*
* @param userID the user's id
* @param email the user's email address to be verified
*/
async function verify(userID, email) {
try {
await UsersService.confirmEmail(userID, email);
console.log(`User ${userID} had their email ${email} verified.`);
util.shutdown();
} catch (err) {
console.error(err);
util.shutdown(1);
}
}
//==============================================================================
// Setting up the program command line arguments.
//==============================================================================
@@ -467,6 +492,11 @@ program
.description('enable a given user from logging in')
.action(enableUser);
program
.command('verify <userID> <email>')
.description('verifies the given user\'s email address')
.action(verify);
program.parse(process.argv);
// If there is no command listed, output help.
-14
View File
@@ -1,14 +0,0 @@
{
"presets": [
"es2015"
],
"plugins": [
"add-module-exports",
"transform-class-properties",
"transform-decorators-legacy",
"transform-object-assign",
"transform-object-rest-spread",
"transform-async-to-generator",
"transform-react-jsx"
]
}
+15 -4
View File
@@ -7,9 +7,7 @@ machine:
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
NODE_ENV: "test"
dependencies:
override:
pre:
# TODO: use the following to add in support for MongoDB 3.4.
# # Upgrade the database version to 3.4.
# - sudo apt-get purge mongodb-org*
@@ -19,10 +17,20 @@ dependencies:
# - sudo apt-get install -y mongodb-org
# - sudo service mongod restart
# Install chromium for e2e and remove old google-chrome
- sudo rm -rf /opt/google/chrome
- sudo rm -f /usr/bin/google-chrome*
- sudo apt-get update
- sudo apt-get install chromium-browser
dependencies:
override:
# Install node dependencies.
- yarn --version
- yarn global add node-gyp --force
- yarn global add node-gyp nsp --force
- yarn
post:
# Build the static assets.
- yarn build
@@ -40,6 +48,9 @@ test:
override:
# Run the tests using the junit reporter.
- MOCHA_FILE=$CIRCLE_TEST_REPORTS/junit/test-results.xml MOCHA_REPORTER=mocha-junit-reporter yarn test
# Check dependancies using nsp.
- nsp check
# - yarn e2e-ci
deployment:
release:
+1 -22
View File
@@ -1,24 +1,3 @@
{
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"extends": "../.eslintrc.json",
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
}
},
"parser": "babel-eslint",
"plugins": [
"react"
],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"no-console": ["warn", { "allow": ["warn", "error"] }]
}
"extends": "@coralproject/eslint-config-talk/client"
}
+2 -2
View File
@@ -6,7 +6,7 @@ import Configure from 'routes/Configure';
import Dashboard from 'routes/Dashboard';
import Install from 'routes/Install';
import Stories from 'routes/Stories';
import {CommunityLayout, Community} from 'routes/Community';
import Community from 'routes/Community/containers/Community';
import {ModerationLayout, Moderation} from 'routes/Moderation';
import Layout from 'containers/Layout';
@@ -22,7 +22,7 @@ const routes = (
{/* Community Routes */}
<Route path='community' component={CommunityLayout}>
<Route path='community'>
<Route path='flagged' components={Community}>
<Route path=':id' components={Community} />
</Route>
+22 -16
View File
@@ -1,11 +1,12 @@
import qs from 'qs';
import queryString from 'query-string';
import {
FETCH_COMMENTERS_REQUEST,
FETCH_COMMENTERS_SUCCESS,
FETCH_COMMENTERS_FAILURE,
FETCH_USERS_REQUEST,
FETCH_USERS_SUCCESS,
FETCH_USERS_FAILURE,
SORT_UPDATE,
COMMENTERS_NEW_PAGE,
SET_PAGE,
SET_SEARCH_VALUE,
SET_ROLE,
SET_COMMENTER_STATUS,
SHOW_BANUSER_DIALOG,
@@ -16,14 +17,13 @@ import {
import t from 'coral-framework/services/i18n';
export const fetchAccounts = (query = {}) => (dispatch, _, {rest}) => {
dispatch(requestFetchAccounts());
rest(`/users?${qs.stringify(query)}`)
export const fetchUsers = (query = {}) => (dispatch, _, {rest}) => {
dispatch(requestFetchUsers());
rest(`/users?${queryString.stringify(query)}`)
.then(({result, page, count, limit, totalPages}) =>{
dispatch({
type: FETCH_COMMENTERS_SUCCESS,
accounts: result,
type: FETCH_USERS_SUCCESS,
users: result,
page,
count,
limit,
@@ -33,12 +33,12 @@ export const fetchAccounts = (query = {}) => (dispatch, _, {rest}) => {
.catch((error) => {
console.error(error);
const errorMessage = error.translation_key ? t(`error.${error.translation_key}`) : error.toString();
dispatch({type: FETCH_COMMENTERS_FAILURE, error: errorMessage});
dispatch({type: FETCH_USERS_FAILURE, error: errorMessage});
});
};
const requestFetchAccounts = () => ({
type: FETCH_COMMENTERS_REQUEST
const requestFetchUsers = () => ({
type: FETCH_USERS_REQUEST
});
export const updateSorting = (sort) => ({
@@ -46,8 +46,14 @@ export const updateSorting = (sort) => ({
sort
});
export const newPage = () => ({
type: COMMENTERS_NEW_PAGE
export const setPage = (page) => ({
type: SET_PAGE,
page,
});
export const setSearchValue = (value) => ({
type: SET_SEARCH_VALUE,
value,
});
export const setRole = (id, role) => (dispatch, _, {rest}) => {
@@ -0,0 +1,13 @@
import * as actions from 'constants/configure';
export const updatePending = ({updater, errorUpdater}) => {
return {type: actions.UPDATE_PENDING, updater, errorUpdater};
};
export const clearPending = () => {
return {type: actions.CLEAR_PENDING};
};
export const setActiveSection = (section) => {
return {type: actions.SET_ACTIVE_SECTION, section};
};
@@ -1,58 +0,0 @@
import t from 'coral-framework/services/i18n';
export const SETTINGS_LOADING = 'SETTINGS_LOADING';
export const SETTINGS_RECEIVED = 'SETTINGS_RECEIVED';
export const SETTINGS_FETCH_ERROR = 'SETTINGS_FETCH_ERROR';
export const SETTINGS_UPDATED = 'SETTINGS_UPDATED';
export const SAVE_SETTINGS_LOADING = 'SAVE_SETTINGS_LOADING';
export const SAVE_SETTINGS_SUCCESS = 'SAVE_SETTINGS_SUCCESS';
export const SAVE_SETTINGS_FAILED = 'SAVE_SETTINGS_FAILED';
export const WORDLIST_UPDATED = 'WORDLIST_UPDATED';
export const DOMAINLIST_UPDATED = 'DOMAINLIST_UPDATED';
export const fetchSettings = () => (dispatch, _, {rest}) => {
dispatch({type: SETTINGS_LOADING});
rest('/settings')
.then((settings) => {
dispatch({type: SETTINGS_RECEIVED, settings});
})
.catch((error) => {
console.error(error);
const errorMessage = error.translation_key ? t(`error.${error.translation_key}`) : error.toString();
dispatch({type: SETTINGS_FETCH_ERROR, error: errorMessage});
});
};
// for updating top-level settings
export const updateSettings = (settings) => {
return {type: SETTINGS_UPDATED, settings};
};
// this is a nested property, so it needs a special action.
export const updateWordlist = (listName, list) => {
return {type: WORDLIST_UPDATED, listName, list};
};
export const updateDomainlist = (listName, list) => {
return {type: DOMAINLIST_UPDATED, listName, list};
};
export const saveSettingsToServer = () => (dispatch, getState, {rest}) => {
let settings = getState().settings;
if (settings.charCount) {
settings.charCount = parseInt(settings.charCount);
}
dispatch({type: SAVE_SETTINGS_LOADING});
rest('/settings', {method: 'PUT', body: settings})
.then(() => {
dispatch({type: SAVE_SETTINGS_SUCCESS, settings});
})
.catch((error) => {
console.error(error);
const errorMessage = error.translation_key ? t(`error.${error.translation_key}`) : error.toString();
dispatch({type: SAVE_SETTINGS_FAILED, error: errorMessage});
});
};
@@ -1,12 +1,17 @@
import queryString from 'query-string';
import {
FETCH_ASSETS_REQUEST,
FETCH_ASSETS_SUCCESS,
FETCH_ASSETS_FAILURE,
SET_PAGE,
SET_SEARCH_VALUE,
SET_CRITERIA,
UPDATE_ASSET_STATE_REQUEST,
UPDATE_ASSET_STATE_SUCCESS,
UPDATE_ASSET_STATE_FAILURE,
UPDATE_ASSETS
} from '../constants/assets';
} from '../constants/stories';
import t from 'coral-framework/services/i18n';
@@ -16,13 +21,16 @@ import t from 'coral-framework/services/i18n';
// Fetch a page of assets
// Get comments to fill each of the three lists on the mod queue
export const fetchAssets = (skip = '', limit = '', search = '', sort = '', filter = '') => (dispatch, _, {rest}) => {
export const fetchAssets = (query = {}) => (dispatch, _, {rest}) => {
dispatch({type: FETCH_ASSETS_REQUEST});
return rest(`/assets?skip=${skip}&limit=${limit}&sort=${sort}&search=${search}&filter=${filter}`)
.then(({result, count}) =>
return rest(`/assets?${queryString.stringify(query)}`)
.then(({result, page, count, limit, totalPages}) =>
dispatch({type: FETCH_ASSETS_SUCCESS,
assets: result,
count
page,
count,
limit,
totalPages,
}))
.catch((error) => {
console.error(error);
@@ -47,3 +55,19 @@ export const updateAssetState = (id, closedAt) => (dispatch, _, {rest}) => {
export const updateAssets = (assets) => (dispatch) => {
dispatch({type: UPDATE_ASSETS, assets});
};
export const setPage = (page) => ({
type: SET_PAGE,
page,
});
export const setSearchValue = (value) => ({
type: SET_SEARCH_VALUE,
value,
});
export const setCriteria = (criteria) => ({
type: SET_CRITERIA,
criteria,
});
+7 -1
View File
@@ -4,7 +4,7 @@ export const viewUserDetail = (userId) => ({type: actions.VIEW_USER_DETAIL, user
export const hideUserDetail = () => ({type: actions.HIDE_USER_DETAIL});
export const changeUserDetailStatuses = (tab) => {
let statuses = [];
let statuses = null;
if (tab === 'rejected') {
statuses = ['REJECTED'];
}
@@ -20,3 +20,9 @@ export const toggleSelectCommentInUserDetail = (id, active) => {
};
};
export const toggleSelectAllCommentInUserDetail = (ids, active) => {
return {
type: active ? actions.SELECT_ALL_USER_DETAIL_COMMENT : actions.CLEAR_USER_DETAIL_SELECTIONS,
ids
};
};
@@ -1,38 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './ModerationList.css';
import {Button} from 'coral-ui';
import {menuActionsMap} from '../utils/moderationQueueActionsMap';
import t from 'coral-framework/services/i18n';
const ActionButton = ({type = '', active, ...props}) => {
const typeName = type.toLowerCase();
let text = menuActionsMap[type].text;
if (text === 'approve' && active) {
text = 'approved';
} else if (text === 'reject' && active) {
text = 'rejected';
}
return (
<Button
className={`${typeName} ${styles.actionButton} ${props.minimal ? styles.minimal : ''} ${active ? styles[`${typeName}__active`] : ''}`}
cStyle={typeName}
icon={menuActionsMap[type].icon}
onClick={type === 'APPROVE' ? props.acceptComment : props.rejectComment}
>{props.minimal ? '' : t(`modqueue.${text}`)}</Button>
);
};
ActionButton.propTypes = {
active: PropTypes.bool,
type: PropTypes.oneOf(['APPROVE', 'REJECT']),
minimal: PropTypes.bool,
acceptComment: PropTypes.func,
rejectComment: PropTypes.func,
};
export default ActionButton;
@@ -4,6 +4,7 @@ import Layout from 'coral-admin/src/components/ui/Layout';
import styles from './NotFound.css';
import {Button, TextField, Alert, Success} from 'coral-ui';
import Recaptcha from 'react-recaptcha';
import cn from 'classnames';
class AdminLogin extends React.Component {
@@ -34,19 +35,22 @@ class AdminLogin extends React.Component {
render () {
const {errorMessage, loginMaxExceeded, recaptchaPublic} = this.props;
const signInForm = (
<form onSubmit={this.handleSignIn}>
<form className="talk-admin-login-sign-in" onSubmit={this.handleSignIn}>
{errorMessage && <Alert>{errorMessage}</Alert>}
<TextField
id="email"
label='Email Address'
value={this.state.email}
onChange={(e) => this.setState({email: e.target.value})} />
<TextField
id="password"
label='Password'
value={this.state.password}
onChange={(e) => this.setState({password: e.target.value})}
type='password' />
<div style={{height: 10}}></div>
<Button
className="talk-admin-login-sign-in-button"
type='submit'
cStyle='black'
full
@@ -90,7 +94,7 @@ class AdminLogin extends React.Component {
);
return (
<Layout fixedDrawer restricted={true}>
<div className={styles.loginLayout}>
<div className={cn(styles.loginLayout, 'talk-admin-login')}>
<h1 className={styles.loginHeader}>Team sign in</h1>
<p className={styles.loginCTA}>Sign in to interact with your community.</p>
{ this.state.requestPassword ? requestPasswordForm : signInForm }
@@ -0,0 +1,44 @@
.root {
display: block;
color: #519954;
border: solid 2px rgba(81, 153, 84, 0.75);
background: white;
padding: 10px 12px;
box-sizing: border-box;
vertical-align: middle;
line-height: 24px;
font-size: 17px;
height: 47px;
border-radius: 3px;
text-transform: capitalize;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.03), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.09);
width: 129px;
transform: scale(.8);
margin: 0;
&:hover {
box-shadow: none;
color: white;
background-color: #519954;
cursor: pointer;
}
}
.active {
box-shadow: none;
color: white;
background-color: #519954;
&:hover {
cursor: not-allowed;
}
}
.minimal {
width: 45px;
min-width: 0;
}
.icon {
margin-right: 5px;
}
@@ -0,0 +1,30 @@
import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import styles from './ApproveButton.css';
import {Icon} from 'coral-ui';
import t from 'coral-framework/services/i18n';
const ApproveButton = ({active, minimal, onClick}) => {
const text = active ? t('modqueue.approved') : t('modqueue.approve');
return (
<button
className={cn(styles.root, {[styles.minimal]: minimal, [styles.active]: active})}
onClick={onClick}
>
<Icon name={'done'} className={styles.icon} />
{!minimal && text}
</button>
);
};
ApproveButton.propTypes = {
active: PropTypes.bool,
minimal: PropTypes.bool,
onClick: PropTypes.func,
};
export default ApproveButton;
@@ -0,0 +1,18 @@
.root {
min-height: 25px;
padding: 0 16px;
}
.moreDetail {
position: absolute;
font-size: 12px;
font-weight: 500;
color: black;
right: 16px;
&:hover {
opacity: 0.9;
cursor: pointer;
}
}
@@ -0,0 +1,66 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import styles from './CommentDetails.css';
import t from 'coral-framework/services/i18n';
import Slot from 'coral-framework/components/Slot';
import IfSlotIsNotEmpty from 'coral-framework/components/IfSlotIsNotEmpty';
class CommentDetails extends Component {
state = {
showDetail: false
};
constructor () {
super();
this.state = {
showDetail: false
};
}
toggleDetail = () => {
this.setState((state) => ({
showDetail: !state.showDetail
}));
}
render() {
const {data, root, comment} = this.props;
const {showDetail} = this.state;
const queryData = {
root,
comment,
};
return (
<div className={styles.root}>
<IfSlotIsNotEmpty
queryData={queryData}
slot={['adminCommentMoreDetails', 'adminCommentMoreFlagDetails']}
>
<a onClick={this.toggleDetail} className={styles.moreDetail}>
{showDetail ? t('modqueue.less_detail') : t('modqueue.more_detail')}
</a>
</IfSlotIsNotEmpty>
<Slot
fill="adminCommentDetailArea"
data={data}
queryData={queryData}
more={showDetail}
/>
{showDetail && <Slot
fill="adminCommentMoreDetails"
data={data}
queryData={queryData}
/>}
</div>
);
}
}
CommentDetails.propTypes = {
data: PropTypes.object.isRequired,
root: PropTypes.object.isRequired,
comment: PropTypes.object.isRequired,
};
export default CommentDetails;
@@ -0,0 +1,13 @@
@custom-media --table-viewport (max-width: 1024px);
:global {
.mdl-layout__drawer-button {
visibility: hidden;
}
@media (--table-viewport) {
.mdl-layout__drawer-button {
visibility: visible;
}
}
}
@@ -6,8 +6,8 @@ import styles from './Drawer.css';
import t from 'coral-framework/services/i18n';
import {can} from 'coral-framework/services/perms';
const CoralDrawer = ({handleLogout, auth}) => (
<Drawer className={styles.header}>
const CoralDrawer = ({handleLogout, auth = {}}) => (
<Drawer className={styles.drawer}>
{ auth && auth.user && can(auth.user, 'ACCESS_ADMIN') ?
<div>
<Navigation className={styles.nav}>
@@ -57,7 +57,8 @@ const CoralDrawer = ({handleLogout, auth}) => (
CoralDrawer.propTypes = {
handleLogout: PropTypes.func.isRequired,
restricted: PropTypes.bool // hide app elements from a logged out user
restricted: PropTypes.bool, // hide app elements from a logged out user
auth: PropTypes.object
};
export default CoralDrawer;
@@ -1,83 +0,0 @@
.flagBox {
border-top: 1px solid rgba(66, 66, 66, 0.12);
margin-top: 10px;
.container {
padding: 0 14px;
}
.detail {
padding: 0 20px 16px;
ul {
padding: 0;
list-style: none;
font-size: 12px;
font-weight: 500;
}
}
.header {
position: relative;
.moreDetail {
float: right;
font-size: 12px;
font-weight: 500;
margin-right: 10px;
margin-top: 8px;
color: black;
&:hover {
opacity: 0.9;
cursor: pointer;
}
}
i {
vertical-align: middle;
font-size: 12px;
}
ul {
vertical-align: middle;
list-style: none;
display: inline-block;
padding: 0;
margin-left: 10px;
font-size: 12px;
}
}
h3 {
vertical-align: middle;
margin: 0;
font-weight: 500;
display: inline-block;
margin-left: 7px;
font-size: 12px;
}
}
.lessDetail {
display: inline-block;
margin-right: 10px;
}
.subDetail {
font-weight: normal;
color: #888;
span {
color: black;
}
}
.username {
color: #393B44;
text-decoration: none;
cursor: pointer;
font-weight: 600;
padding: 2px 5px;
border-radius: 2px;
margin-left: -5px;
transition: background-color 200ms ease;
&:hover {
background-color: #E0E0E0;
}
}
@@ -1,97 +0,0 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Icon} from 'coral-ui';
import styles from './FlagBox.css';
import t from 'coral-framework/services/i18n';
const shortReasons = {
'This comment is offensive': t('modqueue.offensive'),
'This looks like an ad/marketing': t('modqueue.spam_ads'),
'This user is impersonating': t('modqueue.impersonating'),
'I don\'t like this username': t('modqueue.dont_like_username'),
'Other': t('modqueue.other')
};
class FlagBox extends Component {
constructor () {
super();
this.state = {
showDetail: false
};
}
toggleDetail = () => {
this.setState((state) => ({
showDetail: !state.showDetail
}));
}
reasonMap = (reason) => {
const shortReason = shortReasons[reason];
// if the short reason isn't found, just return the long one.
return shortReason ? shortReason : reason;
}
render() {
const {actionSummaries, actions, viewUserDetail} = this.props;
const {showDetail} = this.state;
return (
<div className={styles.flagBox}>
<div className={styles.container}>
<div className={styles.header}>
<Icon name='flag'/><h3>{t('community.flags')} ({actionSummaries.length}):</h3>
<ul>
{actionSummaries.map((action, i) =>
<li key={i} className={styles.lessDetail}> {this.reasonMap(action.reason)} (<strong>{action.count}</strong>)</li>
)}
</ul>
<a onClick={this.toggleDetail} className={styles.moreDetail}>{showDetail ? t('modqueue.less_detail') : t('modqueue.more_detail')}</a>
</div>
{showDetail && (
<div className={styles.detail}>
<ul>
{actionSummaries.map((summary, i) => {
const actionList = actions.filter((a) => a.reason === summary.reason);
return (
<li key={i}>
{this.reasonMap(summary.reason)} (<strong>{summary.count}</strong>)
<ul>
{actionList.map((action, j) =>
<li key={`${i}_${j}`} className={styles.subDetail}>
{action.user &&
<a className={styles.username} onClick={() => viewUserDetail(action.user.id)}>
{action.user.username}
</a>
}
{action.message}
</li>
)}
</ul>
</li>
);
})}
</ul>
</div>
)}
</div>
</div>
);
}
}
FlagBox.propTypes = {
actionSummaries: PropTypes.arrayOf(PropTypes.shape({
reason: PropTypes.string,
count: PropTypes.number
})).isRequired,
actions: PropTypes.arrayOf(PropTypes.shape({
message: PropTypes.string,
user: PropTypes.shape({username: PropTypes.string})
})).isRequired
};
export default FlagBox;
@@ -21,7 +21,6 @@
.callToAction {
position: fixed;
left: 10px;
bottom: 10px;
width: 280px;
height: 200px;
@@ -29,6 +28,7 @@
padding: 15px;
box-sizing: border-box;
box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.15);
z-index: 10;
.ctaHeader {
font-size: 16px;
@@ -10,6 +10,8 @@ const shortcuts = [
shortcuts: {
'j': 'modqueue.next_comment',
'k': 'modqueue.prev_comment',
'ctrl+f': 'modqueue.toggle_search',
't': 'modqueue.next_queue',
's': 'modqueue.singleview',
'?': 'modqueue.thismenu'
}
@@ -1,208 +0,0 @@
@custom-media --big-viewport (min-width: 780px);
.list {
padding: 8px 0;
list-style: none;
display: block;
&.singleView .listItem {
display: none;
}
&.singleView .listItem.activeItem {
display: block;
height: 100%;
font-size: 1.5em;
line-height: 1.5em;
border: none;
.actions {
position: fixed;
bottom: 60px;
left: 25%;
margin: 0 auto;
display: flex;
justify-content: space-around;
width: 50%;
margin: 0;
}
.actionButton {
transform: scale(1.4);
}
}
}
.listItem {
border-bottom: 1px solid #e0e0e0;
font-size: 16px;
width: 100%;
max-width: 660px;
min-width: 400px;
margin: 0 auto;
padding: 16px 14px;
position: relative;
transition: box-shadow 200ms;
&:hover {
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
&:last-child {
border-bottom: none;
}
.sideActions {
position: absolute;
right: 0;
height: 100%;
top: 0;
padding: 40px 18px;
box-sizing: border-box;
}
.itemHeader {
display: flex;
align-items: center;
justify-content: space-between;
.author {
min-width: 230px;
display: flex;
align-items: center;
}
}
.itemBody {
display: flex;
justify-content: space-between;
}
.avatar {
margin-right: 16px;
height: 40px;
width: 40px;
border-radius: 50%;
background-color: #757575;
font-size: 40px;
color: #fff;
}
.created {
color: #666;
font-size: 13px;
margin-left: 40px;
}
.body {
margin-top: 20px;
flex: 1;
font-size: 0.88em;
color: black;
}
.flagged {
color: rgba(255, 0, 0, .5);
padding-top: 15px;
padding-left: 10px;
}
.flagCount{
font-size: 12px;
color: #d32f2f;
}
}
.empty {
color: #444;
margin-top: 50px;
text-align: center;
}
@media (--big-viewport) {
.listItem {
border: 1px solid #e0e0e0;
margin-bottom: 30px;
&:last-child {
border-bottom: 1px solid #e0e0e0;
}
&.activeItem {
border: 2px solid #333;
}
}
}
.hasLinks {
color: #f00;
text-align: right;
display: flex;
align-items: center;
i {
margin-right: 5px;
}
}
.banned {
color: #f00;
text-align: left;
display: flex;
align-items: center;
i {
margin-right: 5px;
}
}
.ban {
display: block;
text-align: center;
margin-top: 5px;
}
.banButton {
width: 114px;
letter-spacing: 1px;
i {
vertical-align: middle;
margin-right: 10px;
font-size: 14px;
}
}
.selected {
border-radius: 10px;
}
.actionButton {
transform: scale(.8);
margin: 0;
}
.minimal {
width: 45px;
min-width: 0;
}
.approve__active {
box-shadow: none;
color: white;
background-color: #519954;
cursor: not-allowed;
}
.reject__active, .rejected__active {
color: white;
background-color: #D03235;
box-shadow: none;
cursor: not-allowed;
}
@@ -1,228 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './ModerationList.css';
import key from 'keymaster';
import Hammer from 'hammerjs';
import Comment from './Comment';
import User from './User';
import SuspendUserModal from './SuspendUserModal';
// Each action has different meaning and configuration
const menuOptionsMap = {
'reject': {status: 'REJECTED', icon: 'close', key: 'f'},
'approve': {status: 'ACCEPTED', icon: 'done', key: 'd'},
'flag': {status: 'FLAGGED', icon: 'flag', filter: 'Untouched'},
'ban': {status: 'BANNED', icon: 'not interested'}
};
// Renders a comment list and allow performing actions
export default class ModerationList extends React.Component {
static propTypes = {
isActive: PropTypes.bool,
singleView: PropTypes.bool,
commentIds: PropTypes.arrayOf(PropTypes.string),
actionIds: PropTypes.arrayOf(PropTypes.string),
comments: PropTypes.object,
users: PropTypes.object.isRequired,
actions: PropTypes.object,
userStatusUpdate: PropTypes.func.isRequired,
suspendUser: PropTypes.func.isRequired,
// list of actions (flags, etc) associated with the comments
modActions: PropTypes.arrayOf(PropTypes.string).isRequired,
loading: PropTypes.bool,
suspectWords: PropTypes.arrayOf(PropTypes.string).isRequired
}
state = {active: null, suspendUserModal: null, email: null};
// remove key handlers before leaving
componentWillUnmount () {
this.unbindKeyHandlers();
}
// add key handlers and gestures
componentDidMount () {
this.bindKeyHandlers();
// this.bindGestures() // need to check whether we're on a mobile device or this throws an Error
}
// If entering to singleview and no active, active is the first eleement
componentWillReceiveProps (nextProps) {
if (nextProps.singleView && !this.state.active) {
this.setState({active: nextProps.commentIds[0]});
}
}
// Add swipe to approve or reject
bindGestures () {
const {modActions} = this.props;
this._hammer = new Hammer(this.base);
this._hammer.get('swipe').set({direction: Hammer.DIRECTION_HORIZONTAL});
if (modActions.indexOf('reject') !== -1) {
this._hammer.on('swipeleft', () => this.props.singleView && this.actionKeyHandler('Rejected'));
}
if (modActions.indexOf('approve') !== -1) {
this._hammer.on('swiperight', () => this.props.singleView && this.actionKeyHandler('Approved'));
}
}
// Add key handlers. Each action has one and added j/k for moving around
bindKeyHandlers () {
const {modActions, isActive} = this.props;
modActions.filter((action) => menuOptionsMap[action].key).forEach((action) => {
key(menuOptionsMap[action].key, 'moderationList', () => isActive && this.actionKeyHandler(menuOptionsMap[action].status));
});
key('j', 'moderationList', () => isActive && this.moveKeyHandler('down'));
key('k', 'moderationList', () => isActive && this.moveKeyHandler('up'));
key.setScope('moderationList');
}
// Perform an action using the keys only if the comment is active
actionKeyHandler (action) {
if (this.props.isActive && this.state.active) {
this.onClickAction(action, this.state.active);
}
}
// move around with j/k
moveKeyHandler (direction) {
if (!this.props.isActive) {
return;
}
const {commentIds} = this.props;
const {active} = this.state;
// check boundaries
if (active === null || !commentIds.length) {
this.setState({active: commentIds[0]});
} else if (direction === 'up' && active !== commentIds[0]) {
this.setState({active: commentIds[commentIds.indexOf(active) - 1]});
} else if (direction === 'down' && active !== commentIds[commentIds.length - 1]) {
this.setState({active: commentIds[commentIds.indexOf(active) + 1]});
}
// scroll to the position
const index = Math.max(commentIds.indexOf(this.state.active), 0);
this.base.childNodes[index] && this.base.childNodes[index].focus();
}
unbindKeyHandlers () {
key.deleteScope('moderationList');
}
// If we are performing an action over a comment (aka removing from the list) we need to select a new active.
// TODO: In the future this can be improved and look at the actual state to
// resolve since the content of the list could change externally. For now it works as expected
onClickAction = (menuOption, id, action) => {
// activate the next comment
if (id === this.state.active) {
const moderationIds = this.getModerationIds();
if (moderationIds[moderationIds.length - 1] === this.state.active) {
this.setState({active: moderationIds[moderationIds.length - 2]});
} else {
this.setState({active: moderationIds[Math.min(moderationIds.indexOf(this.state.active) + 1, moderationIds.length - 1)]});
}
}
// Update the status right away if this is a comment
if (action.item_type === 'COMMENTS') {
this.props.updateCommentStatus(menuOption, id);
} else if (action.item_type === 'USERS') {
// If a user bio or name is rejected, bring up a dialog before suspending them.
if (menuOption === 'REJECTED') {
this.setState({suspendUserModal: action});
} else if (menuOption === 'ACCEPTED') {
this.props.userStatusUpdate('APPROVED', action.item_id);
}
}
}
onClickShowBanDialog = (userId, userName, commentId) => {
this.props.onClickShowBanDialog(userId, userName, commentId);
}
mapModItems = (itemId, index) => {
const {comments = {}, users, actions = {}, modActions, suspectWords, hideActive} = this.props;
const {active} = this.state;
// Because ids are unique, the id will either appear as an action or as a comment.
const item = comments[itemId] || actions[itemId];
let modItem;
if (item.body) {
// If the item is a comment...
const author = users[item.author_id];
modItem = <Comment
suspectWords={suspectWords}
comment={item}
author={author}
key={index}
index={index}
onClickAction={this.onClickAction}
onClickShowBanDialog={this.onClickShowBanDialog}
modActions={modActions}
menuOptionsMap={menuOptionsMap}
isActive={itemId === active}
hideActive={hideActive} />;
} else {
// If the item is an action...
const user = users[item.item_id];
modItem = user && <User
suspectWords={suspectWords}
action={item}
user={user}
key={index}
index={index}
onClickAction={this.onClickAction}
onClickShowBanDialog={this.onClickShowBanDialog}
modActions={modActions}
menuOptionsMap={menuOptionsMap}
isActive={itemId === active}
hideActive={hideActive} />;
}
return modItem;
}
getModerationIds = () => {
const {commentIds = [], actionIds = [], comments, actions} = this.props;
if (comments && actions) {
return [ ...commentIds, ...actionIds ].sort((a, b) => {
const itemA = comments[a] || actions[a];
const itemB = comments[b] || actions[b];
return itemB.updated_at - itemA.updated_at;
});
} else {
return comments ? commentIds : actionIds;
}
}
render () {
const {singleView, key, suspendUser} = this.props;
// Combine moderations and actions into a single stream and sort by most recently updated.
const moderationIds = this.getModerationIds();
return (
<ul
className={`${styles.list} ${singleView ? styles.singleView : ''}`} {...key}
id='moderationList'>
{moderationIds.map(this.mapModItems)}
<SuspendUserModal
action = {this.state.suspendUserModal}
onClose={() => this.setState({suspendUserModal:null})}
suspendUser={suspendUser} />
</ul>
);
}
}
@@ -0,0 +1,44 @@
.root {
display: block;
color: #D03235;
border: solid 1px #D03235;
background: white;
padding: 10px 11px;
box-sizing: border-box;
vertical-align: middle;
line-height: 24px;
font-size: 17px;
height: 47px;
border-radius: 3px;
text-transform: capitalize;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.03), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.09);
width: 129px;
transform: scale(.8);
margin: 0;
&:hover {
color: white;
background-color: #D03235;
box-shadow: none;
cursor: pointer;
}
}
.active {
color: white;
background-color: #D03235;
box-shadow: none;
&:hover {
cursor: not-allowed;
}
}
.minimal {
width: 45px;
min-width: 0;
}
.icon {
margin-right: 5px;
}
@@ -0,0 +1,30 @@
import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import styles from './RejectButton.css';
import {Icon} from 'coral-ui';
import t from 'coral-framework/services/i18n';
const RejectButton = ({active, minimal, onClick}) => {
const text = active ? t('modqueue.rejected') : t('modqueue.reject');
return (
<button
className={cn(styles.root, {[styles.minimal]: minimal, [styles.active]: active})}
onClick={onClick}
>
<Icon name={'close'} className={styles.icon} />
{!minimal && text}
</button>
);
};
RejectButton.propTypes = {
active: PropTypes.bool,
minimal: PropTypes.bool,
onClick: PropTypes.func,
};
export default RejectButton;
+18 -2
View File
@@ -2,17 +2,25 @@ import React from 'react';
import TagsInput from 'react-tagsinput';
import styles from './TagsInput.css';
import AutosizeInput from 'react-input-autosize';
import PropTypes from 'prop-types';
import cn from 'classnames';
const autosizingRenderInput = ({onChange, value, addTag: _, ...other}) =>
<AutosizeInput type='text' onChange={onChange} value={value} {...other} />;
export default (props) => {
autosizingRenderInput.propTypes = {
onChange: PropTypes.func,
value: PropTypes.string,
addTag: PropTypes.func,
};
const TagsInputComponent = ({className = '', ...props}) => {
return (
<TagsInput
addOnBlur={true}
addOnPaste={true}
pasteSplit={(data) => data.split(',').map((d) => d.trim())}
className={styles.root}
className={cn(styles.root, 'tags-input', className)}
focusedClassName={styles.rootFocus}
renderInput={autosizingRenderInput}
{...props}
@@ -29,3 +37,11 @@ export default (props) => {
/>
);
};
TagsInputComponent.propTypes = {
className: PropTypes.string,
inputProps: PropTypes.object,
tagProps: PropTypes.object,
};
export default TagsInputComponent;
@@ -39,7 +39,8 @@
margin-right: 0px;
}
.statItem, .statReportResult {
.statItem,
.statReportResult {
padding: 3px 5px;
background-color: #D8D8D8;
border-radius: 3px;
@@ -48,7 +49,7 @@
font-size: 0.9em;
line-height: normal;
letter-spacing: 0.4px;
min-width: 60px;
min-width: 60px;
}
.statResult {
@@ -94,12 +95,11 @@
}
.commentStatuses {
padding: 10px 0 0 0;
padding: 0 0 0 10px;
margin: 0;
height: 52px;
align-self: center;
list-style: none;
box-sizing: border-box;
li {
display: inline-block;
margin-right: 10px;
@@ -116,11 +116,11 @@
.bulkActionGroup {
height: 52px;
background-color: #efefef;
padding: 0 0 0 10px;
display: flex;
i {
margin-right: 0;
}
.bulkAction {
display: inline-block;
width: 48px;
@@ -128,17 +128,39 @@
transform: scale(.7);
min-width: 0;
}
.bulkAction:last-child {
margin-left: -10px;
}
}
.loadMore > button {
background-color: #696969;
.selectedCommentsInfo {
align-self: center;
font-weight: 500;
margin-left: 15px;
}
.loadMore>button {
background-color: #696969;
&:hover {
background-color: #404040;
color: white;
}
}
.toggleAll {
padding: 0 10px 0 0;
align-self: center;
}
.commentList {
clear: both;
}
.bulkActionHeader {
display: flex;
justify-content: space-between;
height: 52px;
&.selected {
background-color: #efefef;
}
}
+90 -58
View File
@@ -2,15 +2,17 @@ import React from 'react';
import PropTypes from 'prop-types';
import Comment from '../containers/UserDetailComment';
import styles from './UserDetail.css';
import {Icon, Button, Drawer, Spinner} from 'coral-ui';
import {Icon, Drawer, Spinner} from 'coral-ui';
import {Slot} from 'coral-framework/components';
import ButtonCopyToClipboard from './ButtonCopyToClipboard';
import {actionsMap} from '../utils/moderationQueueActionsMap';
import ClickOutside from 'coral-framework/components/ClickOutside';
import LoadMore from '../components/LoadMore';
import cn from 'classnames';
import capitalize from 'lodash/capitalize';
import {getReliability} from 'coral-framework/utils/user';
import ApproveButton from './ApproveButton';
import RejectButton from './RejectButton';
import {getErrorMessages} from 'coral-framework/utils';
export default class UserDetail extends React.Component {
@@ -18,14 +20,22 @@ export default class UserDetail extends React.Component {
userId: PropTypes.string.isRequired,
hideUserDetail: PropTypes.func.isRequired,
root: PropTypes.object.isRequired,
bannedWords: PropTypes.array.isRequired,
suspectWords: PropTypes.array.isRequired,
acceptComment: PropTypes.func.isRequired,
rejectComment: PropTypes.func.isRequired,
changeStatus: PropTypes.func.isRequired,
toggleSelect: PropTypes.func.isRequired,
bulkAccept: PropTypes.func.isRequired,
bulkReject: PropTypes.func.isRequired,
toggleSelectAll: PropTypes.func.isRequired,
loading: PropTypes.bool.isRequired,
data: PropTypes.shape({
refetch: PropTypes.func.isRequired,
}),
activeTab: PropTypes.string.isRequired,
selectedCommentIds: PropTypes.array.isRequired,
viewUserDetail: PropTypes.any.isRequired,
loadMore: PropTypes.any.isRequired,
notify: PropTypes.func.isRequired
}
rejectThenReload = async (info) => {
@@ -34,8 +44,8 @@ export default class UserDetail extends React.Component {
this.props.data.refetch();
} catch (err) {
// TODO: handle error.
console.error(err);
this.props.notify('error', getErrorMessages(err));
}
}
@@ -45,8 +55,30 @@ export default class UserDetail extends React.Component {
this.props.data.refetch();
} catch (err) {
// TODO: handle error.
console.error(err);
this.props.notify('error', getErrorMessages(err));
}
}
bulkAcceptThenReload = async () => {
try {
await this.props.bulkAccept();
this.props.data.refetch();
} catch (err) {
console.error(err);
this.props.notify('error', getErrorMessages(err));
}
}
bulkRejectThenReload = async () => {
try {
await this.props.bulkReject();
this.props.data.refetch();
} catch (err) {
console.error(err);
this.props.notify('error', getErrorMessages(err));
}
}
@@ -70,6 +102,7 @@ export default class UserDetail extends React.Component {
renderLoaded() {
const {
data,
root,
root: {
user,
@@ -79,14 +112,11 @@ export default class UserDetail extends React.Component {
},
activeTab,
selectedCommentIds,
bannedWords,
suspectWords,
toggleSelect,
bulkAccept,
bulkReject,
hideUserDetail,
viewUserDetail,
loadMore,
toggleSelectAll
} = this.props;
let rejectedPercent = (rejectedComments / totalComments) * 100;
@@ -104,14 +134,14 @@ export default class UserDetail extends React.Component {
<div>
<ul className={styles.userDetailList}>
<li>
<Icon name="assignment_ind"/>
<Icon name="assignment_ind" />
<span className={styles.userDetailItem}>Member Since:</span>
{new Date(user.created_at).toLocaleString()}
</li>
{user.profiles.map(({id}) =>
<li key={id}>
<Icon name="email"/>
<Icon name="email" />
<span className={styles.userDetailItem}>Email:</span>
{id} <ButtonCopyToClipboard className={styles.copyButton} icon="content_copy" copyText={id} />
</li>
@@ -120,24 +150,22 @@ export default class UserDetail extends React.Component {
<ul className={styles.stats}>
<li className={styles.stat}>
<span className={styles.statItem}> Total Comments </span>
<spam className={styles.statResult}> {totalComments} </spam>
<span className={styles.statItem}>Total Comments</span>
<span className={styles.statResult}>{totalComments}</span>
</li>
<li className={styles.stat}>
<spam className={styles.statItem}> Reject Rate </spam>
<spam className={styles.statResult}> {`${(rejectedPercent).toFixed(1)}%`} </spam>
<span className={styles.statItem}>Reject Rate</span>
<span className={styles.statResult}>
{rejectedPercent.toFixed(1)}%
</span>
</li>
<li className={styles.stat}>
<spam className={styles.statItem}> Reports </spam>
<spam className={cn(styles.statReportResult, styles[getReliability(user.reliable.flagger)])}>
<span className={styles.statItem}>Reports</span>
<span className={cn(styles.statReportResult, styles[getReliability(user.reliable.flagger)])}>
{capitalize(getReliability(user.reliable.flagger))}
</spam>
</span>
</li>
</ul>
<p className={styles.small}>
Data represents the last six months of activity
</p>
</div>
<Slot
@@ -145,47 +173,51 @@ export default class UserDetail extends React.Component {
data={this.props.data}
queryData={{root, user}}
/>
<hr/>
{
selectedCommentIds.length === 0
? (
<ul className={styles.commentStatuses}>
<li className={activeTab === 'all' ? styles.active : ''} onClick={this.showAll}>All</li>
<li className={activeTab === 'rejected' ? styles.active : ''} onClick={this.showRejected}>Rejected</li>
</ul>
)
: (
<div className={styles.bulkActionGroup}>
<Button
onClick={bulkAccept}
className={styles.bulkAction}
cStyle='approve'
icon='done'>
</Button>
<Button
onClick={bulkReject}
className={styles.bulkAction}
cStyle='reject'
icon='close'>
</Button>
{`${selectedCommentIds.length} comments selected`}
</div>
)
}
<div>
<hr />
<div className={(selectedCommentIds.length > 0) ? cn(styles.bulkActionHeader, styles.selected) : styles.bulkActionHeader}>
{
selectedCommentIds.length === 0
? (
<ul className={styles.commentStatuses}>
<li className={activeTab === 'all' ? styles.active : ''} onClick={this.showAll}>All</li>
<li className={activeTab === 'rejected' ? styles.active : ''} onClick={this.showRejected}>Rejected</li>
</ul>
)
: (
<div className={styles.bulkActionGroup}>
<ApproveButton
onClick={this.bulkAcceptThenReload}
minimal
/>
<RejectButton
onClick={this.bulkRejectThenReload}
minimal
/>
<span className={styles.selectedCommentsInfo}> {selectedCommentIds.length} comments selected</span>
</div>
)
}
<div className={styles.toggleAll}>
<input
type='checkbox'
id='toogleAll'
checked={selectedCommentIds.length > 0 && selectedCommentIds.length === nodes.length}
onChange={(e) => {
toggleSelectAll(nodes.map((comment) => comment.id), e.target.checked);
}} />
<label htmlFor='toogleAll'>Select all</label>
</div>
</div>
<div className={styles.commentList}>
{
nodes.map((comment) => {
const status = comment.action_summaries ? 'FLAGGED' : comment.status;
const selected = selectedCommentIds.indexOf(comment.id) !== -1;
return <Comment
key={comment.id}
user={user}
root={root}
data={data}
comment={comment}
suspectWords={suspectWords}
bannedWords={bannedWords}
actions={actionsMap[status]}
acceptComment={this.acceptThenReload}
rejectComment={this.rejectThenReload}
selected={selected}
@@ -205,7 +237,7 @@ export default class UserDetail extends React.Component {
);
}
render () {
render() {
if (this.props.loading) {
return this.renderLoading();
}
@@ -1,4 +1,5 @@
.root {
position: relative;
display: block;
margin: 0;
border-bottom: 1px solid #e0e0e0;
@@ -3,37 +3,40 @@ import PropTypes from 'prop-types';
import {Link} from 'react-router';
import {Icon} from 'coral-ui';
import FlagBox from './FlagBox';
import CommentDetails from './CommentDetails';
import styles from './UserDetailComment.css';
import {getActionSummary} from 'coral-framework/utils';
import ActionButton from 'coral-admin/src/components/ActionButton';
import CommentBodyHighlighter from 'coral-admin/src/components/CommentBodyHighlighter';
import IfHasLink from 'coral-admin/src/components/IfHasLink';
import cn from 'classnames';
import CommentAnimatedEdit from './CommentAnimatedEdit';
import CommentLabels from '../containers/CommentLabels';
import ApproveButton from './ApproveButton';
import RejectButton from 'coral-admin/src/components/RejectButton';
import t, {timeago} from 'coral-framework/services/i18n';
class UserDetailComment extends React.Component {
approve = () => (this.props.comment.status === 'ACCEPTED'
? null
: this.props.acceptComment({commentId: this.props.comment.id})
);
reject = () => (this.props.comment.status === 'REJECTED'
? null
: this.props.rejectComment({commentId: this.props.comment.id})
);
render() {
const {
actions = [],
comment,
viewUserDetail,
suspectWords,
bannedWords,
selected,
toggleSelect,
className,
user,
...props
data,
root: {settings: {wordlist: {banned, suspect}}},
} = this.props;
const flagActionSummaries = getActionSummary('FlagActionSummary', comment);
const flagActions = comment.actions && comment.actions.filter((a) => a.__typename === 'FlagAction');
return (
<li
tabIndex={0}
@@ -66,10 +69,10 @@ class UserDetailComment extends React.Component {
</div>
<CommentAnimatedEdit body={comment.body}>
<div className={styles.bodyContainer}>
<p className={styles.body}>
<div className={styles.body}>
<CommentBodyHighlighter
suspectWords={suspectWords}
bannedWords={bannedWords}
suspectWords={suspect}
bannedWords={banned}
body={comment.body}
/>
{' '}
@@ -80,7 +83,7 @@ class UserDetailComment extends React.Component {
>
<Icon name="open_in_new" /> {t('comment.view_context')}
</a>
</p>
</div>
<div className={styles.sideActions}>
<IfHasLink text={comment.body}>
<span className={styles.hasLinks}>
@@ -88,41 +91,26 @@ class UserDetailComment extends React.Component {
</span>
</IfHasLink>
<div className={styles.actions}>
{actions.map((action, i) => {
const active =
(action === 'REJECT' && comment.status === 'REJECTED') ||
(action === 'APPROVE' && comment.status === 'ACCEPTED');
return (
<ActionButton
minimal={true}
key={i}
type={action}
user={user}
status={comment.status}
active={active}
acceptComment={() =>
(comment.status === 'ACCEPTED'
? null
: props.acceptComment({commentId: comment.id}))}
rejectComment={() =>
(comment.status === 'REJECTED'
? null
: props.rejectComment({commentId: comment.id}))}
/>
);
})}
<ApproveButton
active={comment.status === 'ACCEPTED'}
onClick={this.approve}
minimal
/>
<RejectButton
active={comment.status === 'REJECTED'}
onClick={this.reject}
minimal
/>
</div>
</div>
</div>
</CommentAnimatedEdit>
</div>
{flagActions && flagActions.length
? <FlagBox
actions={flagActions}
actionSummaries={flagActionSummaries}
viewUserDetail={viewUserDetail}
/>
: null}
<CommentDetails
data={data}
root={root}
comment={comment}
/>
</li>
);
}
@@ -134,20 +122,27 @@ UserDetailComment.propTypes = {
acceptComment: PropTypes.func.isRequired,
rejectComment: PropTypes.func.isRequired,
className: PropTypes.string,
suspectWords: PropTypes.arrayOf(PropTypes.string).isRequired,
bannedWords: PropTypes.arrayOf(PropTypes.string).isRequired,
toggleSelect: PropTypes.func,
root: PropTypes.shape({
settings: PropTypes.shape({
wordlist: PropTypes.shape({
suspect: PropTypes.arrayOf(PropTypes.string).isRequired,
banned: PropTypes.arrayOf(PropTypes.string).isRequired,
}),
}),
}),
comment: PropTypes.shape({
id: PropTypes.string.isRequired,
status: PropTypes.string.isRequired,
body: PropTypes.string.isRequired,
action_summaries: PropTypes.array,
actions: PropTypes.array,
created_at: PropTypes.string.isRequired,
asset: PropTypes.shape({
title: PropTypes.string,
url: PropTypes.string,
id: PropTypes.string
})
})
}),
}),
};
export default UserDetailComment;
@@ -15,20 +15,25 @@
}
}
.headerWrapper {
background-color: #696969;
}
.header {
background-color: transparent;
box-shadow: none;
min-height: 58px;
display: block;
max-width: 1280px;
margin: 0 auto;
background-color: #696969;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
}
.header > div {
background-color: #696969;
position: relative;
padding: 0;
min-width: 1280px;
max-width: 1280px;
margin: 0 auto;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
height: 58px;
}
+94 -82
View File
@@ -1,4 +1,5 @@
import React from 'react';
import cn from 'classnames';
import PropTypes from 'prop-types';
import {Navigation, Header, IconButton, MenuItem, Menu} from 'react-mdl';
import {Link, IndexLink} from 'react-router';
@@ -6,101 +7,112 @@ import styles from './Header.css';
import t from 'coral-framework/services/i18n';
import {Logo} from './Logo';
import {can} from 'coral-framework/services/perms';
import Indicator from './Indicator';
const CoralHeader = ({
handleLogout,
showShortcuts = () => {},
auth
}) => (
<Header className={styles.header}>
<Logo className={styles.logo} />
<div>
{
auth && auth.user && can(auth.user, 'ACCESS_ADMIN') ?
<Navigation className={styles.nav}>
<IndexLink
id='dashboardNav'
className={styles.navLink}
to="/admin/dashboard"
activeClassName={styles.active}>
{t('configure.dashboard')}
</IndexLink>
{
can(auth.user, 'MODERATE_COMMENTS') && (
<Link
id='moderateNav'
className={styles.navLink}
to="/admin/moderate"
auth,
root
}) => {
return (
<div className={styles.headerWrapper}>
<Header className={styles.header}>
<Logo className={styles.logo} />
<div>
{
auth && auth.user && can(auth.user, 'ACCESS_ADMIN') ?
<Navigation className={styles.nav}>
<IndexLink
id='dashboardNav'
className={cn('talk-admin-nav-dashboard', styles.navLink)}
to="/admin/dashboard"
activeClassName={styles.active}>
{t('configure.moderate')}
</Link>
)
}
<Link
id='streamsNav'
className={styles.navLink}
to="/admin/stories"
activeClassName={styles.active}>
{t('configure.stories')}
</Link>
<Link
id='communityNav'
className={styles.navLink}
to="/admin/community"
activeClassName={styles.active}>
{t('configure.community')}
</Link>
{
can(auth.user, 'UPDATE_CONFIG') && (
{t('configure.dashboard')}
</IndexLink>
{
can(auth.user, 'MODERATE_COMMENTS') && (
<Link
id='moderateNav'
className={cn('talk-admin-nav-moderate', styles.navLink)}
to="/admin/moderate"
activeClassName={styles.active}>
{t('configure.moderate')}
{(root.premodCount !== 0 || root.reportedCount !== 0) && <Indicator />}
</Link>
)
}
<Link
id='configureNav'
className={styles.navLink}
to="/admin/configure"
id='storiesNav'
className={cn('talk-admin-nav-stories', styles.navLink)}
to="/admin/stories"
activeClassName={styles.active}>
{t('configure.configure')}
{t('configure.stories')}
</Link>
)
}
</Navigation>
:
null
}
<div className={styles.rightPanel}>
<ul>
<li className={styles.settings}>
<div>
<IconButton name="settings" id="menu-settings"/>
<Menu target="menu-settings" align="right">
<MenuItem onClick={() => showShortcuts(true)}>{t('configure.shortcuts')}</MenuItem>
<MenuItem>
<a href="https://github.com/coralproject/talk/releases" target="_blank" rel="noopener noreferrer">
View latest version
</a>
</MenuItem>
<MenuItem>
<a href="https://coralproject.net/contribute.html#other-ideas-and-bug-reports" target="_blank" rel="noopener noreferrer">
Report a bug or give feedback
</a>
</MenuItem>
<MenuItem onClick={handleLogout}>
{t('configure.sign_out')}
</MenuItem>
</Menu>
</div>
</li>
<li>
{`v${process.env.VERSION}`}
</li>
</ul>
</div>
<Link
id='communityNav'
className={cn('talk-admin-nav-community', styles.navLink)}
to="/admin/community"
activeClassName={styles.active}>
{t('configure.community')}
{root.flaggedUsernamesCount !== 0 && <Indicator />}
</Link>
{
can(auth.user, 'UPDATE_CONFIG') && (
<Link
id='configureNav'
className={cn('talk-admin-nav-configure', styles.navLink)}
to="/admin/configure"
activeClassName={styles.active}>
{t('configure.configure')}
</Link>
)
}
</Navigation>
:
null
}
<div className={styles.rightPanel}>
<ul>
<li className={styles.settings}>
<div>
<IconButton name="settings" id="menu-settings"/>
<Menu target="menu-settings" align="right">
<MenuItem onClick={() => showShortcuts(true)}>{t('configure.shortcuts')}</MenuItem>
<MenuItem>
<a href="https://github.com/coralproject/talk/releases" target="_blank" rel="noopener noreferrer">
View latest version
</a>
</MenuItem>
<MenuItem>
<a href="https://coralproject.net/contribute.html#other-ideas-and-bug-reports" target="_blank" rel="noopener noreferrer">
Report a bug or give feedback
</a>
</MenuItem>
<MenuItem onClick={handleLogout}>
{t('configure.sign_out')}
</MenuItem>
</Menu>
</div>
</li>
<li>
{`v${process.env.VERSION}`}
</li>
</ul>
</div>
</div>
</Header>
</div>
</Header>
);
);
};
CoralHeader.propTypes = {
auth: PropTypes.object,
showShortcuts: PropTypes.func,
handleLogout: PropTypes.func.isRequired
handleLogout: PropTypes.func.isRequired,
root: PropTypes.object.isRequired
};
export default CoralHeader;
@@ -0,0 +1,10 @@
.indicator {
background-color: #E46D59;
border-radius: 10px;
position: absolute;
top: 50%;
width: 7px;
height: 7px;
margin-top: -4px;
margin-left: 7px;
}
@@ -0,0 +1,7 @@
import React from 'react';
import styles from './Indicator.css';
const Indicator = () =>
<span className={styles.indicator}></span>;
export default Indicator;
@@ -1,5 +1,4 @@
.layout {
max-width: 1280px;
margin: 0 auto;
background-color: #FAFAFA;
margin: 0 auto;
background-color: #FAFAFA;
}
+14 -6
View File
@@ -1,22 +1,28 @@
import React from 'react';
import PropTypes from 'prop-types';
import {Layout as LayoutMDL} from 'react-mdl';
import Header from './Header';
import Drawer from './Drawer';
import Header from '../../containers/Header';
import Drawer from '../Drawer';
import styles from './Layout.css';
const Layout = ({
children,
handleLogout = () => {},
toggleShortcutModal,
toggleShortcutModal = () => {},
restricted = false,
...props}) => (
auth,
}) => (
<LayoutMDL className={styles.layout} fixedDrawer>
<Header
handleLogout={handleLogout}
showShortcuts={toggleShortcutModal}
{...props} />
<Drawer handleLogout={handleLogout} restricted={restricted} {...props} />
auth={auth}
/>
<Drawer
handleLogout={handleLogout}
restricted={restricted}
auth={auth}
/>
<div className={styles.layout}>
{children}
</div>
@@ -24,6 +30,8 @@ const Layout = ({
);
Layout.propTypes = {
children: PropTypes.node,
auth: PropTypes.object,
handleLogout: PropTypes.func,
toggleShortcutModal: PropTypes.func,
restricted: PropTypes.bool // hide elements from a user that's logged out
@@ -20,7 +20,6 @@
background: #696969;
height: 100%;
width: 128px;
z-index: 10;
border-right: 1px #757575 solid;
}
@@ -1,6 +1,7 @@
import React from 'react';
import styles from './Logo.css';
import {CoralLogo} from 'coral-ui';
import PropTypes from 'prop-types';
export const Logo = ({className = ''}) => (
<div className={`${styles.logo} ${className}`}>
@@ -10,3 +11,7 @@ export const Logo = ({className = ''}) => (
</h1>
</div>
);
Logo.propTypes = {
className: PropTypes.string
};
@@ -1,9 +0,0 @@
export const FETCH_ASSETS_REQUEST = 'FETCH_ASSETS_REQUEST';
export const FETCH_ASSETS_SUCCESS = 'FETCH_ASSETS_SUCCESS';
export const FETCH_ASSETS_FAILURE = 'FETCH_ASSETS_FAILURE';
export const UPDATE_ASSET_STATE_REQUEST = 'UPDATE_ASSET_STATE_REQUEST';
export const UPDATE_ASSET_STATE_SUCCESS = 'UPDATE_ASSET_STATE_SUCCESS';
export const UPDATE_ASSET_STATE_FAILURE = 'UPDATE_ASSET_STATE_FAILURE';
export const UPDATE_ASSETS = 'UPDATE_ASSETS';
+19 -14
View File
@@ -1,17 +1,22 @@
export const FETCH_COMMENTERS_REQUEST = 'FETCH_COMMENTERS_REQUEST';
export const FETCH_COMMENTERS_SUCCESS = 'FETCH_COMMENTERS_SUCCESS';
export const FETCH_COMMENTERS_FAILURE = 'FETCH_COMMENTERS_FAILURE';
export const SORT_UPDATE = 'SORT_UPDATE';
export const COMMENTERS_NEW_PAGE = 'COMMENTERS_NEW_PAGE';
export const SET_ROLE = 'SET_ROLE';
export const SET_COMMENTER_STATUS = 'SET_COMMENTER_STATUS';
const prefix = 'COMMUNITY';
export const FETCH_FLAGGED_COMMENTERS_REQUEST = 'FETCH_FLAGGED_COMMENTERS_REQUEST';
export const FETCH_FLAGGED_COMMENTERS_SUCCESS = 'FETCH_FLAGGED_COMMENTERS_SUCCESS';
export const FETCH_FLAGGED_COMMENTERS_FAILURE = 'FETCH_FLAGGED_COMMENTERS_FAILURE';
export const FETCH_USERS_REQUEST = `${prefix}_FETCH_USERS_REQUEST`;
export const FETCH_USERS_SUCCESS = `${prefix}_FETCH_USERS_SUCCESS`;
export const FETCH_USERS_FAILURE = `${prefix}_FETCH_USERS_FAILURE`;
export const SHOW_BANUSER_DIALOG = 'SHOW_BANUSER_DIALOG';
export const HIDE_BANUSER_DIALOG = 'HIDE_BANUSER_DIALOG';
export const SORT_UPDATE = `${prefix}_SORT_UPDATE`;
export const SET_PAGE = `${prefix}_SET_PAGE`;
export const SET_ROLE = `${prefix}_SET_ROLE`;
export const SET_COMMENTER_STATUS = `${prefix}_SET_COMMENTER_STATUS`;
export const SHOW_REJECT_USERNAME_DIALOG = 'SHOW_REJECT_USERNAME_DIALOG';
export const HIDE_REJECT_USERNAME_DIALOG = 'HIDE_REJECT_USERNAME_DIALOG';
export const FETCH_FLAGGED_COMMENTERS_REQUEST = `${prefix}_FETCH_FLAGGED_COMMENTERS_REQUEST`;
export const FETCH_FLAGGED_COMMENTERS_SUCCESS = `${prefix}_FETCH_FLAGGED_COMMENTERS_SUCCESS`;
export const FETCH_FLAGGED_COMMENTERS_FAILURE = `${prefix}_FETCH_FLAGGED_COMMENTERS_FAILURE`;
export const SHOW_BANUSER_DIALOG = `${prefix}_SHOW_BANUSER_DIALOG`;
export const HIDE_BANUSER_DIALOG = `${prefix}_HIDE_BANUSER_DIALOG`;
export const SHOW_REJECT_USERNAME_DIALOG = `${prefix}_SHOW_REJECT_USERNAME_DIALOG`;
export const HIDE_REJECT_USERNAME_DIALOG = `${prefix}_HIDE_REJECT_USERNAME_DIALOG`;
export const SET_SEARCH_VALUE = `${prefix}_SET_SEARCH_VALUE`;
@@ -0,0 +1,5 @@
const prefix = 'TALK_ADMIN_CONFIGURE';
export const UPDATE_PENDING = `${prefix}_UPDATE_PENDING`;
export const CLEAR_PENDING = `${prefix}_CLEAR_PENDING`;
export const SET_ACTIVE_SECTION = `${prefix}_SET_ACTIVE_SECTION`;
@@ -0,0 +1,15 @@
const prefix = 'STORIES';
export const FETCH_ASSETS_REQUEST = `${prefix}_FETCH_ASSETS_REQUEST`;
export const FETCH_ASSETS_SUCCESS = `${prefix}_FETCH_ASSETS_SUCCESS`;
export const FETCH_ASSETS_FAILURE = `${prefix}_FETCH_ASSETS_FAILURE`;
export const UPDATE_ASSET_STATE_REQUEST = `${prefix}_UPDATE_ASSET_STATE_REQUEST`;
export const UPDATE_ASSET_STATE_SUCCESS = `${prefix}_UPDATE_ASSET_STATE_SUCCESS`;
export const UPDATE_ASSET_STATE_FAILURE = `${prefix}_UPDATE_ASSET_STATE_FAILURE`;
export const UPDATE_ASSETS = `${prefix}_UPDATE_ASSETS`;
export const SET_PAGE = `${prefix}_SET_PAGE`;
export const SET_SEARCH_VALUE = `${prefix}_SET_SEARCH_VALUE`;
export const SET_CRITERIA = `${prefix}_SET_CRITERIA`;
@@ -4,4 +4,4 @@ export const CHANGE_USER_DETAIL_STATUSES = 'CHANGE_USER_DETAIL_STATUSES';
export const SELECT_USER_DETAIL_COMMENT = 'SELECT_USER_DETAIL_COMMENT';
export const UNSELECT_USER_DETAIL_COMMENT = 'UNSELECT_USER_DETAIL_COMMENT';
export const CLEAR_USER_DETAIL_SELECTIONS = 'CLEAR_USER_DETAIL_SELECTIONS';
export const SELECT_ALL_USER_DETAIL_COMMENT = 'SELECT_ALL_USER_DETAIL_COMMENT';
@@ -0,0 +1,24 @@
import {gql} from 'react-apollo';
import CommentDetails from '../components/CommentDetails';
import {getSlotFragmentSpreads} from 'coral-framework/utils';
import withFragments from 'coral-framework/hocs/withFragments';
const slots = [
'adminCommentDetailArea',
'adminCommentMoreDetails',
];
export default withFragments({
root: gql`
fragment CoralAdmin_CommentDetails_root on RootQuery {
__typename
${getSlotFragmentSpreads(slots, 'root')}
}
`,
comment: gql`
fragment CoralAdmin_CommentDetails_comment on Comment {
__typename
${getSlotFragmentSpreads(slots, 'comment')}
}
`
})(CommentDetails);
@@ -8,6 +8,12 @@ const slots = [
];
export default withFragments({
root: gql`
fragment CoralAdmin_CommentLabels_root on RootQuery {
__typename
${getSlotFragmentSpreads(slots, 'root')}
}
`,
comment: gql`
fragment CoralAdmin_CommentLabels_comment on Comment {
hasParent
@@ -0,0 +1,24 @@
import {gql} from 'react-apollo';
import withQuery from 'coral-framework/hocs/withQuery';
import Header from '../components/ui/Header';
export default withQuery(gql`
query TalkAdmin_Header {
__typename
premodCount: commentCount(query: {
statuses: [PREMOD]
})
reportedCount: commentCount(query: {
statuses: [NONE, PREMOD, SYSTEM_WITHHELD],
action_type: FLAG
})
flaggedUsernamesCount: userCount(query: {
action_type: FLAG,
statuses: [PENDING]
})
}
`, {
options: {
pollInterval: 5000
}
})(Header);
+38 -18
View File
@@ -1,5 +1,6 @@
import React, {Component} from 'react';
import React from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import Layout from '../components/ui/Layout';
import {fetchConfig} from '../actions/config';
import AdminLogin from '../components/AdminLogin';
@@ -10,15 +11,18 @@ import {toggleModal as toggleShortcutModal} from '../actions/moderation';
import {checkLogin, handleLogin, requestPasswordReset, logout} from '../actions/auth';
import {can} from 'coral-framework/services/perms';
import UserDetail from 'coral-admin/src/containers/UserDetail';
import PropTypes from 'prop-types';
class LayoutContainer extends Component {
class LayoutContainer extends React.Component {
componentWillMount() {
const {checkLogin, fetchConfig} = this.props;
checkLogin();
fetchConfig();
}
render() {
const {
user,
loggedIn,
@@ -29,13 +33,16 @@ class LayoutContainer extends Component {
} = this.props.auth;
const {
handleLogout,
children,
logout,
toggleShortcutModal,
TALK_RECAPTCHA_PUBLIC
TALK_RECAPTCHA_PUBLIC,
} = this.props;
if (loadingUser) {
return <FullLoading />;
}
if (!loggedIn) {
return (
<AdminLogin
@@ -48,17 +55,17 @@ class LayoutContainer extends Component {
/>
);
}
if (can(user, 'ACCESS_ADMIN') && loggedIn) {
return (
<Layout
handleLogout={handleLogout}
handleLogout={logout}
toggleShortcutModal={toggleShortcutModal}
{...this.props}
>
auth={this.props.auth} >
<BanUserDialog />
<SuspendUserDialog />
<UserDetail />
{this.props.children}
{children}
</Layout>
);
} else if (loggedIn) {
@@ -72,19 +79,32 @@ class LayoutContainer extends Component {
}
}
LayoutContainer.propTypes = {
children: PropTypes.node,
requestPasswordReset: PropTypes.func,
handleLogin: PropTypes.func,
auth: PropTypes.object,
handleLogout: PropTypes.func,
logout: PropTypes.func,
toggleShortcutModal: PropTypes.func,
TALK_RECAPTCHA_PUBLIC: PropTypes.string,
checkLogin: PropTypes.func,
fetchConfig: PropTypes.func
};
const mapStateToProps = (state) => ({
auth: state.auth,
TALK_RECAPTCHA_PUBLIC: state.config.data.TALK_RECAPTCHA_PUBLIC,
});
const mapDispatchToProps = (dispatch) => ({
checkLogin: () => dispatch(checkLogin()),
fetchConfig: () => dispatch(fetchConfig()),
handleLogin: (username, password, recaptchaResponse) =>
dispatch(handleLogin(username, password, recaptchaResponse)),
requestPasswordReset: (email) => dispatch(requestPasswordReset(email)),
toggleShortcutModal: (toggle) => dispatch(toggleShortcutModal(toggle)),
handleLogout: () => dispatch(logout())
});
const mapDispatchToProps = (dispatch) =>
bindActionCreators({
checkLogin,
fetchConfig,
handleLogin,
requestPasswordReset,
toggleShortcutModal,
logout
}, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(LayoutContainer);
+14 -14
View File
@@ -11,10 +11,12 @@ import {
changeUserDetailStatuses,
clearUserDetailSelections,
toggleSelectCommentInUserDetail,
toggleSelectAllCommentInUserDetail
} from 'coral-admin/src/actions/userDetail';
import {withSetCommentStatus} from 'coral-framework/graphql/mutations';
import UserDetailComment from './UserDetailComment';
import update from 'immutability-helper';
import {notify} from 'coral-framework/actions/notification';
const commentConnectionFragment = gql`
fragment CoralAdmin_Moderation_CommentConnection on CommentConnection {
@@ -41,22 +43,16 @@ class UserDetailContainer extends React.Component {
return this.props.setCommentStatus({commentId, status});
});
try {
await Promise.all(changes);
this.props.clearUserDetailSelections(); // un-select everything
} catch (err) {
// TODO: handle error.
console.error(err);
}
await Promise.all(changes);
this.props.clearUserDetailSelections(); // un-select everything
}
bulkReject = () => {
this.bulkSetCommentStatus('REJECTED');
return this.bulkSetCommentStatus('REJECTED');
}
bulkAccept = () => {
this.bulkSetCommentStatus('ACCEPTED');
return this.bulkSetCommentStatus('ACCEPTED');
}
acceptComment = ({commentId}) => {
@@ -120,6 +116,7 @@ class UserDetailContainer extends React.Component {
bulkAccept={this.bulkAccept}
changeStatus={this.props.changeUserDetailStatuses}
toggleSelect={this.props.toggleSelectCommentInUserDetail}
toggleSelectAll={this.props.toggleSelectAllCommentInUserDetail}
acceptComment={this.acceptComment}
rejectComment={this.rejectComment}
loading={loading}
@@ -152,7 +149,7 @@ export const withUserDetailQuery = withQuery(gql`
}
${getSlotFragmentSpreads(slots, 'user')}
}
totalComments: commentCount(query: {author_id: $author_id})
totalComments: commentCount(query: {author_id: $author_id, statuses: []})
rejectedComments: commentCount(query: {author_id: $author_id, statuses: [REJECTED]})
comments: comments(query: {
author_id: $author_id,
@@ -160,13 +157,16 @@ export const withUserDetailQuery = withQuery(gql`
}) {
...CoralAdmin_Moderation_CommentConnection
}
...${getDefinitionName(UserDetailComment.fragments.root)}
${getSlotFragmentSpreads(slots, 'root')}
}
${UserDetailComment.fragments.root}
${commentConnectionFragment}
`, {
options: ({userId, statuses}) => {
return {
variables: {author_id: userId, statuses}
variables: {author_id: userId, statuses},
fetchPolicy: 'network-only',
};
},
skip: (ownProps) => !ownProps.userId,
@@ -177,8 +177,6 @@ const mapStateToProps = (state) => ({
selectedCommentIds: state.userDetail.selectedCommentIds,
statuses: state.userDetail.statuses,
activeTab: state.userDetail.activeTab,
bannedWords: state.settings.wordlist.banned,
suspectWords: state.settings.wordlist.suspect,
});
const mapDispatchToProps = (dispatch) => ({
@@ -188,6 +186,8 @@ const mapDispatchToProps = (dispatch) => ({
toggleSelectCommentInUserDetail,
viewUserDetail,
hideUserDetail,
toggleSelectAllCommentInUserDetail,
notify
}, dispatch)
});
@@ -3,10 +3,25 @@ import UserDetailComment from '../components/UserDetailComment';
import withFragments from 'coral-framework/hocs/withFragments';
import {getDefinitionName} from 'coral-framework/utils';
import CommentLabels from './CommentLabels';
import CommentDetails from './CommentDetails';
export default withFragments({
root: gql`
fragment CoralAdmin_UserDetailComment_root on RootQuery {
settings {
wordlist {
banned
suspect
}
}
...${getDefinitionName(CommentLabels.fragments.root)}
...${getDefinitionName(CommentDetails.fragments.root)}
}
${CommentLabels.fragments.root}
${CommentDetails.fragments.root}
`,
comment: gql`
fragment CoralAdmin_UserDetail_comment on Comment {
fragment CoralAdmin_UserDetailComment_comment on Comment {
id
body
created_at
@@ -17,28 +32,13 @@ export default withFragments({
title
url
}
action_summaries {
count
... on FlagActionSummary {
reason
}
}
actions {
... on FlagAction {
id
reason
message
user {
id
username
}
}
}
editing {
edited
}
...${getDefinitionName(CommentLabels.fragments.comment)}
...${getDefinitionName(CommentDetails.fragments.comment)}
}
${CommentLabels.fragments.comment}
${CommentDetails.fragments.comment}
`
})(UserDetailComment);
+23 -2
View File
@@ -1,10 +1,21 @@
import update from 'immutability-helper';
import mapValues from 'lodash/mapValues';
// Map nested object leaves. Array objects are considered leaves.
function mapLeaves(o, mapper) {
return mapValues(o, (val) => {
if (typeof val === 'object' && !Array.isArray(val)) {
return mapLeaves(val, mapper);
}
return mapper(val);
});
}
export default {
mutations: {
SetUserStatus: ({variables: {status, userId}}) => ({
updateQueries: {
TalkAdmin_FlaggedAccounts: (prev) => {
TalkAdmin_Community: (prev) => {
if (status !== 'APPROVED') {
return prev;
}
@@ -19,7 +30,7 @@ export default {
}),
RejectUsername: ({variables: {input: {id: userId}}}) => ({
updateQueries: {
TalkAdmin_FlaggedAccounts: (prev) => {
TalkAdmin_Community: (prev) => {
const updated = update(prev, {
users: {
nodes: {$apply: (nodes) => nodes.filter((node) => node.id !== userId)},
@@ -29,6 +40,16 @@ export default {
}
}
}),
UpdateSettings: ({variables: {input}}) => ({
updateQueries: {
TalkAdmin_Configure: (prev) => {
const updated = update(prev, {
settings: mapLeaves(input, (leaf) => ({$set: leaf})),
});
return updated;
}
}
}),
},
};
+1
View File
@@ -23,6 +23,7 @@ function init({store, storage}) {
async function main() {
const notification = createNotificationService(toast);
const context = await createContext({reducers, graphqlExtension, pluginsConfig, notification, init});
render(
<TalkProvider {...context}>
<App />
-40
View File
@@ -1,40 +0,0 @@
import * as actions from '../constants/assets';
import update from 'immutability-helper';
const initialState = {
byId: {},
ids: [],
assets: []
};
export default function assets (state = initialState, action) {
switch (action.type) {
case actions.FETCH_ASSETS_SUCCESS: {
const assets = action.assets.reduce((prev, curr) => {
prev[curr.id] = curr;
return prev;
}, {});
return update(state, {
byId: {$set: assets},
count: {$set: action.count},
ids: {$set: Object.keys(assets)},
});
}
case actions.UPDATE_ASSET_STATE_REQUEST:
return update(state, {
byId: {
[action.id]: {
closedAt: {$set: action.closedAt},
},
},
});
case actions.UPDATE_ASSETS:
return update(state, {
assets: {$set: action.assets},
});
default:
return state;
}
}
+26 -13
View File
@@ -1,8 +1,10 @@
import {
FETCH_COMMENTERS_REQUEST,
FETCH_COMMENTERS_FAILURE,
FETCH_COMMENTERS_SUCCESS,
FETCH_USERS_REQUEST,
FETCH_USERS_SUCCESS,
FETCH_USERS_FAILURE,
SORT_UPDATE,
SET_PAGE,
SET_SEARCH_VALUE,
SET_ROLE,
SET_COMMENTER_STATUS,
SHOW_BANUSER_DIALOG,
@@ -15,7 +17,8 @@ const initialState = {
community: {},
isFetchingPeople: false,
errorPeople: '',
accounts: [],
users: [],
searchValue: '',
fieldPeople: 'created_at',
ascPeople: false,
totalPagesPeople: 0,
@@ -27,19 +30,19 @@ const initialState = {
export default function community (state = initialState, action) {
switch (action.type) {
case FETCH_COMMENTERS_REQUEST :
case FETCH_USERS_REQUEST :
return {
...state,
isFetchingPeople: true,
};
case FETCH_COMMENTERS_FAILURE :
case FETCH_USERS_FAILURE :
return {
...state,
isFetchingPeople: false,
errorPeople: action.error,
};
case FETCH_COMMENTERS_SUCCESS : {
const {accounts, type, page, count, limit, totalPages, ...rest} = action; // eslint-disable-line
case FETCH_USERS_SUCCESS : {
const {users, type, page, count, limit, totalPages, ...rest} = action; // eslint-disable-line
return {
...state,
isFetchingPeople: false,
@@ -49,27 +52,32 @@ export default function community (state = initialState, action) {
limitPeople: limit,
totalPagesPeople: totalPages,
...rest,
accounts, // Sets to normal array
users, // Sets to normal array
};
}
case SET_PAGE:
return {
...state,
pagePeople: action.page,
};
case SET_ROLE : {
const commenters = state.accounts;
const commenters = state.users;
const idx = commenters.findIndex((el) => el.id === action.id);
commenters[idx].roles[0] = action.role;
return {
...state,
accounts: commenters.map((id) => id),
users: commenters.map((id) => id),
};
}
case SET_COMMENTER_STATUS: {
const commenters = state.accounts;
const commenters = state.users;
const idx = commenters.findIndex((el) => el.id === action.id);
commenters[idx].status = action.status;
return {
...state,
accounts: commenters.map((id) => id),
users: commenters.map((id) => id),
};
}
@@ -101,6 +109,11 @@ export default function community (state = initialState, action) {
user: action.user,
rejectUsernameDialog: true
};
case SET_SEARCH_VALUE:
return {
...state,
searchValue: action.value,
};
default :
return state;
}
@@ -0,0 +1,47 @@
import * as actions from '../constants/configure';
import isEmpty from 'lodash/isEmpty';
import update from 'immutability-helper';
const initialState = {
canSave: false,
pending: {},
errors: {},
activeSection: 'stream',
};
export default function configure(state = initialState, action) {
switch (action.type) {
case actions.UPDATE_PENDING: {
let next = state;
if (action.updater) {
next = update(next, {
pending: action.updater,
});
}
if (action.errorUpdater) {
next = update(next, {
errors: action.errorUpdater,
});
}
const noErrors = Object.keys(next.errors).reduce((res, error) => res && !next.errors[error], true);
const canSave = !isEmpty(next.pending) && noErrors;
next = update(next, {
canSave: {$set: canSave},
});
return next;
}
case actions.CLEAR_PENDING:
return {
...state,
pending: {},
canSave: false,
};
case actions.SET_ACTIVE_SECTION:
return {
...state,
activeSection: action.section,
};
}
return state;
}
@@ -0,0 +1,15 @@
// this is initialized here because
// currently you have to reload the dashboard to get new stats
// cleaner updates are planned in the future.
const DASHBOARD_WINDOW_MINUTES = 5;
let then = new Date();
then.setMinutes(then.getMinutes() - DASHBOARD_WINDOW_MINUTES);
const initialState = {
windowStart: then.toISOString(),
windowEnd: new Date().toISOString(),
};
export default function dashboard (state = initialState, _action) {
return state;
}
+6 -4
View File
@@ -1,6 +1,7 @@
import auth from './auth';
import assets from './assets';
import settings from './settings';
import stories from './stories';
import dashboard from './dashboard';
import configure from './configure';
import community from './community';
import moderation from './moderation';
import install from './install';
@@ -12,10 +13,11 @@ import userDetail from './userDetail';
export default {
auth,
banUserDialog,
dashboard,
configure,
suspendUserDialog,
userDetail,
assets,
settings,
stories,
community,
moderation,
install,
@@ -1,92 +0,0 @@
import * as actions from '../actions/settings';
import update from 'immutability-helper';
// this is initialized here because
// currently you have to reload the dashboard to get new stats
// cleaner updates are planned in the future.
// TODO: if there are more than two fields for the dashboard being created here,
// please create a new reducer specifically for the Dashboard.
const DASHBOARD_WINDOW_MINUTES = 5;
let then = new Date();
then.setMinutes(then.getMinutes() - DASHBOARD_WINDOW_MINUTES);
const initialState = {
wordlist: {
banned: [],
suspect: []
},
dashboardWindowStart: then.toISOString(),
dashboardWindowEnd: new Date().toISOString(),
domains: {
whitelist: []
},
saveSettingsError: null,
fetchSettingsError: null,
fetchingSettings: false
};
export default function settings (state = initialState, action) {
switch (action.type) {
case actions.SETTINGS_LOADING:
return {
...state,
fetchingSettings: true,
fetchSettingsError: null,
};
case actions.SETTINGS_RECEIVED:
return {
...state,
fetchingSettings: false,
fetchSettingsError: null,
...action.settings
};
case actions.SETTINGS_FETCH_ERROR:
return {
...state,
fetchingSettings: false,
fetchSettingsError: action.error,
};
case actions.SETTINGS_UPDATED:
return {
...state,
fetchingSettings: false,
fetchSettingsError: null,
...action.settings
};
case actions.SAVE_SETTINGS_LOADING:
return {
...state,
fetchingSettings: true,
saveSettingsError: null,
};
case actions.SAVE_SETTINGS_SUCCESS:
return {
...state,
fetchingSettings: false,
fetchSettingsError: null,
...action.settings
};
case actions.SAVE_SETTINGS_FAILED:
return {
...state,
fetchingSettings: false,
fetchSettingsError: action.error,
};
case actions.WORDLIST_UPDATED:
return update(state, {
wordlist: {
[action.listName]: {
$set: action.list
}
}
});
case actions.DOMAINLIST_UPDATED:
return update(state, {
domains: {
[action.listName]: {$set: action.list},
}
});
default:
return state;
}
}
@@ -0,0 +1,73 @@
import * as actions from '../constants/stories';
import update from 'immutability-helper';
const initialState = {
assets: {
byId: {},
ids: [],
assets: []
},
searchValue: '',
criteria: {
asc: 'false',
filter: 'all',
},
};
export default function assets (state = initialState, action) {
switch (action.type) {
case actions.FETCH_ASSETS_SUCCESS: {
const assets = action.assets.reduce((prev, curr) => {
prev[curr.id] = curr;
return prev;
}, {});
return update(state, {
assets: {
totalPages: {$set: action.totalPages},
page: {$set: action.page},
byId: {$set: assets},
count: {$set: action.count},
ids: {$set: Object.keys(assets)},
},
});
}
case actions.UPDATE_ASSET_STATE_REQUEST:
return update(state, {
assets: {
byId: {
[action.id]: {
closedAt: {$set: action.closedAt},
},
},
},
});
case actions.UPDATE_ASSETS:
return update(state, {
assets: {
assets: {$set: action.assets},
},
});
case actions.SET_PAGE:
return {
...state,
page: action.page,
};
case actions.SET_SEARCH_VALUE:
return {
...state,
searchValue: action.value,
};
case actions.SET_CRITERIA:
return {
...state,
criteria: {
...state.criteria,
...action.criteria,
},
};
default:
return state;
}
}
@@ -3,7 +3,7 @@ import * as actions from '../constants/userDetail';
const initialState = {
userId: null,
activeTab: 'all',
statuses: [],
statuses: null,
selectedCommentIds: [],
};
@@ -41,6 +41,11 @@ export default function banUserDialog(state = initialState, action) {
...state,
selectedCommentIds: state.selectedCommentIds.filter((id) => id !== action.id),
};
case actions.SELECT_ALL_USER_DETAIL_COMMENT:
return {
...state,
selectedCommentIds: action.ids
};
default:
return state;
}
@@ -1,4 +0,0 @@
.actionButton {
transform: scale(.8);
margin: 0;
}
@@ -1,22 +0,0 @@
import React from 'react';
import styles from './ActionButton.css';
import {Button} from 'coral-ui';
import {menuActionsMap} from '../../../utils/moderationQueueActionsMap';
import t from 'coral-framework/services/i18n';
// TODO: Needs refactoring.
const ActionButton = ({type = '', user, ...props}) => {
return (
<Button
className={`${type.toLowerCase()} ${styles.actionButton}`}
cStyle={type.toLowerCase()}
icon={menuActionsMap[type].icon}
onClick={() => {
type === 'APPROVE' ? props.approveUser({userId: user.id}) : props.showRejectUsernameDialog({user: user});
}}
>{t(`modqueue.${menuActionsMap[type].text}`)}</Button>
);
};
export default ActionButton;
@@ -0,0 +1,4 @@
.container {
max-width: 1280px;
margin: 0 auto;
}
@@ -1,78 +1,18 @@
import React, {Component} from 'react';
import CommunityMenu from './CommunityMenu';
import People from './People';
import FlaggedAccounts from '../containers/FlaggedAccounts';
import RejectUsernameDialog from './RejectUsernameDialog';
import PropTypes from 'prop-types';
import styles from './Community.css';
import People from '../containers/People';
import CommunityMenu from './CommunityMenu';
import RejectUsernameDialog from './RejectUsernameDialog';
import FlaggedAccounts from '../containers/FlaggedAccounts';
export default class Community extends Component {
state = {
searchValue: '',
timer: null
};
onKeyDownHandler = (e) => {
if (e.key === 'Enter') {
e.preventDefault();
this.search();
}
}
onSearchChange = (e) => {
const value = e.target.value;
this.setState((prevState) => {
prevState.searchValue = value;
clearTimeout(prevState.timer);
const fetchAccounts = this.props.fetchAccounts;
prevState.timer = setTimeout(() => {
fetchAccounts({value});
}, 350);
return prevState;
});
}
onHeaderClickHandler = (sort) => {
this.props.updateSorting(sort);
this.search();
}
onNewPageHandler = (page) => {
this.props.newPage(page);
this.search({page});
}
search(query = {}) {
const {community} = this.props;
this.props.fetchAccounts({
value: this.state.searchValue,
field: community.fieldPeople,
asc: community.ascPeople,
...query
});
}
getTabContent(searchValue, props) {
const {community} = props;
const activeTab = props.route.path === ':id' ? 'flagged' : props.route.path;
class Community extends Component {
renderTab() {
const {route, community, ...props} = this.props;
const activeTab = route.path === ':id' ? 'flagged' : route.path;
if (activeTab === 'people') {
return (
<People
isFetching={community.isFetchingPeople}
commenters={community.accounts}
searchValue={searchValue}
onSearchChange={this.onSearchChange}
error={community.errorPeople}
totalPages={community.totalPagesPeople}
page={community.pagePeople}
onKeyDown={this.onKeyDownHandler}
onHeaderClickHandler={this.onHeaderClickHandler}
onNewPageHandler={this.onNewPageHandler}
/>
);
return <People community={community} />;
}
return (
@@ -82,37 +22,36 @@ export default class Community extends Component {
root={this.props.root}
/>
<RejectUsernameDialog
open={community.rejectUsernameDialog}
handleClose={props.hideRejectUsernameDialog}
user={community.user}
open={community.rejectUsernameDialog}
rejectUsername={props.rejectUsername}
handleClose={props.hideRejectUsernameDialog}
/>
</div>
);
}
render() {
const {searchValue} = this.state;
const tab = this.getTabContent(searchValue, this.props);
const {root: {flaggedUsernamesCount}} = this.props;
return (
<div>
<div className="talk-admin-community">
<CommunityMenu flaggedUsernamesCount={flaggedUsernamesCount} />
<div>{tab}</div>
<div className={styles.container}>
{this.renderTab()}
</div>
</div>
);
}
}
Community.propTypes = {
community: PropTypes.object,
fetchAccounts: PropTypes.func,
hideRejectUsernameDialog: PropTypes.func,
updateSorting: PropTypes.func,
newPage: PropTypes.func,
route: PropTypes.object,
rejectUsername: PropTypes.func,
community: PropTypes.object,
rejectUsername: PropTypes.func.isRequired,
hideRejectUsernameDialog: PropTypes.func.isRequired,
data: PropTypes.object,
root: PropTypes.object
root: PropTypes.object,
};
export default Community;
@@ -1,9 +0,0 @@
import React from 'react';
const CommunityLayout = (props) => (
<div>
{props.children}
</div>
);
export default CommunityLayout;
@@ -2,6 +2,8 @@
padding: 10px;
display: flex;
padding-bottom: 200px;
max-width: 1280px;
margin: 0 auto;
}
.mainFlaggedContent {
@@ -47,7 +47,6 @@ class FlaggedAccounts extends React.Component {
<FlaggedUser
user={user}
key={user.id}
modActionButtons={['APPROVE', 'REJECT']}
showBanUserDialog={showBanUserDialog}
showSuspendUserDialog={showSuspendUserDialog}
showRejectUsernameDialog={showRejectUsernameDialog}
@@ -1,13 +1,13 @@
import React from 'react';
import styles from './FlaggedUser.css';
import ActionButton from './ActionButton';
// TODO: Should not rely on plugin.
import {username} from 'talk-plugin-flags/helpers/flagReasons';
import ActionsMenu from 'coral-admin/src/components/ActionsMenu';
import ActionsMenuItem from 'coral-admin/src/components/ActionsMenuItem';
import ApproveButton from 'coral-admin/src/components/ApproveButton';
import RejectButton from 'coral-admin/src/components/RejectButton';
import cn from 'classnames';
import t from 'coral-framework/services/i18n';
@@ -35,15 +35,16 @@ class User extends React.Component {
});
viewAuthorDetail = () => this.props.viewUserDetail(this.props.user.id);
showRejectUsernameDialog = () => this.props.showRejectUsernameDialog({id: this.props.user.id});
approveUser = () => this.props.approveUser({
userId: this.props.user.id,
});
render() {
const {
user,
modActionButtons,
viewUserDetail,
selected,
approveUser,
showRejectUsernameDialog,
me,
className,
} = this.props;
@@ -125,14 +126,12 @@ class User extends React.Component {
</div>
<div className={styles.sideActions}>
<div className={styles.actions}>
{modActionButtons.map((action, i) =>
<ActionButton key={i}
type={action.toUpperCase()}
user={user}
approveUser={approveUser}
showRejectUsernameDialog={showRejectUsernameDialog}
/>
)}
<ApproveButton
onClick={this.approveUser}
/>
<RejectButton
onClick={this.showRejectUsernameDialog}
/>
</div>
</div>
</div>
@@ -1,32 +1,28 @@
import React from 'react';
import styles from './styles.css';
import Table from '../containers/Table';
import {Pager, Icon} from 'coral-ui';
import Table from './Table';
import {Icon} from 'coral-ui';
import EmptyCard from '../../../components/EmptyCard';
import t from 'coral-framework/services/i18n';
const tableHeaders = [
{
title: t('community.username_and_email'),
field: 'username'
},
{
title: t('community.account_creation_date'),
field: 'created_at'
},
{
title: t('community.status'),
field: 'status'
},
{
title: t('community.newsroom_role'),
field: 'role'
}
];
import PropTypes from 'prop-types';
const People = (props) => {
const {
users = [],
searchValue,
onSearchChange,
onHeaderClickHandler,
onPageChange,
totalPages,
page,
setRole,
setCommenterStatus,
viewUserDetail,
} = props;
const hasResults = !!users.length;
const People = ({commenters, searchValue, onSearchChange, ...props}) => {
const hasResults = !!commenters.length;
return (
<div className={styles.container}>
<div className={styles.leftColumn}>
@@ -46,20 +42,33 @@ const People = ({commenters, searchValue, onSearchChange, ...props}) => {
{
hasResults
? <Table
headers={tableHeaders}
commenters={commenters}
onHeaderClickHandler={props.onHeaderClickHandler}
users={users}
setRole={setRole}
viewUserDetail={viewUserDetail}
setCommenterStatus={setCommenterStatus}
onHeaderClickHandler={onHeaderClickHandler}
pageCount={totalPages}
onPageChange={onPageChange}
page={page}
/>
: <EmptyCard>{t('community.no_results')}</EmptyCard>
}
<Pager
totalPages={props.totalPages}
page={props.page}
onNewPageHandler={props.onNewPageHandler}
/>
</div>
</div>
);
};
People.propTypes = {
onHeaderClickHandler: PropTypes.func,
users: PropTypes.array,
page: PropTypes.number.isRequired,
searchValue: PropTypes.string,
onSearchChange: PropTypes.func,
totalPages: PropTypes.number,
onPageChange: PropTypes.func,
setCommenterStatus: PropTypes.func.isRequired,
setRole: PropTypes.func.isRequired,
viewUserDetail: PropTypes.func.isRequired,
};
export default People;
@@ -51,7 +51,7 @@ class RejectUsernameDialog extends Component {
const next = () => this.setState({stage: stage + 1});
const suspend = async () => {
try {
await rejectUsername({id: user.user.id, message: this.state.email});
await rejectUsername({id: user.id, message: this.state.email});
this.props.handleClose();
} catch (err) {
@@ -2,14 +2,18 @@
width: 100%;
border-left: none;
border-right: none;
}
th {
font-size: 1.1em;
}
th.header {
font-size: 1.1em;
}
th:nth-child(2), th:nth-child(3) {
width: 100px;
}
th.header:hover {
cursor: pointer;
}
th.header:nth-child(2), th.header:nth-child(3) {
width: 100px;
}
.button {
@@ -19,6 +23,13 @@
}
}
.username, .email {
max-width: 215px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.email {
display: block;
}
@@ -1,56 +1,96 @@
import React from 'react';
import {SelectField, Option} from 'react-mdl-selectfield';
import styles from '../components/Table.css';
import styles from './Table.css';
import t from 'coral-framework/services/i18n';
import PropTypes from 'prop-types';
import {Paginate, Dropdown, Option} from 'coral-ui';
import cn from 'classnames';
export default ({headers, commenters, onHeaderClickHandler, onRoleChange, onCommenterStatusChange, viewUserDetail}) => (
<table className={`mdl-data-table ${styles.dataTable}`}>
<thead>
<tr>
{headers.map((header, i) =>(
<th
key={i}
className="mdl-data-table__cell--non-numeric"
onClick={() => onHeaderClickHandler({field: header.field})}>
{header.title}
</th>
))}
</tr>
</thead>
<tbody>
{commenters.map((row, i)=> (
<tr key={i}>
<td className="mdl-data-table__cell--non-numeric">
<button onClick={() => {viewUserDetail(row.id);}} className={styles.button}>{row.username}</button>
<span className={styles.email}>{row.profiles.map(({id}) => id)}</span>
</td>
<td className="mdl-data-table__cell--non-numeric">
{row.created_at}
</td>
<td className="mdl-data-table__cell--non-numeric">
<SelectField
value={row.status || ''}
className={styles.selectField}
label={t('community.status')}
onChange={(status) => onCommenterStatusChange(row.id, status)}>
<Option value={'ACTIVE'}>{t('community.active')}</Option>
<Option value={'BANNED'}>{t('community.banned')}</Option>
</SelectField>
</td>
<td className="mdl-data-table__cell--non-numeric">
<SelectField
value={row.roles[0] || ''}
className={styles.selectField}
label={t('community.role')}
onChange={(role) => onRoleChange(row.id, role)}>
<Option value={''}>.</Option>
<Option value={'STAFF'}>{t('community.staff')}</Option>
<Option value={'MODERATOR'}>{t('community.moderator')}</Option>
<Option value={'ADMIN'}>{t('community.admin')}</Option>
</SelectField>
</td>
const headers = [
{
title: t('community.username_and_email'),
field: 'username'
},
{
title: t('community.account_creation_date'),
field: 'created_at'
},
{
title: t('community.status'),
field: 'status'
},
{
title: t('community.newsroom_role'),
field: 'role'
}
];
const Table = ({users, setRole, onHeaderClickHandler, setCommenterStatus, viewUserDetail, pageCount, page, onPageChange}) => (
<div>
<table className={`mdl-data-table ${styles.dataTable}`}>
<thead>
<tr>
{headers.map((header, i) =>(
<th
key={i}
className={cn('mdl-data-table__cell--non-numeric', styles.header)}
scope="col"
onClick={() => onHeaderClickHandler({field: header.field})}>
{header.title}
</th>
))}
</tr>
))}
</tbody>
</table>
</thead>
<tbody>
{users.map((row, i)=> (
<tr key={i}>
<td className="mdl-data-table__cell--non-numeric">
<button onClick={() => {viewUserDetail(row.id);}} className={cn(styles.username, styles.button)}>{row.username}</button>
<span className={styles.email}>{row.profiles.map(({id}) => id)}</span>
</td>
<td className="mdl-data-table__cell--non-numeric">
{row.created_at}
</td>
<td className="mdl-data-table__cell--non-numeric">
<Dropdown
value={row.status}
placeholder={t('community.status')}
onChange={(status) => setCommenterStatus(row.id, status)}>
<Option value={'ACTIVE'} label={t('community.active')} />
<Option value={'BANNED'} label={t('community.banned')} />
</Dropdown>
</td>
<td className="mdl-data-table__cell--non-numeric">
<Dropdown
value={row.roles[0] || ''}
placeholder={t('community.role')}
onChange={(role) => setRole(row.id, role)}>
<Option value={''} label={t('community.none')} />
<Option value={'STAFF'} label={t('community.staff')} />
<Option value={'MODERATOR'} label={t('community.moderator')} />
<Option value={'ADMIN'} label={t('community.admin')} />
</Dropdown>
</td>
</tr>
))}
</tbody>
</table>
<Paginate
pageCount={pageCount}
page={page - 1}
onPageChange={onPageChange}
/>
</div>
);
Table.propTypes = {
users: PropTypes.array,
onHeaderClickHandler: PropTypes.func.isRequired,
setRole: PropTypes.func.isRequired,
setCommenterStatus: PropTypes.func.isRequired,
viewUserDetail: PropTypes.func.isRequired,
pageCount: PropTypes.number.isRequired,
page: PropTypes.number.isRequired,
onPageChange: PropTypes.func.isRequired,
};
export default Table;
@@ -1,94 +1,48 @@
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {compose, gql} from 'react-apollo';
import withQuery from 'coral-framework/hocs/withQuery';
import PropTypes from 'prop-types';
import {getDefinitionName} from 'coral-framework/utils';
import {withSetUserStatus, withRejectUsername} from 'coral-framework/graphql/mutations';
import FlaggedAccounts from '../containers/FlaggedAccounts';
import FlaggedUser from '../containers/FlaggedUser';
import {withSetUserStatus, withRejectUsername} from 'coral-framework/graphql/mutations';
import {getDefinitionName} from 'coral-framework/utils';
import {
fetchAccounts,
updateSorting,
newPage,
hideRejectUsernameDialog
} from '../../../actions/community';
import {hideRejectUsernameDialog} from '../../../actions/community';
import Community from '../components/Community';
class CommunityContainer extends Component {
componentWillMount() {
this.props.fetchAccounts({});
}
render() {
return <Community
fetchAccounts={this.props.fetchAccounts}
community={this.props.community}
hideRejectUsernameDialog={this.props.hideRejectUsernameDialog}
updateSorting={this.props.updateSorting}
newPage={this.props.newPage}
route={this.props.route}
rejectUsername={this.props.rejectUsername}
data={this.props.data}
root={this.props.root}
/>;
}
}
const mapStateToProps = (state) => ({
community: state.community,
});
CommunityContainer.propTypes = {
community: PropTypes.object,
fetchAccounts: PropTypes.func,
hideRejectUsernameDialog: PropTypes.func,
updateSorting: PropTypes.func,
newPage: PropTypes.func,
route: PropTypes.object,
rejectUsername: PropTypes.func,
data: PropTypes.object,
root: PropTypes.object
};
const mapDispatchToProps = (dispatch) =>
bindActionCreators({
hideRejectUsernameDialog,
}, dispatch);
const withData = withQuery(gql`
query TalkAdmin_FlaggedUsernamesCount {
flaggedUsernamesCount: userCount(query: {
action_type: FLAG,
statuses: [PENDING]
})
...${getDefinitionName(FlaggedAccounts.fragments.root)}
...${getDefinitionName(FlaggedUser.fragments.root)}
me {
...${getDefinitionName(FlaggedUser.fragments.me)}
__typename
}
query TalkAdmin_Community {
flaggedUsernamesCount: userCount(query: {
action_type: FLAG,
statuses: [PENDING]
})
...${getDefinitionName(FlaggedAccounts.fragments.root)}
...${getDefinitionName(FlaggedUser.fragments.root)}
me {
...${getDefinitionName(FlaggedUser.fragments.me)}
__typename
}
${FlaggedAccounts.fragments.root}
${FlaggedUser.fragments.root}
${FlaggedUser.fragments.me}
`, {
}
${FlaggedAccounts.fragments.root}
${FlaggedUser.fragments.root}
${FlaggedUser.fragments.me}
`, {
options: {
fetchPolicy: 'network-only',
},
});
const mapDispatchToProps = (dispatch) =>
bindActionCreators({
fetchAccounts,
hideRejectUsernameDialog,
updateSorting,
newPage,
}, dispatch);
export default compose(
connect(mapStateToProps, mapDispatchToProps),
withSetUserStatus,
withRejectUsername,
withData,
)(CommunityContainer);
withData
)(Community);
@@ -0,0 +1,104 @@
import React from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import People from '../components/People';
import PropTypes from 'prop-types';
import {viewUserDetail} from '../../../actions/userDetail';
import {
fetchUsers,
updateSorting,
setPage,
hideRejectUsernameDialog,
setCommenterStatus,
setRole,
setSearchValue,
} from '../../../actions/community';
class PeopleContainer extends React.Component {
timer=null;
fetchUsers = (query = {}) => {
const {community} = this.props;
this.props.fetchUsers({
value: community.searchValue,
field: community.fieldPeople,
asc: community.ascPeople,
...query
});
}
componentWillMount() {
this.fetchUsers();
}
onKeyDownHandler = (e) => {
if (e.key === 'Enter') {
e.preventDefault();
this.fetchUsers();
}
}
onSearchChange = (e) => {
const value = e.target.value;
this.props.setSearchValue(value);
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.fetchUsers({value});
}, 350);
}
onHeaderClickHandler = (sort) => {
this.props.updateSorting(sort);
this.fetchUsers();
}
onPageChange = ({selected}) => {
const page = selected + 1;
this.props.setPage(page);
this.fetchUsers({page});
}
render() {
return <People
users={this.props.community.users}
searchValue={this.props.community.searchValue}
onSearchChange={this.onSearchChange}
onHeaderClickHandler={this.onHeaderClickHandler}
onPageChange={this.onPageChange}
totalPages={this.props.community.totalPagesPeople}
setCommenterStatus={this.props.setCommenterStatus}
setRole={this.props.setRole}
page={this.props.community.pagePeople}
viewUserDetail={this.props.viewUserDetail}
/>;
}
}
PeopleContainer.propTypes = {
setPage: PropTypes.func,
fetchUsers: PropTypes.func,
updateSorting: PropTypes.func,
setRole: PropTypes.func.isRequired,
setCommenterStatus: PropTypes.func.isRequired,
setSearchValue: PropTypes.func.isRequired,
viewUserDetail: PropTypes.func.isRequired,
community: PropTypes.object,
};
const mapDispatchToProps = (dispatch) =>
bindActionCreators({
setPage,
fetchUsers,
updateSorting,
hideRejectUsernameDialog,
setCommenterStatus,
setRole,
viewUserDetail,
setSearchValue,
}, dispatch);
export default connect(null, mapDispatchToProps)(PeopleContainer);
@@ -1,39 +0,0 @@
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {compose} from 'react-apollo';
import {setRole, setCommenterStatus} from '../../../actions/community';
import Table from '../components/Table';
import {viewUserDetail} from '../../../actions/userDetail';
class TableContainer extends Component {
constructor (props) {
super(props);
}
render () {
return <Table
{...this.props}
onRoleChange={this.props.setRole}
onCommenterStatusChange={this.props.setCommenterStatus}
commenters={this.props.commenters}
/>;
}
}
const mapStateToProps = (state) => ({
commenters: state.community.accounts,
});
const mapDispatchToProps = (dispatch) =>
bindActionCreators({
setCommenterStatus,
setRole,
viewUserDetail,
}, dispatch);
export default compose(
connect(mapStateToProps, mapDispatchToProps),
)(TableContainer);
@@ -1,2 +0,0 @@
export {default as Community} from './containers/Community';
export {default as CommunityLayout} from './components/CommunityLayout';
@@ -1,15 +1,7 @@
/**
* @TODO: deprecated as this file contains styles from multiple components. Please refactor.
*/
.container {
max-width: 1280px;
margin: 0 auto;
display: flex;
h3 {
color: black;
font-size: 1.26em;
font-weight: 500;
}
}
.leftColumn {
@@ -17,108 +9,8 @@
width: 234px;
}
.mainContent {
width: calc(100% - 300px);
padding: 10px 14px;
box-sizing: border-box;
max-width: 718px;
}
.configSetting {
margin-bottom: 20px;
align-items: flex-start;
min-height: 100px;
max-width: 600px;
h3 {
margin: 0;
}
.actions {
display: inline-block;
width: 100%;
.copiedText {
display: inline-block;
color: #00796b;
padding: 12px;
font-size: 14px;
float: right;
}
.copyButton {
display: inline-block;
width: 200px;
float: right;
}
}
}
.settingsError {
color: #d50000;
}
.settingsError i {
font-size: 14px;
margin-right: 3px;
}
.settingsHeader {
margin-top: 3px;
margin-bottom: 7px;
font-size: 18px;
font-weight: 500;
}
.disabledSettingText {
color: #ccc;
}
.configSettingInfoBox {
min-height: 100px;
margin-bottom: 20px;
width: auto;
height: auto;
text-align: left;
overflow: visible;
}
.configSettingEmbed {
border: 1px solid #ccc;
border-radius: 4px;
margin-bottom: 10px;
display: block;
}
.configTimeoutSelect {
display: inline-block;
margin-left: 20px;
i { /* fix for firefox and react-mdl-selectfield@0.2.0 */
padding: 20px 0;
vertical-align: top;
}
}
.inlineTextfield {
border-color: #ccc;
border-style: solid;
border-width: 0px 0px 1px 0px;
text-align: center;
font-size: inherit;
}
.inlineTextfield:focus {
outline: none;
}
.charCountTexfield, .editCommentTimeframeTextfield {
width: 4em;
padding: 0px;
}
.charCountTexfieldEnabled {
border-color: #00796b;
.saveBox {
margin-top: 38px;
}
.changedSave {
@@ -126,81 +18,10 @@
color: white;
}
.embedInput {
width: 100%;
display: block;
outline: none;
border: 1px solid rgba(0,0,0,.12);
padding: 6px;
.mainContent {
width: calc(100% - 300px);
padding: 10px 14px 80px 14px;
box-sizing: border-box;
border-radius: 2px;
margin: 5px auto;
min-height: 175px;
font-size: 14px;
resize: none;
max-width: 718px;
}
.customCSSInput {
width: 100%;
font-size: 14px;
padding: 14px;
letter-spacing: 0.03em;
color: #555;
box-sizing: border-box;
}
.enabledSetting {
border-left-color: #00796b;
border-left-style: solid;
border-left-width: 7px;
}
.disabledSetting {
padding-left: 22px;
}
.hidden {
display: none;
}
.saveBox {
margin-top: 38px;
}
.settingsSection {
padding-bottom: 200px;
.action {
display: inline-block;
position: absolute;
top: 0;
left: 0;
padding: 20px;
}
.content {
display: inline-block;
padding: 0px 30px;
box-sizing: border-box;
width: 100%;
}
}
.Configure {
p {
line-height: 1.2;
max-width: 550px;
}
.wrapper {
width: 100%;
}
.descriptionBox {
margin-top: 15px;
input {
height: 150px;
}
}
}
@@ -1,119 +1,40 @@
import React, {Component} from 'react';
import {Button, List, Item, Card, Spinner} from 'coral-ui';
import {Button, List, Item} from 'coral-ui';
import styles from './Configure.css';
import StreamSettings from './StreamSettings';
import ModerationSettings from './ModerationSettings';
import TechSettings from './TechSettings';
import StreamSettings from '../containers/StreamSettings';
import ModerationSettings from '../containers/ModerationSettings';
import TechSettings from '../containers/TechSettings';
import t from 'coral-framework/services/i18n';
import {can} from 'coral-framework/services/perms';
import PropTypes from 'prop-types';
export default class Configure extends Component {
state = {
activeSection: 'stream',
changed: false,
errors: {}
};
saveSettings = () => {
this.props.saveSettingsToServer();
this.setState({changed: false});
}
changeSection = (activeSection) => {
this.setState({activeSection});
}
onChangeWordlist = (listName, list) => {
this.setState({changed: true});
this.props.updateWordlist(listName, list);
}
onChangeDomainlist = (listName, list) => {
this.setState({changed: true});
this.props.updateDomainlist(listName, list);
}
onSettingUpdate = (setting) => {
this.setState({changed: true});
this.props.updateSettings(setting);
}
// Sets an arbitrary error string and a boolean state.
// This allows the system to track multiple errors.
onSettingError = (error, state) => {
this.setState((prevState) => {
prevState.errors[error] = state;
return prevState;
});
}
getSection (section) {
const pageTitle = this.getPageTitle(section);
let sectionComponent;
getSectionComponent(section) {
switch(section){
case 'stream':
sectionComponent = <StreamSettings
settings={this.props.settings}
updateSettings={this.onSettingUpdate}
errors={this.state.errors}
settingsError={this.onSettingError}/>;
break;
return StreamSettings;
case 'moderation':
sectionComponent = <ModerationSettings
onChangeWordlist={this.onChangeWordlist}
settings={this.props.settings}
updateSettings={this.onSettingUpdate} />;
break;
return ModerationSettings;
case 'tech':
sectionComponent = <TechSettings
onChangeDomainlist={this.onChangeDomainlist}
settings={this.props.settings}
updateSettings={this.onSettingUpdate} />;
}
if (this.props.settings.fetchingSettings) {
return <Card shadow="4"><Spinner/>Loading settings...</Card>;
}
return (
<div className={styles.settingsSection}>
<h3>{pageTitle}</h3>
{sectionComponent}
</div>
);
}
getPageTitle (section) {
switch(section) {
case 'stream':
return t('configure.stream_settings');
case 'moderation':
return t('configure.moderation_settings');
case 'tech':
return t('configure.tech_settings');
default:
return '';
return TechSettings;
}
throw new Error(`Unknown section ${section}`);
}
render () {
const {activeSection} = this.state;
const section = this.getSection(activeSection);
const {auth: {user}} = this.props;
const {auth: {user}, canSave, savePending, setActiveSection, activeSection} = this.props;
const SectionComponent = this.getSectionComponent(activeSection);
if (!can(user, 'UPDATE_CONFIG')) {
return <p>You must be an administrator to access config settings. Please find the nearest Admin and ask them to level you up!</p>;
}
const showSave = Object.keys(this.state.errors).reduce(
(bool, error) => this.state.errors[error] ? false : bool, this.state.changed);
return (
<div className={styles.container}>
<div className={styles.leftColumn}>
<List onChange={this.changeSection} activeItem={activeSection}>
<List onChange={setActiveSection} activeItem={activeSection}>
<Item itemId='stream' icon='speaker_notes'>
{t('configure.stream_settings')}
</Item>
@@ -126,10 +47,10 @@ export default class Configure extends Component {
</List>
<div className={styles.saveBox}>
{
showSave ?
canSave ?
<Button
raised
onClick={this.saveSettings}
onClick={savePending}
className={styles.changedSave}
icon='check'
full
@@ -150,11 +71,25 @@ export default class Configure extends Component {
</div>
<div className={styles.mainContent}>
{ this.props.saveFetchingError }
{ this.props.fetchSettingsError }
{ section }
<SectionComponent
data={this.props.data}
root={this.props.root}
settings={this.props.settings}
/>
</div>
</div>
);
}
}
Configure.propTypes = {
notify: PropTypes.func.isRequired,
savePending: PropTypes.func.isRequired,
auth: PropTypes.object.isRequired,
data: PropTypes.object.isRequired,
root: PropTypes.object.isRequired,
settings: PropTypes.object.isRequired,
canSave: PropTypes.bool.isRequired,
setActiveSection: PropTypes.func.isRequired,
activeSection: PropTypes.string.isRequired,
};
@@ -0,0 +1,5 @@
.title {
color: black;
font-size: 1.26em;
font-weight: 500;
}
@@ -0,0 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './ConfigurePage.css';
const ConfigurePage = ({title, children, ...rest}) => (
<div {...rest}>
<h3 className={styles.title}>{title}</h3>
{children}
</div>
);
ConfigurePage.propTypes = {
title: PropTypes.string.isRequired,
children: PropTypes.node,
};
export default ConfigurePage;
@@ -1,25 +1,25 @@
import React from 'react';
import {Card} from 'coral-ui';
import styles from './Configure.css';
import PropTypes from 'prop-types';
import TagsInput from 'coral-admin/src/components/TagsInput';
import t from 'coral-framework/services/i18n';
import ConfigureCard from 'coral-framework/components/ConfigureCard';
const Domainlist = ({domains, onChangeDomainlist}) => {
return (
<Card id={styles.domainlist} className={styles.configSetting}>
<div className={styles.wrapper}>
<div className={styles.settingsHeader}>{t('configure.domain_list_title')}</div>
<p className={styles.domainlistDesc}>{t('configure.domain_list_text')}</p>
<div className={styles.wrapper}>
<TagsInput
value={domains}
inputProps={{placeholder: 'URL'}}
onChange={(tags) => onChangeDomainlist('whitelist', tags)}
/>
</div>
</div>
</Card>
<ConfigureCard title={t('configure.domain_list_title')}>
<p>{t('configure.domain_list_text')}</p>
<TagsInput
value={domains}
inputProps={{placeholder: 'URL'}}
onChange={(tags) => onChangeDomainlist('whitelist', tags)}
/>
</ConfigureCard>
);
};
Domainlist.propTypes = {
domains: PropTypes.array.isRequired,
onChangeDomainlist: PropTypes.func.isRequired,
};
export default Domainlist;
@@ -0,0 +1,32 @@
.embedInput {
width: 100%;
display: block;
outline: none;
border: 1px solid rgba(0,0,0,.12);
padding: 6px;
box-sizing: border-box;
border-radius: 2px;
margin: 5px auto;
min-height: 175px;
font-size: 14px;
resize: none;
}
.copiedText {
display: inline-block;
color: #00796b;
padding: 12px;
font-size: 14px;
float: right;
}
.copyButton {
display: inline-block;
width: 200px;
float: right;
}
.actions {
display: inline-block;
width: 100%;
}
@@ -1,17 +1,14 @@
import React, {Component} from 'react';
import t from 'coral-framework/services/i18n';
import join from 'url-join';
import styles from './Configure.css';
import {Button, Card} from 'coral-ui';
import styles from './EmbedLink.css';
import {Button} from 'coral-ui';
import {BASE_URL} from 'coral-framework/constants/url';
import ConfigureCard from 'coral-framework/components/ConfigureCard';
class EmbedLink extends Component {
constructor (props) {
super(props);
this.state = {copied: false};
}
state = {copied: false};
copyToClipBoard = () => {
const copyTextarea = document.querySelector(`.${styles.embedInput}`);
@@ -38,21 +35,18 @@ class EmbedLink extends Component {
"></script>
`.trim();
return (
<Card shadow="2" className={styles.configSetting}>
<div className={styles.wrapper}>
<div className={styles.settingsHeader}>Embed Comment Stream</div>
<p>{t('configure.copy_and_paste')}</p>
<textarea rows={5} type='text' className={styles.embedInput} value={embedText} readOnly={true}/>
<div className={styles.actions}>
<Button raised className={styles.copyButton} onClick={this.copyToClipBoard} cStyle="black">
{t('embedlink.copy')}
</Button>
<div className={styles.copiedText}>
{this.state.copied && 'Copied!'}
</div>
<ConfigureCard title={'Embed Comment Stream'}>
<p>{t('configure.copy_and_paste')}</p>
<textarea rows={5} type='text' className={styles.embedInput} value={embedText} readOnly={true}/>
<div className={styles.actions}>
<Button raised className={styles.copyButton} onClick={this.copyToClipBoard} cStyle="black">
{t('embedlink.copy')}
</Button>
<div className={styles.copiedText}>
{this.state.copied && 'Copied!'}
</div>
</div>
</Card>
</ConfigureCard>
);
}
}
@@ -1,90 +1,90 @@
import React from 'react';
import PropTypes from 'prop-types';
import styles from './Configure.css';
import {Card} from 'coral-ui';
import {Checkbox} from 'react-mdl';
import Wordlist from './Wordlist';
import Slot from 'coral-framework/components/Slot';
import t from 'coral-framework/services/i18n';
import ConfigurePage from './ConfigurePage';
import ConfigureCard from 'coral-framework/components/ConfigureCard';
const updateModeration = (updateSettings, mod) => () => {
const moderation = mod === 'PRE' ? 'POST' : 'PRE';
updateSettings({moderation});
};
class ModerationSettings extends React.Component {
const updateEmailConfirmation = (updateSettings, verify) => () => {
updateSettings({requireEmailConfirmation: !verify});
};
updateModeration = () => {
const updater = {moderation: {$set: this.props.settings.moderation === 'PRE' ? 'POST' : 'PRE'}};
this.props.updatePending({updater});
};
const updatePremodLinksEnable = (updateSettings, premodLinks) => () => {
const premodLinksEnable = !premodLinks;
updateSettings({premodLinksEnable});
};
updateEmailConfirmation = () => {
const updater = {requireEmailConfirmation: {$set: !this.props.settings.requireEmailConfirmation}};
this.props.updatePending({updater});
};
const ModerationSettings = ({settings, updateSettings, onChangeWordlist}) => {
updatePremodLinksEnable = () => {
const updater = {premodLinksEnable: {$set: !this.props.settings.premodLinksEnable}};
this.props.updatePending({updater});
};
// just putting this here for shorthand below
const on = styles.enabledSetting;
const off = styles.disabledSetting;
updateWordlist = (listName, list) => {
this.props.updatePending({updater: {
wordlist: {$apply: (wordlist) => {
const changeSet = {[listName]: list};
if (!wordlist) {
return changeSet;
}
return {
...wordlist,
...changeSet,
};
}},
}});
};
return (
<div className={styles.Configure}>
<Card className={`${styles.configSetting} ${settings.requireEmailConfirmation ? on : off}`}>
<div className={styles.action}>
<Checkbox
onChange={updateEmailConfirmation(updateSettings, settings.requireEmailConfirmation)}
checked={settings.requireEmailConfirmation} />
</div>
<div className={styles.content}>
<div className={styles.settingsHeader}>{t('configure.require_email_verification')}</div>
<p className={settings.requireEmailConfirmation ? '' : styles.disabledSettingText}>
{t('configure.require_email_verification_text')}
</p>
</div>
</Card>
<Card className={`${styles.configSetting} ${settings.moderation === 'PRE' ? on : off}`}>
<div className={styles.action}>
<Checkbox
onChange={updateModeration(updateSettings, settings.moderation)}
checked={settings.moderation === 'PRE'} />
</div>
<div className={styles.content}>
<div className={styles.settingsHeader}>{t('configure.enable_pre_moderation')}</div>
<p className={settings.moderation === 'PRE' ? '' : styles.disabledSettingText}>
{t('configure.enable_pre_moderation_text')}
</p>
</div>
</Card>
<Card className={`${styles.configSetting} ${settings.premodLinksEnable ? on : off}`}>
<div className={styles.action}>
<Checkbox
onChange={updatePremodLinksEnable(updateSettings, settings.premodLinksEnable)}
checked={settings.premodLinksEnable} />
</div>
<div className={styles.content}>
<div className={styles.settingsHeader}>{t('configure.enable_premod_links')}</div>
<p>
{t('configure.enable_premod_links_text')}
</p>
</div>
</Card>
<Wordlist
bannedWords={settings.wordlist.banned}
suspectWords={settings.wordlist.suspect}
onChangeWordlist={onChangeWordlist} />
</div>
);
};
render() {
const {settings, data, root} = this.props;
return (
<ConfigurePage
title={t('configure.moderation_settings')}
>
<ConfigureCard
checked={settings.requireEmailConfirmation}
onCheckbox={this.updateEmailConfirmation}
title={t('configure.require_email_verification')}
>
{t('configure.require_email_verification_text')}
</ConfigureCard>
<ConfigureCard
checked={settings.moderation === 'PRE'}
onCheckbox={this.updateModeration}
title={t('configure.enable_pre_moderation')}
>
{t('configure.enable_pre_moderation_text')}
</ConfigureCard>
<ConfigureCard
checked={settings.premodLinksEnable}
onCheckbox={this.updatePremodLinksEnable}
title={t('configure.enable_premod_links')}
>
{t('configure.enable_premod_links_text')}
</ConfigureCard>
<Wordlist
bannedWords={settings.wordlist.banned}
suspectWords={settings.wordlist.suspect}
onChangeWordlist={this.updateWordlist} />
<Slot
fill="adminModerationSettings"
data={data}
queryData={{root, settings}}
/>
</ConfigurePage>
);
}
}
ModerationSettings.propTypes = {
onChangeWordlist: PropTypes.func.isRequired,
settings: PropTypes.shape({
moderation: PropTypes.string.isRequired,
wordlist: PropTypes.shape({
banned: PropTypes.array.isRequired,
suspect: PropTypes.array.isRequired
})
}).isRequired,
updateSettings: PropTypes.func.isRequired
updatePending: PropTypes.func.isRequired,
data: PropTypes.object.isRequired,
root: PropTypes.object.isRequired,
settings: PropTypes.object.isRequired,
};
export default ModerationSettings;
@@ -0,0 +1,55 @@
.configSettingInfoBox {
min-height: 100px;
margin-bottom: 20px;
width: auto;
height: auto;
text-align: left;
overflow: visible;
}
.descriptionBox {
margin-top: 15px;
input {
height: 150px;
}
}
.configTimeoutSelect {
display: inline-block;
margin-left: 20px;
i { /* fix for firefox and react-mdl-selectfield@0.2.0 */
padding: 20px 0;
vertical-align: top;
}
}
.hidden {
display: none;
}
.inlineTextfield {
border-color: #ccc;
border-style: solid;
border-width: 0px 0px 1px 0px;
text-align: center;
font-size: inherit;
}
.inlineTextfield:focus {
outline: none;
}
.charCountTexfield, .editCommentTimeframeTextfield {
width: 4em;
padding: 0px;
}
.charCountTexfieldEnabled {
border-color: #00796b;
}
@@ -1,10 +1,15 @@
import React from 'react';
import {SelectField, Option} from 'react-mdl-selectfield';
import t from 'coral-framework/services/i18n';
import styles from './Configure.css';
import {Checkbox, Textfield} from 'react-mdl';
import {Card, Icon, TextArea} from 'coral-ui';
import styles from './StreamSettings.css';
import {Textfield} from 'react-mdl';
import {Icon, TextArea} from 'coral-ui';
import PropTypes from 'prop-types';
import Slot from 'coral-framework/components/Slot';
import MarkdownEditor from 'coral-framework/components/MarkdownEditor';
import cn from 'classnames';
import ConfigurePage from './ConfigurePage';
import ConfigureCard from 'coral-framework/components/ConfigureCard';
const TIMESTAMPS = {
weeks: 60 * 60 * 24 * 7,
@@ -12,187 +17,6 @@ const TIMESTAMPS = {
hours: 60 * 60
};
const updateCharCountEnable = (updateSettings, charCountChecked) => () => {
const charCountEnable = !charCountChecked;
updateSettings({charCountEnable});
};
const updateCharCount = (updateSettings, settingsError) => (event) => {
const charCount = event.target.value;
if (charCount.match(/[^0-9]/) || charCount.length === 0) {
settingsError('charCount', true);
} else {
settingsError('charCount', false);
}
updateSettings({charCount: charCount});
};
const updateInfoBoxEnable = (updateSettings, infoBox) => () => {
const infoBoxEnable = !infoBox;
updateSettings({infoBoxEnable});
};
const updateInfoBoxContent = (updateSettings) => (value) => {
const infoBoxContent = value;
updateSettings({infoBoxContent});
};
const updateAutoClose = (updateSettings, autoCloseStream) => () => {
updateSettings({autoCloseStream});
};
const updateClosedMessage = (updateSettings) => (event) => {
const closedMessage = event.target.value;
updateSettings({closedMessage});
};
// If we are changing the measure we need to recalculate using the old amount
// Same thing if we are just changing the amount
const updateClosedTimeout = (updateSettings, ts, isMeasure) => (event) => {
if (isMeasure) {
const amount = getTimeoutAmount(ts);
const closedTimeout = amount * TIMESTAMPS[event];
updateSettings({closedTimeout});
} else {
const val = event.target.value;
const measure = getTimeoutMeasure(ts);
const closedTimeout = val * TIMESTAMPS[measure];
updateSettings({closedTimeout});
}
};
const updateEditCommentWindowLength = (updateSettings) => (e) => {
const value = e.target.value;
const valueAsNumber = parseFloat(value);
const milliseconds = (!isNaN(valueAsNumber)) && (valueAsNumber * 1000);
updateSettings({editCommentWindowLength: milliseconds || value});
};
const StreamSettings = ({updateSettings, settingsError, settings, errors}) => {
// just putting this here for shorthand below
const on = styles.enabledSetting;
const off = styles.disabledSetting;
return (
<div className={styles.Configure}>
<Card className={`${styles.configSetting} ${settings.charCountEnable ? on : off}`}>
<div className={styles.action}>
<Checkbox
onChange={updateCharCountEnable(updateSettings, settings.charCountEnable)}
checked={settings.charCountEnable} />
</div>
<div className={styles.content}>
<div className={styles.settingsHeader}>{t('configure.comment_count_header')}</div>
<p className={settings.charCountEnable ? '' : styles.disabledSettingText}>
<span>{t('configure.comment_count_text_pre')}</span>
<input type='text'
className={`${styles.inlineTextfield} ${styles.charCountTexfield} ${settings.charCountEnable && styles.charCountTexfieldEnabled}`}
htmlFor='charCount'
onChange={updateCharCount(updateSettings, settingsError)}
value={settings.charCount}
disabled={settings.charCountEnable ? '' : 'disabled'}
/>
<span>{t('configure.comment_count_text_post')}</span>
{
errors.charCount &&
<span className={styles.settingsError}>
<br/>
<Icon name="error_outline"/>
{t('configure.comment_count_error')}
</span>
}
</p>
</div>
</Card>
<Card className={`${styles.configSetting} ${styles.configSettingInfoBox} ${settings.infoBoxEnable ? on : off}`}>
<div className={styles.action}>
<Checkbox
onChange={updateInfoBoxEnable(updateSettings, settings.infoBoxEnable)}
checked={settings.infoBoxEnable} />
</div>
<div className={styles.content}>
<div className={styles.settingsHeader}>
{t('configure.include_comment_stream')}
</div>
<p className={settings.infoBoxEnable ? '' : styles.disabledSettingText}>
{t('configure.include_comment_stream_desc')}
</p>
<div className={`${styles.configSettingInfoBox} ${settings.infoBoxEnable ? null : styles.hidden}`} >
<MarkdownEditor
className={styles.descriptionBox}
onChange={updateInfoBoxContent(updateSettings)}
value={settings.infoBoxContent}
/>
</div>
</div>
</Card>
<Card className={`${styles.configSetting} ${styles.configSettingInfoBox}`}>
<div className={styles.wrapper}>
<div className={styles.settingsHeader}>{t('configure.closed_stream_settings')}</div>
<p>{t('configure.closed_comments_desc')}</p>
<div>
<TextArea className={styles.descriptionBox}
onChange={updateClosedMessage(updateSettings)}
value={settings.closedMessage}
/>
</div>
</div>
</Card>
{/* Edit Comment Timeframe */}
<Card className={styles.configSetting}>
<div className={styles.settingsHeader}>{t('configure.edit_comment_timeframe_heading')}</div>
<p>
{t('configure.edit_comment_timeframe_text_pre')}
&nbsp;
<input
className={`${styles.inlineTextfield} ${styles.editCommentTimeframeTextfield}`}
type="number"
min="0"
onChange={updateEditCommentWindowLength(updateSettings)}
placeholder="30"
defaultValue={(settings.editCommentWindowLength / 1000) /* saved as ms, rendered as seconds */}
pattern='[0-9]+([\.][0-9]*)?'
/>
&nbsp;
{t('configure.edit_comment_timeframe_text_post')}
</p>
</Card>
<Card className={`${styles.configSetting} ${styles.configSettingInfoBox}`}>
<div className={styles.action}>
<Checkbox
onChange={updateAutoClose(updateSettings, !settings.autoCloseStream)}
checked={settings.autoCloseStream} />
</div>
<div className={styles.content}>
<div className={styles.settingsHeader}>{t('configure.close_after')}</div>
<br />
<Textfield
type='number'
pattern='[0-9]+'
style={{width: 50}}
onChange={updateClosedTimeout(updateSettings, settings.closedTimeout)}
value={getTimeoutAmount(settings.closedTimeout)}
label={t('configure.closed_comments_label')} />
<div className={styles.configTimeoutSelect}>
<SelectField
label="comments closed time window"
value={getTimeoutMeasure(settings.closedTimeout)}
onChange={updateClosedTimeout(updateSettings, settings.closedTimeout, true)}>
<Option value={'hours'}>{t('configure.hours')}</Option>
<Option value={'days'}>{t('configure.days')}</Option>
<Option value={'weeks'}>{t('configure.weeks')}</Option>
</SelectField>
</div>
</div>
</Card>
{/* the above card should be the last one if at all possible because of z-index issues with the selects */}
</div>
);
};
export default StreamSettings;
// To see if we are talking about weeks, days or hours
// We talk the remainder of the division and see if it's 0
const getTimeoutMeasure = (ts) => {
@@ -208,3 +32,190 @@ const getTimeoutMeasure = (ts) => {
// Dividing the amount by it's measure (hours, days, weeks) we
// obtain the amount of time
const getTimeoutAmount = (ts) => ts / TIMESTAMPS[getTimeoutMeasure(ts)];
class StreamSettings extends React.Component {
updateCharCountEnable = () => {
const updater = {charCountEnable: {$set: !this.props.settings.charCountEnable}};
this.props.updatePending({updater});
};
updateCharCount = (event) => {
let error = null;
const charCount = event.target.value;
if (charCount.match(/[^0-9]/) || charCount.length === 0) {
error = true;
}
const updater = {charCount: {$set: charCount}};
const errorUpdater = {charCount: {$set: error}};
this.props.updatePending({updater, errorUpdater});
};
updateInfoBoxEnable = () => {
const updater = {infoBoxEnable: {$set: !this.props.settings.infoBoxEnable}};
this.props.updatePending({updater});
};
updateInfoBoxContent = (value) => {
const updater = {infoBoxContent: {$set: value}};
this.props.updatePending({updater});
};
updateClosedMessage = (event) => {
const updater = {closedMessage: {$set: event.target.value}};
this.props.updatePending({updater});
};
updateEditCommentWindowLength = (e) => {
const value = e.target.value;
const valueAsNumber = parseFloat(value);
const milliseconds = (!isNaN(valueAsNumber)) && (valueAsNumber * 1000);
const updater = {editCommentWindowLength: {$set: milliseconds || value}};
this.props.updatePending({updater});
};
updateAutoClose = () => {
const updater = {autoCloseStream: {$set: !this.props.settings.autoCloseStream}};
this.props.updatePending({updater});
};
updateClosedTimeout = (event) => {
const val = event.target.value;
const measure = getTimeoutMeasure(this.props.settings.closedTimeout);
const updater = {closedTimeout: {$set: val * TIMESTAMPS[measure]}};
this.props.updatePending({updater});
};
// If we are changing the measure we need to recalculate using the old amount
// Same thing if we are just changing the amount
updateClosedTimeoutMeasure = (event) => {
const amount = getTimeoutAmount(this.props.settings.closedTimeout);
const updater = {closedTimeout: {$set: amount * TIMESTAMPS[event]}};
this.props.updatePending({updater});
};
render() {
const {settings, data, root, errors} = this.props;
return (
<ConfigurePage
title={t('configure.stream_settings')}
>
<ConfigureCard
checked={settings.charCountEnable}
onCheckbox={this.updateCharCountEnable}
title={t('configure.comment_count_header')}
>
<span>{t('configure.comment_count_text_pre')}</span>
<input type='text'
className={cn(styles.inlineTextfield, styles.charCountTexfield, settings.charCountEnable && styles.charCountTexfieldEnable)}
htmlFor='charCount'
onChange={this.updateCharCount}
value={settings.charCount}
disabled={settings.charCountEnable ? '' : 'disabled'}
/>
<span>{t('configure.comment_count_text_post')}</span>
{
errors.charCount &&
<span className={styles.settingsError}>
<br/>
<Icon name="error_outline"/>
{t('configure.comment_count_error')}
</span>
}
</ConfigureCard>
<ConfigureCard
checked={settings.infoBoxEnable}
onCheckbox={this.updateInfoBoxEnable}
title={t('configure.include_comment_stream')}
>
<p>
{t('configure.include_comment_stream_desc')}
</p>
<div className={cn(styles.configSettingInfoBox, settings.infoBoxEnable ? null : styles.hidden)} >
<MarkdownEditor
className={styles.descriptionBox}
onChange={this.updateInfoBoxContent}
value={settings.infoBoxContent}
/>
</div>
</ConfigureCard>
<ConfigureCard
checked={settings.configSettingInfoBox}
onCheckbox={this.updateClosedMessage}
title={t('configure.closed_stream_settings')}
>
<p>{t('configure.closed_comments_desc')}</p>
<div>
<TextArea className={styles.descriptionBox}
onChange={this.updateClosedMessage}
value={settings.closedMessage}
/>
</div>
</ConfigureCard>
<ConfigureCard
title={t('configure.edit_comment_timeframe_heading')}
>
{t('configure.edit_comment_timeframe_text_pre')}
&nbsp;
<input
className={cn(styles.inlineTextfield, styles.editCommentTimeframeTextfield)}
type="number"
min="0"
onChange={this.updateEditCommentWindowLength}
placeholder="30"
defaultValue={(settings.editCommentWindowLength / 1000) /* saved as ms, rendered as seconds */}
pattern='[0-9]+([\.][0-9]*)?'
/>
&nbsp;
{t('configure.edit_comment_timeframe_text_post')}
</ConfigureCard>
<ConfigureCard
checked={settings.autoCloseStream}
onCheckbox={this.updateAutoClose}
title={t('configure.close_after')}
>
<Textfield
type='number'
pattern='[0-9]+'
style={{width: 50}}
onChange={this.updateClosedTimeout}
value={getTimeoutAmount(settings.closedTimeout)}
label={t('configure.closed_comments_label')} />
<div className={styles.configTimeoutSelect}>
<SelectField
label="comments closed time window"
value={getTimeoutMeasure(settings.closedTimeout)}
onChange={this.updateClosedTimeoutMeasure}>
<Option value={'hours'}>{t('configure.hours')}</Option>
<Option value={'days'}>{t('configure.days')}</Option>
<Option value={'weeks'}>{t('configure.weeks')}</Option>
</SelectField>
</div>
</ConfigureCard>
{/* the above card should be the last one if at all possible because of z-index issues with the selects */}
<Slot
fill="adminStreamSettings"
data={data}
queryData={{root, settings}}
/>
</ConfigurePage>
);
}
}
StreamSettings.propTypes = {
updatePending: PropTypes.func.isRequired,
errors: PropTypes.object.isRequired,
data: PropTypes.object.isRequired,
root: PropTypes.object.isRequired,
settings: PropTypes.object.isRequired,
};
export default StreamSettings;
@@ -0,0 +1,10 @@
.customCSSInput {
width: 100%;
font-size: 14px;
padding: 14px;
letter-spacing: 0.03em;
color: #555;
box-sizing: border-box;
}
@@ -1,44 +1,67 @@
import React from 'react';
import PropTypes from 'prop-types';
import {Card} from 'coral-ui';
import Domainlist from './Domainlist';
import EmbedLink from './EmbedLink';
import styles from './Configure.css';
import styles from './TechSettings.css';
import Slot from 'coral-framework/components/Slot';
import t from 'coral-framework/services/i18n';
import ConfigurePage from './ConfigurePage';
import ConfigureCard from 'coral-framework/components/ConfigureCard';
const updateCustomCssUrl = (updateSettings) => (event) => {
const customCssUrl = event.target.value;
updateSettings({customCssUrl});
};
class TechSettings extends React.Component {
const TechSettings = ({settings, onChangeDomainlist, updateSettings}) => {
return (
<div className={styles.Configure}>
<Domainlist
domains={settings.domains.whitelist}
onChangeDomainlist={onChangeDomainlist} />
<EmbedLink />
<Card className={styles.configSetting}>
<div className={styles.wrapper}>
<div className={styles.settingsHeader}>{t('configure.custom_css_url')}</div>
updateCustomCssUrl = (event) => {
const updater = {customCssUrl: {$set: event.target.value}};
this.props.updatePending({updater});
};
updateDomainlist = (listName, list) => {
this.props.updatePending({updater: {
domains: {$apply: (domains) => {
const changeSet = {[listName]: list};
if (!domains) {
return changeSet;
}
return {
...domains,
...changeSet,
};
}},
}});
};
render() {
const {settings, data, root} = this.props;
return (
<ConfigurePage
title={t('configure.tech_settings')}
>
<Domainlist
domains={settings.domains.whitelist}
onChangeDomainlist={this.updateDomainlist} />
<EmbedLink />
<ConfigureCard title={t('configure.custom_css_url')}>
<p>{t('configure.custom_css_url_desc')}</p>
<input
className={styles.customCSSInput}
value={settings.customCssUrl}
onChange={updateCustomCssUrl(updateSettings)} />
</div>
</Card>
</div>
);
};
onChange={this.updateCustomCssUrl} />
</ConfigureCard>
<Slot
fill="adminTechSettings"
data={data}
queryData={{root, settings}}
/>
</ConfigurePage>
);
}
}
TechSettings.propTypes = {
settings: PropTypes.shape({
domains: PropTypes.shape({
whitelist: PropTypes.array.isRequired
})
}).isRequired,
updateSettings: PropTypes.func.isRequired
updatePending: PropTypes.func.isRequired,
data: PropTypes.object.isRequired,
root: PropTypes.object.isRequired,
settings: PropTypes.object.isRequired,
};
export default TechSettings;
@@ -1,33 +1,33 @@
import React from 'react';
import t from 'coral-framework/services/i18n';
import TagsInput from 'coral-admin/src/components/TagsInput';
import styles from './Configure.css';
import {Card} from 'coral-ui';
import PropTypes from 'prop-types';
import ConfigureCard from 'coral-framework/components/ConfigureCard';
const Wordlist = ({suspectWords, bannedWords, onChangeWordlist}) => (
<div>
<Card id={styles.bannedWordlist} className={styles.configSetting}>
<div className={styles.settingsHeader}>{t('configure.banned_words_title')}</div>
<p className={styles.wordlistDesc}>{t('configure.banned_word_text')}</p>
<div className={styles.wrapper}>
<TagsInput
value={bannedWords}
inputProps={{placeholder: 'word or phrase'}}
onChange={(tags) => onChangeWordlist('banned', tags)}
/>
</div>
</Card>
<Card id={styles.suspectWordlist} className={styles.configSetting}>
<div className={styles.settingsHeader}>{t('configure.suspect_word_title')}</div>
<p className={styles.wordlistDesc}>{t('configure.suspect_word_text')}</p>
<div className={styles.wrapper}>
<TagsInput
value={suspectWords}
inputProps={{placeholder: 'word or phrase'}}
onChange={(tags) => onChangeWordlist('suspect', tags)} />
</div>
</Card>
<ConfigureCard title={t('configure.banned_words_title')}>
<p>{t('configure.banned_word_text')}</p>
<TagsInput
value={bannedWords}
inputProps={{placeholder: 'word or phrase'}}
onChange={(tags) => onChangeWordlist('banned', tags)}
/>
</ConfigureCard>
<ConfigureCard title={t('configure.suspect_word_title')}>
<p>{t('configure.suspect_word_text')}</p>
<TagsInput
value={suspectWords}
inputProps={{placeholder: 'word or phrase'}}
onChange={(tags) => onChangeWordlist('suspect', tags)} />
</ConfigureCard>
</div>
);
Wordlist.propTypes = {
suspectWords: PropTypes.array.isRequired,
bannedWords: PropTypes.array.isRequired,
onChangeWordlist: PropTypes.func.isRequired,
};
export default Wordlist;

Some files were not shown because too many files have changed in this diff Show More