diff --git a/packages/visual-editor/src/components/Locator.test.tsx b/packages/visual-editor/src/components/Locator.test.tsx index eb0fe196f..1756f49f1 100644 --- a/packages/visual-editor/src/components/Locator.test.tsx +++ b/packages/visual-editor/src/components/Locator.test.tsx @@ -78,6 +78,7 @@ const createLocatorApiResult = ({ distance, distanceFromFilter, services, + comingSoon = false, }: { id: string; name: string; @@ -91,6 +92,7 @@ const createLocatorApiResult = ({ distance: number; distanceFromFilter: number; services: string[]; + comingSoon?: boolean; }) => ({ data: { id, @@ -107,6 +109,7 @@ const createLocatorApiResult = ({ }, additionalHoursText: "Holiday hours may vary", hours: LOCATOR_TEST_HOURS, + comingSoon, mainPhone: "+12025550101", emails: [`${id}@example.com`], services, @@ -286,7 +289,19 @@ const createLocatorFetchMock = (document: Record) => { if (url.includes("/search/vertical/query")) { return new Response( - JSON.stringify(createLocatorVerticalSearchResponse(results)), + JSON.stringify( + createLocatorVerticalSearchResponse( + document.comingSoon + ? results.map((result: any) => ({ + ...result, + data: { + ...result.data, + comingSoon: true, + }, + })) + : results + ) + ), { status: 200, } @@ -346,6 +361,37 @@ const tests: ComponentTest[] = [ props: { ...LocatorComponent.defaultProps }, version: migrationRegistry.length, }, + { + name: "version 74 comingSoon", + document: { + locale: "en", + businessId: "4174974", + comingSoon: true, + __: { + isPrimaryLocale: true, + }, + _env: { + ...LOCATOR_TEST_ENV, + }, + _pageset: JSON.stringify({ + type: "LOCATOR", + typeConfig: { + locatorConfig: { + source: "accounts/4174974/sites/155048/pagesets/locations", + experienceKey: "locator-41", + entityType: "location", + }, + }, + config: { + urlTemplate: { + primary: "[[address.region]]/[[address.city]]/[[address.line1]]", + }, + }, + }), + }, + props: { ...LocatorComponent.defaultProps }, + version: 74, + }, { name: "latest version multi-pageset default props", document: { diff --git a/packages/visual-editor/src/components/LocatorResultCard.tsx b/packages/visual-editor/src/components/LocatorResultCard.tsx index 5ce6d1d74..949cc2655 100644 --- a/packages/visual-editor/src/components/LocatorResultCard.tsx +++ b/packages/visual-editor/src/components/LocatorResultCard.tsx @@ -1246,61 +1246,69 @@ const HoursSection = (props: { const comingSoon = location["comingSoon"]; const showHoursSection = (hoursData || comingSoon) && hoursProps.liveVisibility; + const hoursStatusRow = ( +
+ {showIcons && ( + + + + )} + +
+ ); + return ( showHoursSection && (
- - setIsExpanded(event.currentTarget.open)} - > - -
- {showIcons && ( - - - - )} - -
-
- + setIsExpanded(event.currentTarget.open)} > -
- - {location.additionalHoursText && - hoursProps.table.showAdditionalHoursText && ( -
- {location.additionalHoursText} -
- )} -
-
-
-
+ + {hoursStatusRow} + + +
+ + {location.additionalHoursText && + hoursProps.table.showAdditionalHoursText && ( +
+ {location.additionalHoursText} +
+ )} +
+
+ + + )}
) ); diff --git a/packages/visual-editor/src/components/testing/screenshots/Locator/[desktop] version 74 comingSoon.png b/packages/visual-editor/src/components/testing/screenshots/Locator/[desktop] version 74 comingSoon.png new file mode 100644 index 000000000..e0738cd77 Binary files /dev/null and b/packages/visual-editor/src/components/testing/screenshots/Locator/[desktop] version 74 comingSoon.png differ diff --git a/packages/visual-editor/src/components/testing/screenshots/Locator/[mobile] version 74 comingSoon.png b/packages/visual-editor/src/components/testing/screenshots/Locator/[mobile] version 74 comingSoon.png new file mode 100644 index 000000000..0eaa7d017 Binary files /dev/null and b/packages/visual-editor/src/components/testing/screenshots/Locator/[mobile] version 74 comingSoon.png differ diff --git a/packages/visual-editor/src/components/testing/screenshots/Locator/[tablet] version 74 comingSoon.png b/packages/visual-editor/src/components/testing/screenshots/Locator/[tablet] version 74 comingSoon.png new file mode 100644 index 000000000..5f321783c Binary files /dev/null and b/packages/visual-editor/src/components/testing/screenshots/Locator/[tablet] version 74 comingSoon.png differ diff --git a/packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 59 with showSectionHeading false.png b/packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 59 with showSectionHeading false.png index b9bf47805..78479fbdf 100644 Binary files a/packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 59 with showSectionHeading false.png and b/packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 59 with showSectionHeading false.png differ