This shows an alert detection range of up to January 2024, but date of most recent alerts published in December 2023.
In other words, no alerts were generated in January 2024.
What I changed
In fetchData, fetch and return the __metadata table if it exists, much like we do for __columns tables generated by frizzle.
In prepareAlertStatistics, if metadata is provided, use the month and year fields to populate the earliest and latest dates.
What I'm not doing here
Using the alerts metadata to update some of the other statistics fields, such as alertsTotal, recentAlertsDate, or recentAlertsNumber. I've gone back and forth on whether to use the metadata or the actual alerts published as the source of truth for these. I'm opting for the actual alerts published, because there could be an edge case scenario where there is a mismatch between the CSV and the actual alerts published, in which case we'll want the statistics to reflect what's actually shown on the map.
Goal
To use an alerts metadata table, if found, to compile some of the statistics for alerts on the
AlertsDashboard
component.This PR supplements the proposed work in https://github.com/ConservationMetrics/frizzle/issues/134 to create an
{table_alias}__metadata
table from a CSV published by a change detection data alerts provider.Screenshots
What I changed
fetchData
, fetch and return the__metadata
table if it exists, much like we do for__columns
tables generated by frizzle.prepareAlertStatistics
, if metadata is provided, use the month and year fields to populate the earliest and latest dates.What I'm not doing here
Using the alerts metadata to update some of the other statistics fields, such as
alertsTotal
,recentAlertsDate
, orrecentAlertsNumber
. I've gone back and forth on whether to use the metadata or the actual alerts published as the source of truth for these. I'm opting for the actual alerts published, because there could be an edge case scenario where there is a mismatch between the CSV and the actual alerts published, in which case we'll want the statistics to reflect what's actually shown on the map.