Skip to content

feat: download data as a CSV#412

Merged
eatyourgreens merged 1 commit intodevelopmentfrom
csv-download
Apr 29, 2024
Merged

feat: download data as a CSV#412
eatyourgreens merged 1 commit intodevelopmentfrom
csv-download

Conversation

@eatyourgreens
Copy link
Copy Markdown
Collaborator

Convert group dosing data and group observations to a single CSV file for all subject groups. CSV headers are taken from a standardised list used by the Django app.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.63%. Comparing base (7027bd1) to head (ba96db3).
Report is 20 commits behind head on development.

Additional details and impacted files
@@             Coverage Diff              @@
##           development     #412   +/-   ##
============================================
  Coverage        76.62%   76.63%           
============================================
  Files              107      107           
  Lines             5558     5559    +1     
============================================
+ Hits              4259     4260    +1     
  Misses            1299     1299           

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

Comment thread frontend-v2/src/features/data/Data.tsx Outdated
Comment thread frontend-v2/src/features/data/Data.tsx Outdated
Comment on lines +25 to +29
const HEADERS: string[] = [
'ID', 'Group', 'Time', 'Time_unit',
'Observation', 'Observation Unit', 'Observation ID', 'Observation Variable',
'Administration ID', 'Amount', 'Amt_unit', 'Amount Variable',
'Route', 'II', 'ADDL'
];
Copy link
Copy Markdown
Collaborator Author

@eatyourgreens eatyourgreens Apr 25, 2024

Choose a reason for hiding this comment

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

I think this covers all the columns that are needed in an export, but we can change it as needed.

@eatyourgreens eatyourgreens force-pushed the csv-download branch 3 times, most recently from e17b319 to 2c71cc4 Compare April 25, 2024 19:46
@eatyourgreens eatyourgreens marked this pull request as ready for review April 25, 2024 19:53
Comment thread frontend-v2/src/features/data/Data.tsx Outdated
function downloadCSV() {
const csv = generateCSV(dataset, groups, subjectBiomarkers, units);
console.log(csv)
const blob = new Blob(['\ufeff', csv], { type: 'text/csv' });
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

'\ufeff` here is the Unicode BOM. Without it, unicode characters get mangled during the download.

@eatyourgreens eatyourgreens force-pushed the csv-download branch 4 times, most recently from 0666209 to 81ec69f Compare April 29, 2024 07:54
Convert group dosing data and group observations to a single CSV file for all subject groups. CSV headers are taken from a standardised list used by the Django app. Remove the previous download button, on the last step of the data stepper, and replace it with a download button in the Data tab.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'pkpdapp'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'pkpdapp-team_pkpdapp_frontend'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@eatyourgreens eatyourgreens merged commit 77eeb4e into development Apr 29, 2024
@eatyourgreens eatyourgreens deleted the csv-download branch April 29, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant