-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualize Mapeo alert data on alertsDashboard
#48
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #47.
Goal
This PR adds a comprehensive workflow to add Mapeo data to the alerts API and dashboard, and have all of the same behaviors as alerts (e.g. select a feature, change the color when selected, view in sidebar, download CSV/GeoJSON).
Screenshots
Can also explore here: https://bcm-views.guardianconnector.net/alerts/fake_alerts
What I changed
MAPEO_TABLE
andMAPEO_CATEGORY_IDS
) for an alerts view inNUXT_ENV_VIEWS_CONFIG
./alerts
API will pull data from theMAPEO_TABLE
var and filter only theMAPEO_CATEGORY_IDS
- the idea here is that only specific categoryIds (e.g. those related to threats) from a Mapeo dataset should be shown on the map.AlertsDashboard
receives this data from the API response as a prop, and using a new functionaddMapeoData
, adds it to the map.addDataToMap
anddata
were renamed toaddAlertsData
andalertsData
, respectively.featuresUnderCursor
helper variable to store the number of features under the cursor. Now, the cursor only resets when that var is equal to 0, resolving the issue.isAlert
variable based on "Alert ID" field to differentiate alerts from Mapeo data, and use that to conditionally show/hide Media for each.Download
,Feature
,Map
,mapFunctions
(related toLegend
) to get Mapeo data to work for the respective tasks in each component and/or look nicer.Features
, conditionally render a fielddata_source
as a header. (For now, I just assume that it exists in the database table; would like to think through if this possible to introduce in frizzle.)transformData
to render thecreated
andmodified
fields as legible dates in the sidebar.mapFunctions
, I introduced new functionprepareCoordinatesForSelectedFeature
to rewrite a Mapeo [long,lat] coordinate to show as lat, long in the sidebar instead (e.g. for usage in Google Maps).What I'm not doing here