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

Return Mapeo data in `alerts/` GET endpoint; add Mapeo alert data to `AlertsDashboard` component #47

Closed rudokemper closed 2 months ago

rudokemper commented 3 months ago

Feature Request

To complete the end-to-end alerts workflow, we need to show Mapeo data related to the alerts on the Alerts Dashboard. To accomplish this, we need to know the following information at minimum:

  1. What is the name of the db table where the Mapeo data is stored.
  2. What are the categoryIds from the Mapeo configuration that are relevant to alerts.

With this information, we can expand the /{table}/alerts API endpoint to query the db table for only those categoryId specified in the env var, include it in the response.

From there, we can add the Mapeo data to the map much like we do for the Map view, with a Mapbox event listener to open the Mapeo data in the sidebar.

Implementation Plan

rudokemper commented 2 months ago

Acceptance criteria: