feat: derive Get Directions link in locator from ref_listings if present #860
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.
Updates the locator to derive the Get Directions link on result cards from the ref_listings field in the search response if present, otherwise fallback to the yextDisplayCoordinate. If that is also not present, don't display the get direction button.
Copies the logic in #846 to determine the URL.
J=WAT-5136
TEST=manual
Created a locator in the Krusty dev account (514581), which has some entities with ref_listings data pointing to simulated URLs. Confirmed that when the ref_listings field in the search response had a listingUrl for a GOOGLEMYBUSINESS publisher, the Get Directions button pointed to the listingUrl rather than the Google Maps one generated from the yextDisplayCoordinate field. Confirmed that when the ref_listings field was empty or did not have a GOOGLEMYBUSINESS publisher, the yextDisplayCoordinate field was used to generate the Get Direction URL instead.
jam:https://jam.dev/c/a41f5a6d-1491-4a7a-96aa-936766e204e6