ConservationMetrics / guardianconnector-views

A Nuxt.js tool that reads data from a SQL database and renders it on different views (map, gallery, alerts dashboard)
MIT License
3 stars 0 forks source link

Add download all alerts buttons to `AlertsIntroPanel` #24

Closed rudokemper closed 6 months ago

rudokemper commented 6 months ago

Closes https://github.com/ConservationMetrics/guardianconnector-views/issues/16 (insofar as it ticks the last item off the list!)

This PR uses the Download component that was added previously to allow the user to download all of the data as CSV or GeoJSON in the AlertsIntroPanel view.

Download now has separate downloadAlertCSV / downloadAlertGeoJSON and downloadAllCSV / downloadAllGeoJSON functions, and a typeOfData prop passed by an upstream component determines which one is run. (In order to parse the data differently depending on which kind of dataset is passed to it, a singular alert or the entire alert dataset.)