From 708ef0001f0acdca1cb2ba5bd8ee49ba1f4e970b Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:36:24 -0500 Subject: [PATCH 1/4] fix(map-popup): prevent null closepopup, fix ids --- packages/map-popup/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/map-popup/src/index.tsx b/packages/map-popup/src/index.tsx index 6f699803e..6f1e03b3e 100644 --- a/packages/map-popup/src/index.tsx +++ b/packages/map-popup/src/index.tsx @@ -101,7 +101,7 @@ function entityIsStation(entity: Entity): entity is Station { /** * Renders a map popup for a stop, scooter, or shared bike */ -export function MapPopup({ closePopup = null, configCompanies, entity, getEntityName, setLocation, setViewedStop }: Props): JSX.Element { +export function MapPopup({ closePopup = () => null, configCompanies, entity, getEntityName, setLocation, setViewedStop }: Props): JSX.Element { const intl = useIntl() if (!entity) return <> @@ -115,7 +115,7 @@ export function MapPopup({ closePopup = null, configCompanies, entity, getEntity const stopId = !bikesAvailablePresent && entity?.code || entity.id.split(":")[1] || entity.id // Double quotes make the query invalid, so remove them from the id just in case - const id = `focus-${entity.id}-popup`.replace(/"/g, "") + const id = `focus-${encodeURIComponent(entity.id).replace(/%/g, "")}-popup` return ( From 570c7aef2a1ecb06df4e7b35d0c228b541d35ef5 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:39:39 -0500 Subject: [PATCH 2/4] fix(otp2-tile-overlay): pass closepopup to map-popup --- packages/otp2-tile-overlay/src/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/otp2-tile-overlay/src/index.tsx b/packages/otp2-tile-overlay/src/index.tsx index 58f0a9a5d..09199b297 100644 --- a/packages/otp2-tile-overlay/src/index.tsx +++ b/packages/otp2-tile-overlay/src/index.tsx @@ -192,6 +192,7 @@ const OTP2TileLayerWithPopup = ({ onClose={() => setClickedEntity(null)} > setClickedEntity(null)} configCompanies={configCompanies} entity={{ ...clickedEntity, id: clickedEntity?.id || clickedEntity?.gtfsId }} setLocation={setLocation ? (location) => { setClickedEntity(null); setLocation(location) } : null} From 455fa204d2c7f3cdbb536560d1e424cc1f47559b Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:45:34 -0500 Subject: [PATCH 3/4] change default close popup map-popup function --- packages/map-popup/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/map-popup/src/index.tsx b/packages/map-popup/src/index.tsx index 6f1e03b3e..0d4f913e8 100644 --- a/packages/map-popup/src/index.tsx +++ b/packages/map-popup/src/index.tsx @@ -101,7 +101,7 @@ function entityIsStation(entity: Entity): entity is Station { /** * Renders a map popup for a stop, scooter, or shared bike */ -export function MapPopup({ closePopup = () => null, configCompanies, entity, getEntityName, setLocation, setViewedStop }: Props): JSX.Element { +export function MapPopup({ closePopup = () => {}, configCompanies, entity, getEntityName, setLocation, setViewedStop }: Props): JSX.Element { const intl = useIntl() if (!entity) return <> From 45820a9b826b90182cdcaa1dc83c43ff748666fb Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:05:08 -0500 Subject: [PATCH 4/4] update snapshots --- packages/map-popup/src/__snapshots__/MapPopup.story.tsx.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/map-popup/src/__snapshots__/MapPopup.story.tsx.snap b/packages/map-popup/src/__snapshots__/MapPopup.story.tsx.snap index 809b8c3bd..9ba1045f3 100644 --- a/packages/map-popup/src/__snapshots__/MapPopup.story.tsx.snap +++ b/packages/map-popup/src/__snapshots__/MapPopup.story.tsx.snap @@ -59,7 +59,7 @@ exports[`Map Popup FloatingCarEntity smoke-test 1`] = ` exports[`Map Popup FloatingVehicleEntity smoke-test 1`] = `
-