feat: allow Nearby Location Section customization - #1337
Conversation
|
Warning: Component files have been updated but no migrations have been added. See https://github.com/yext/visual-editor/blob/main/packages/visual-editor/src/components/migrations/README.md for more information. |
commit: |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe nearby locations editor now supports a configurable title field for cards. It defaults to the location’s Sequence Diagram(s)sequenceDiagram
participant NearbyLocationsCardsWrapper
participant NearbyLocationCard
participant i18n
participant resolveComponentData
NearbyLocationsCardsWrapper->>NearbyLocationCard: Pass configured title and location data
NearbyLocationCard->>i18n: Read current language
NearbyLocationCard->>resolveComponentData: Resolve title against location data as plain text
resolveComponentData-->>NearbyLocationCard: Return resolved title
NearbyLocationCard->>NearbyLocationCard: Use location name if resolved title is blank
Suggested reviewers: Priority: ⬇️ Low Change: Feature Merge Risk: ⚪ Minimal · up to The configured nearby-card title retains a location-name fallback, and the locator test checks the restored search value. No material merge risk was identified. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This uses the locationData from the content endpoint. Similar to how we don't have built-in UI for Locator / Directory changes (to the search config or directory config), we won't have any for Nearby Location Section but if you adjust the fields returned from the content endpoint, you can use them in the Nearby Location Section like so
Had to adjust Locator test for it to pass