Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming exports #1826

Merged
merged 14 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 40 additions & 27 deletions client-report/src/components/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const Number = ({ number, label }) => (

const pathname = window.location.pathname; // "/report/2arcefpshi"
const report_id = pathname.split("/")[2];
const doShowDataLicenseTerms = ["pol.is", "preprod.pol.is", "localhost"].includes(
window.location.hostname
);

const getCurrentTimestamp = () => {
const now = new Date();
Expand Down Expand Up @@ -147,6 +150,16 @@ const Overview = ({
</a>
{` (as event log)`}
</p>
<p style={{ fontFamily: "monospace" }}>
{`---Votes matrix: `}
<a
download={getDownloadFilename("participant-votes", conversation)}
href={`http://${window.location.hostname}/api/v3/reportExport/${report_id}/participant-votes.csv`}
>
{getDownloadFilename("participant-votes", conversation)}
</a>
{` (as comments x participants matrix)`}
</p>
<div style={{ marginTop: "3em" }}>
<p style={{ fontFamily: "monospace" }}>
<strong>Public API endpoints (read only, Jupyter notebook friendly)</strong>
Expand All @@ -160,36 +173,36 @@ const Overview = ({
<p style={{ fontFamily: "monospace" }}>
{`$ curl http://${window.location.hostname}/api/v3/reportExport/${report_id}/votes.csv`}
</p>
<p style={{ fontFamily: "monospace" }}>
{`$ curl http://${window.location.hostname}/api/v3/reportExport/${report_id}/participant-votes.csv`}
</p>
</div>
{window.location.hostname === "pol.is" ||
(window.location.hostname === "localhost" && (
<div style={{ marginTop: "3em" }}>
<p style={{ fontFamily: "monospace" }}>
<strong>Attribution of Polis Data</strong>
</p>

<p style={{ fontFamily: "monospace" }}>
All Polis data is licensed under a Creative Commons Attribution 4.0 International
license: https://creativecommons.org/licenses/by/4.0/
</p>
<p style={{ fontFamily: "monospace" }}>
--------------- BEGIN STATEMENT ---------------
</p>
<p
style={{ fontFamily: "monospace" }}
>{`Data was gathered using the Polis software (see: compdemocracy.org/polis and github.com/compdemocracy/polis) and is sub-licensed
{doShowDataLicenseTerms && (
<div style={{ marginTop: "3em" }}>
<p style={{ fontFamily: "monospace" }}>
<strong>Attribution of Polis Data</strong>
</p>

<p style={{ fontFamily: "monospace" }}>
All Polis data is licensed under a Creative Commons Attribution 4.0 International
license: https://creativecommons.org/licenses/by/4.0/
</p>
<p style={{ fontFamily: "monospace" }}>
--------------- BEGIN STATEMENT ---------------
</p>
<p
style={{ fontFamily: "monospace" }}
>{`Data was gathered using the Polis software (see: compdemocracy.org/polis and github.com/compdemocracy/polis) and is sub-licensed
under CC BY 4.0 with Attribution to The Computational Democracy Project. The data and more
information about how the data was collected can be found at the following link: ${window.location.href}`}</p>
<p style={{ fontFamily: "monospace" }}>
--------------- END STATEMENT---------------
</p>
<p style={{ fontFamily: "monospace" }}>
For further information on best practices for Attribution of CC 4.0 licensed content
Please see:
https://wiki.creativecommons.org/wiki/Best_practices_for_attribution#Title.2C_Author.2C_Source.2C_License
</p>
</div>
))}
<p style={{ fontFamily: "monospace" }}>--------------- END STATEMENT---------------</p>
<p style={{ fontFamily: "monospace" }}>
For further information on best practices for Attribution of CC 4.0 licensed content
Please see:
https://wiki.creativecommons.org/wiki/Best_practices_for_attribution#Title.2C_Author.2C_Source.2C_License
</p>
</div>
)}
</div>
</div>
);
Expand Down
113 changes: 99 additions & 14 deletions server/package-lock.json

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

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"p3p": "~0.0.2",
"pg": "~8.8.0",
"pg-connection-string": "~2.5.0",
"pg-native": "~3.0.1",
"pg-query-stream": "^4.6.0",
"replacestream": "~4.0.0",
"request": "~2.88.2",
"request-promise": "~4.2.6",
Expand Down
Loading
Loading