Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Enable downloading facility list item matches CSV #233

Merged
merged 1 commit into from Mar 1, 2019

Conversation

kellyi
Copy link
Contributor

@kellyi kellyi commented Feb 26, 2019

Overview

This PR enables users to download CSVs of facility match data from the list details page. I created a suite of utility functions and tests for formatting the data into a 2-d array, then used Papaparse along with the existing FileSaver library to handle downloading it.

Connects #204

Demo

screen shot 2019-02-27 at 3 06 21 pm

Sample CSV:

15_list eight_2_27_2019.csv.txt

Notes

Only the second commit is work for this issue, but feel free to test the first commit too (which is properly up as a PR in #235)

Testing

  • get this branch then ./scripts/update
  • serve this branch, then upload and process a facility list
  • click the download button to verify that the download works and the data is formatted correctly into columns
  • verify that the set of columns is the correct set for this phrase of work
  • run ./scripts/test to verify that the tests pass

@kellyi kellyi force-pushed the ki/download-facility-list-items-csv branch 5 times, most recently from fc11836 to 0ae934a Compare February 27, 2019 20:04
@kellyi kellyi changed the title WIP Enable downloading facility list item matches CSV Enable downloading facility list item matches CSV Feb 27, 2019
@kellyi kellyi requested a review from jwalgran February 27, 2019 20:15
@kellyi kellyi marked this pull request as ready for review February 27, 2019 20:15
@kellyi kellyi force-pushed the ki/download-facility-list-items-csv branch 2 times, most recently from 3484a05 to c156d42 Compare February 28, 2019 16:47
@kellyi
Copy link
Contributor Author

kellyi commented Feb 28, 2019

I rebased this on develop.

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

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

This is working perfectly in Chrome, Firefox, and Safari on Mac and IE 11 on Windows. The implementation is straightforward and clear.

I commented on #204 that I think we should include lat and lng columns, which will require modifying the FacilityListItemSerializer.

@kellyi
Copy link
Contributor Author

kellyi commented Feb 28, 2019

cabf1b7 updates the serializer and the csv export functionality to add the following fields for rows:

  • matched_facility_lng
  • matched_facility_lat
  • potential_match_lng
  • potential_match_lat

& also updates the tests and prop types.

@jwalgran
Copy link
Contributor

jwalgran commented Mar 1, 2019

Looking at this now

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

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

Working well.

@jwalgran jwalgran removed their assignment Mar 1, 2019
- add papaparse library
- create utility functions to format list items data into CSV rows
- add tests for CSV download utility functions
- update list details page header to have buttons for downloading CSVs
and returning to the main lists page
@kellyi kellyi force-pushed the ki/download-facility-list-items-csv branch from cabf1b7 to a588b10 Compare March 1, 2019 18:00
@kellyi
Copy link
Contributor Author

kellyi commented Mar 1, 2019

Thanks!

@kellyi kellyi merged commit 76a1ea9 into develop Mar 1, 2019
@kellyi kellyi deleted the ki/download-facility-list-items-csv branch March 1, 2019 18:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants