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

SIMSBIOHUB-562: Export Survey Data #1273

Merged
merged 47 commits into from
Sep 17, 2024
Merged

SIMSBIOHUB-562: Export Survey Data #1273

merged 47 commits into from
Sep 17, 2024

Conversation

NickPhura
Copy link
Collaborator

@NickPhura NickPhura commented Apr 17, 2024

Links to Jira Tickets

https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-562

Description of Changes

API

New endpoint that fetches and uploads survey data to s3, and returns a pre-signed url to download it.

APP

New dialog (under survey settings dropdown button) that allows users to execute an export. Currently restricted to project coordinators and collaborators (and system/data admins).

Testing Notes

Pre-req: S3 credentials in .env

From the settings button at the top of the survey page, clicking export pops a dialogue, which lets you choose which data to export. Data is exported to a zip file in S3, and immediately downloaded to the users local machine.

To Do

API

Currently the export only supports survey metadata, observations (which both just make a very basic select query, and leave the response as json), and telemetry (which returns the same data as the summary telemetry page).

API - Tests

APP

The dialogue is fairly basic, with no loading bars, etc, for longer exports. It also just auto-downloads the file, which is maybe not what we want if its large. Might be better to just show a link, and let the user trigger it in their browser separately.

Note

Export button is in the dropdown on the survey page.
image

@NickPhura NickPhura added the Early Feedback Welcome PR is not finished, but early review feedback is welcomed label Apr 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 73.03371% with 72 lines in your changes missing coverage. Please review.

Project coverage is 48.57%. Comparing base (556ba8d) to head (0577889).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...es/surveys/view/survey-export/SurveyExportForm.tsx 7.69% 24 Missing ⚠️
...rt-services/telemetry/export-telemetry-strategy.ts 45.83% 13 Missing ⚠️
.../surveys/view/survey-export/SurveyExportDialog.tsx 52.00% 12 Missing ⚠️
api/src/services/export-services/export-service.ts 86.27% 7 Missing ⚠️
api/src/database/db.ts 20.00% 4 Missing ⚠️
app/src/features/surveys/view/SurveyHeader.tsx 25.00% 3 Missing ⚠️
api/src/repositories/survey-critter-repository.ts 0.00% 2 Missing ⚠️
...ervices/observation/export-observation-strategy.ts 86.66% 2 Missing ⚠️
...services/survey/export-survey-metadata-strategy.ts 86.66% 2 Missing ⚠️
api/src/__mocks__/db.ts 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1273      +/-   ##
==========================================
+ Coverage   48.28%   48.57%   +0.28%     
==========================================
  Files         763      771       +8     
  Lines       20465    20704     +239     
  Branches     3124     3135      +11     
==========================================
+ Hits         9882    10056     +174     
- Misses      10431    10496      +65     
  Partials      152      152              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NickPhura NickPhura removed the Early Feedback Welcome PR is not finished, but early review feedback is welcomed label May 8, 2024
Copy link

sonarcloud bot commented Jun 6, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@NickPhura NickPhura marked this pull request as ready for review August 1, 2024 20:18
@NickPhura NickPhura marked this pull request as ready for review September 11, 2024 19:27
@NickPhura NickPhura added the Ready For Review PR is ready for review label Sep 11, 2024
@NickPhura
Copy link
Collaborator Author

Added some unit tests

Copy link

sonarcloud bot commented Sep 16, 2024

Copy link
Collaborator

@mauberti-bc mauberti-bc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mauberti-bc mauberti-bc merged commit 1c26829 into dev Sep 17, 2024
22 checks passed
@mauberti-bc mauberti-bc deleted the SIMSBIOHUB-562 branch September 17, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants