-
Notifications
You must be signed in to change notification settings - Fork 7
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
1608 download filtered results UI modal #1625
Conversation
…608-download-filtered-results-ui-modal
…608-download-filtered-results-ui-modal
Codecov Report
@@ Coverage Diff @@
## main #1625 +/- ##
===========================================
+ Coverage 55.99% 82.80% +26.80%
===========================================
Files 69 57 -12
Lines 2343 1803 -540
Branches 724 339 -385
===========================================
+ Hits 1312 1493 +181
+ Misses 1031 310 -721
Continue to review full report at Codecov.
|
…608-download-filtered-results-ui-modal
…608-download-filtered-results-ui-modal
…608-download-filtered-results-ui-modal
…608-download-filtered-results-ui-modal
…hub.com/globaldothealth/list into 1608-download-filtered-results-ui-modal
This reverts commit 1d92064.
This reverts commit f9d43ec.
if (req.body.query && req.body.caseIds) { | ||
res.status(400).json({ message: 'Bad request' }); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, good to test this constraint before continuing
if (queryLimit) { | ||
matchingCases = await Case.aggregate(casesIgnoringExcluded) | ||
.collation({ | ||
locale: 'en_US', | ||
strength: 2, | ||
}) | ||
.limit(queryLimit); | ||
} else { | ||
matchingCases = await Case.aggregate( | ||
casesIgnoringExcluded, | ||
).collation({ | ||
locale: 'en_US', | ||
strength: 2, | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal, but could be changed to:
let query:any = Case.aggregate(casesIgnoringExcluded)collation({locale: 'en_US', strength: 2, });
if (queryLimit) { query = query.limit(queryLimit); }
const matchingCases = await query;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the code will be cleaner, thank you for spotting that!
<p>Please visit the link below to download list of cases in response to your query <strong>${workerData.query}</strong>.</p> | ||
|
||
<a href="${signedUrl}">Click here to download the data</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, a much better way of handling the large files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thank you!
#1608
Changes
covid19-filtered-downloads
bucket. The file will be automatically removed after 3 days. The user will receive an email containing pre signed url to this file (also valid for 3 days) allowing him to download the results. (csv, tsv and json)Email that is being sent with the download link
Alert on data page informing user that the email was sent