Skip to content

Commit

Permalink
Export api endpoints (#1804)
Browse files Browse the repository at this point in the history
* docker local postgres

* fix Constants capitalization bug in participationview

* add perspective to example.env

* add google apis to package.json

* add perspective api key to config

* config prettier

* import google

* prettier server.ts

* fix typescript bluebird promise to enable async await

* refactor post_comment route async, remove paths

* perspective call

* jigsaw toxicity threshold under flag.

* text flag for toxic

* add perspective to privacy policy

* jigsaw TOS

* Better type for getPca.

Also removed promotion of error to the return value. Let the error propagate as
an error.

* Tell TypeScript to use a less ancient library target.

* Trim trailing whitespace.

* Add data export endpoint.

This is a simple first pass which just reads the data from the database and
delivers it. No caching, no fancy business.

The endpoints are based on the report identifier and provide three separate
.csv exports. For example:

/api/v3/reportExport/r6ke7cdzte2jrsxctfyt9/summary.csv
/api/v3/reportExport/r6ke7cdzte2jrsxctfyt9/comments.csv
/api/v3/reportExport/r6ke7cdzte2jrsxctfyt9/votes.csv

The format is made to match that of the old command line exporter as much as
possible.

* smaller font size

* Use the correct column name here.

* Set text/csv content type on responses.

* export fonts from globals

* data export info in report view

* prettier app.js

* move overview down

* shorten toxic text

---------

Co-authored-by: Colin Megill <[email protected]>
  • Loading branch information
samskivert and colinmegill authored Sep 17, 2024
1 parent 4176b9d commit 3f7ddb6
Show file tree
Hide file tree
Showing 15 changed files with 1,874 additions and 878 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Comment extends React.Component {
return (
<Card sx={{ mb: [3], minWidth: '35em' }}>
<Box>
<Text sx={{ mb: [3], color: 'red', fontSize: 12 }}>{this.props.comment.active ? null : 'Comment flagged as toxic by Jigsaw Perspective API. Comment not shown to participants. Accept to override.'}</Text>
<Text sx={{ mb: [3] }}>{this.props.comment.txt}</Text>
<Flex
sx={{
Expand Down
1 change: 1 addition & 0 deletions client-admin/src/content/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Conversation participants may opt to use third party data collector and processo
* We use Logentries for server logs, which may include personal information such as IP address necessary for debugging production issues. Information about how Logentries uses this data when you use our Site can be found at: <https://www.rapid7.com/privacy-policy/>
* We use Amazon Web Services Simple Email Service for sending account confirmation and notification emails to users. We also use AWS Simple Storage Service for. Information about how AWS handles: <https://aws.amazon.com/privacy/>
* We use Google Translate for automatic machine translation of comments, and Google Analytics for site usage statistics. Information about how Google uses this data when you use our Site can be found at: <https://policies.google.com/privacy>
* We use Jigsaw Perspective API for comment moderation. This service analyzes the content of comments to detect potentially toxic or inappropriate language. Information about how Perspective API handles data can be found at: <https://www.perspectiveapi.com/>
* We pass all Site web requests through a Cloudflare caching proxy. No personal information is cached at this level. Information about how Cloudflare uses your data can be found at: <https://www.cloudflare.com/privacypolicy/>

## Public Areas and Syndicated Services
Expand Down
1 change: 1 addition & 0 deletions client-admin/src/content/tos.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ These Terms of Use are a legally binding contract between you and The Computatio
5. **User Content Disclaimer.** &nbsp;
We are under no obligation to edit or control User Content that you or other users post or publish, and will not be in any way responsible or liable for User Content.
The Computational Democracy Project may, however, at any time and without prior notice, screen, remove, edit, or block any User Content that in our sole judgment violates these Terms or is otherwise objectionable.
We may use automated systems, including but not limited to the Jigsaw Perspective API, to moderate User Content for potentially toxic or inappropriate language.
You understand that when using the Service you will be exposed to User Content from a variety of sources and acknowledge that User Content may be inaccurate, offensive, indecent or objectionable.
You agree to waive, and hereby do waive, any legal or equitable rights or remedies you have or may have against The Computational Democracy Project with respect to User Content.
We expressly disclaim any and all liability in connection with User Content.
Expand Down
Loading

0 comments on commit 3f7ddb6

Please sign in to comment.