nasa / earthdata-search

Earthdata Search is a web application developed by NASA EOSDIS to enable data discovery, search, comparison, visualization, and access across EOSDIS' Earth Science data holdings.
https://search.earthdata.nasa.gov
Other
743 stars 221 forks source link

EDSC-4195: Add/expand Metric event for Spatial filtering #1769

Closed eudoroolivares2016 closed 2 months ago

eudoroolivares2016 commented 2 months ago

Overview

What is the feature?

This is to add a metric for spatial selection so that we can track when users select a shape using the spatialSelectionsDropDownMenu in the feature analysis it was requested to be able to take those values and compare them against when users are using the leaflet edit-control for the map which we already track as map event. This also reduces some technical debt by removing some console logs which were not necessary and flooded the dev console in serverless-offline, updates class components into functional components, and updates some tests written in Enzyme into RT. This also works a bug in the SpatialSelection component where an error was getting thrown whenever a user would edit and save an existing shape on the map. This also adds Circle to the possible prints for the spatialEdit metric which is meant to capture that behavior

What is the Solution?

Create new metric, update existing components, and tests,

For the spatialSelection bug the issue was that the state in the onStop was not consistent across the two callback functions so I added a reference which is always up to date with the current state

What areas of the application does this impact?

List impacted areas.

Testing

Reproduction steps

Two types of tests will be needed here.

1) We need to do a regression test of the spatialSelectionDropdown to ensure that the update maintains the same functionality. We also need to ensure that the error message from the edit shape is no longer getting reported.

2) We need to test that the metric is going to the google data layer correctly. One way to do this is to use the preview feature of google looker studio. Create a new workspace clone but, also include the new tag that you are using ensure that given the action (selecting the shape from the dropdown) an event is registered on google tag manager. If we can test e2e that would be better i.e. add the tag into GA as a custom param then pull in that custom param into a new looker-studio document to visualize events. We will need a GA account tied to the lower-env for that to work though.

Attachments

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 72.72727% with 9 lines in your changes missing coverage. Please review.

Project coverage is 82.18%. Comparing base (762dadc) to head (b1694bc).

Files Patch % Lines
...s/components/SpatialSelection/SpatialSelection.jsx 16.66% 5 Missing :warning:
...onents/SpatialDisplay/SpatialSelectionDropdown.jsx 81.25% 2 Missing and 1 partial :warning:
...ownContainer/SpatialSelectionDropdownContainer.jsx 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1769 +/- ## ======================================= Coverage 82.18% 82.18% ======================================= Files 696 696 Lines 17430 17434 +4 Branches 4572 4574 +2 ======================================= + Hits 14324 14328 +4 Misses 2892 2892 Partials 214 214 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.