fix(tour): restore location map and schedule button

This commit is contained in:
DeCentN2Madness committed 2026-11-01 16:41:20 -07:00
1 parent 8dff6a5ad0
commit b5e606a839
4 files changed
+95 -2

No files matched your search

+37
View File
@@ -4367,3 +4367,40 @@ because credentials were unavailable. No private markup or resources are tracked
The Spanish extra dropdown choices remain a Jotform Builder review item, with The Spanish extra dropdown choices remain a Jotform Builder review item, with
fixed Astro context/locale URLs verified. See fixed Astro context/locale URLs verified. See
[focused evidence and remaining acceptance](phase-9-drawer-portal-corrections-2026-10-30.md). [focused evidence and remaining acceptance](phase-9-drawer-portal-corrections-2026-10-30.md).
## 2026-11-01 — Tour map and CTA restoration
Compared the public `/tour` HTML retrieved with normal TLS validation on
2026-11-01 against the migrated page. The source ends with a centered filled
“Schedule a Tour Today” link to `/client-consultation`, followed by a full-width
360px Leaflet 1.9.4 map. Restored the CTA using the existing AIA `Button`
component and added a Tour-only map below the content container.
The map preserves the source view `[33.63, -111.88756]`, zoom 12, clinic marker
`[33.617746, -111.88756]`, OpenStreetMap attribution, 124px logo and directions
popup. Leaflet CSS/JS use the same version and SRI hashes already used by Contact;
tile requests go to `tile.openstreetmap.org`. These are external map dependencies,
not self-hosted assets. No analytics, forms, clinical copy, metadata or routes
changed. The logo is local. Intentional accessibility/reliability improvements:
meaningful region/marker labels, visible link focus, safe new-tab links, correctly
encoded directions destination and address/directions fallback when JavaScript
or Leaflet is unavailable. Existing nine-photo gallery and captions are unchanged.
Validation: Astro check/build passed (128 pages); link audit found zero broken
internal links; five Phase 8 accessibility tests and the focused nine-photo Tour
regression passed. Chromium comparison against the retrieved live HTML and the
local build at 390px and 1440px passed: both maps span the viewport at 360px
height, all 4/12 requested map tiles loaded, marker/directions popup rendered,
and the Astro page had no horizontal overflow or JavaScript exceptions. The
CTA matches source fill/border `#ffbd59`, text `#254080` and no underline, using
the established Astro button proportions rather than copying HubSpot CSS.
No-JavaScript address/directions and consultation-link fallback passed.
Evidence and full-page/map screenshots: `/tmp/aia-tour-review-hknOnA/`.
Read-only map/static asset GETs were allowed; unrelated vendor scripts and
tracking requests were blocked. Consequently the live reference reported missing
jQuery errors, while the Astro page reported none; this was a bounded map/CTA
comparison, not validation of all live HubSpot functionality. An initial test
selector matched both directions and the popup-close link; narrowing it to the
external directions link resolved the test-only failure. No account changes,
submissions, deployment, staging or commit occurred.
+50
View File
@@ -0,0 +1,50 @@
---
const directions = 'https://www.google.com/maps/dir/?api=1&destination=8901%20E%20Raintree%20Dr%20Ste%20160%2C%20Scottsdale%2C%20AZ%2085260';
---
<section class="tour-map-section" aria-label="AIA Scottsdale location map">
<div id="aia-tour-map" class="tour-map"></div>
<p data-tour-map-fallback>
Arizona Institute for Autism — 8901 E Raintree Dr, Ste 160, Scottsdale, AZ 85260.
<a href={directions} target="_blank" rel="noopener noreferrer">Get Directions</a>
</p>
</section>
<script is:inline src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<script is:inline define:vars={{ directions }}>
(() => {
const element = document.getElementById('aia-tour-map');
if (!element || !window.L || element.dataset.initialized) return;
const map = window.L.map(element).setView([33.63, -111.88756], 12);
element.dataset.initialized = 'true';
const tiles = window.L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
tiles.on('tileload', ({ tile }) => {
tile.alt = 'OpenStreetMap tile showing the area around Arizona Institute for Autism in Scottsdale, AZ';
});
tiles.addTo(map);
window.L.marker([33.617746, -111.88756], {
alt: 'Arizona Institute for Autism, Scottsdale',
title: 'Arizona Institute for Autism, Scottsdale'
}).addTo(map).bindPopup(`
<span class="tour-map__popup">
<b>Arizona Institute for Autism</b><br>
<img alt="Arizona Institute for Autism" src="/assets/images/aia-logo.svg" width="124"><br>
<a href="${directions}" target="_blank" rel="noopener noreferrer">Get Directions</a>
</span>
`).openPopup();
// Keep address/directions available without JavaScript or if Leaflet is blocked.
document.querySelector('[data-tour-map-fallback]')?.setAttribute('hidden', '');
})();
</script>
<style>
.tour-map-section { background: white; margin: 0; padding: 0; }
.tour-map { height: 360px; width: 100%; }
.tour-map :global(.tour-map__popup) { display: block; text-align: center; }
.tour-map :global(.tour-map__popup img) { margin-bottom: .5rem; }
.tour-map :global(a:focus-visible) { outline: 3px solid var(--color-focus, #115bbd); outline-offset: 2px; }
[data-tour-map-fallback] { margin: 0; padding: 1rem; text-align: center; }
[hidden] { display: none; }
</style>
+4 -1
View File
@@ -8,6 +8,7 @@ translationKey: "tour"
draft: false draft: false
--- ---
import ImageCarousel from '../../../components/ImageCarousel.astro'; import ImageCarousel from '../../../components/ImageCarousel.astro';
import Button from '../../../components/Button.astro';
import tourGallery from '../../../data/tour-gallery.json'; import tourGallery from '../../../data/tour-gallery.json';
## Tour Arizona Institute for Autism ## Tour Arizona Institute for Autism
@@ -50,4 +51,6 @@ Arizona's Leading Modern Learning Experience for Children Diagnosed with Autism
- On-Site Clinical Case Supervisor - On-Site Clinical Case Supervisor
[Schedule a Tour Today](/client-consultation) <div style={{ textAlign: 'center', marginBlock: '2.5rem' }}>
<Button href="/client-consultation">Schedule a Tour Today</Button>
</div>
+4 -1
View File
@@ -7,6 +7,7 @@ import AboutPage from '../components/pages/AboutPage.astro';
import ServicesPage from '../components/pages/ServicesPage.astro'; import ServicesPage from '../components/pages/ServicesPage.astro';
import CareersPage from '../components/pages/CareersPage.astro'; import CareersPage from '../components/pages/CareersPage.astro';
import ContactPage from '../components/pages/ContactPage.astro'; import ContactPage from '../components/pages/ContactPage.astro';
import TourMap from '../components/TourMap.astro';
import FaqPage from '../components/pages/FaqPage.astro'; import FaqPage from '../components/pages/FaqPage.astro';
import InsurancePage from '../components/pages/InsurancePage.astro'; import InsurancePage from '../components/pages/InsurancePage.astro';
import PageHero from '../components/PageHero.astro'; import PageHero from '../components/PageHero.astro';
@@ -55,13 +56,14 @@ const pageTitles: Record<string, Record<string, string>> = {
const bannerTitle = serviceTitles[entry.data.lang]?.[entry.data.slug] || pageTitles[entry.data.lang]?.[entry.data.slug] || entry.data.title.split('|')[0].trim(); const bannerTitle = serviceTitles[entry.data.lang]?.[entry.data.slug] || pageTitles[entry.data.lang]?.[entry.data.slug] || entry.data.title.split('|')[0].trim();
const isService = Boolean(serviceTitles[entry.data.lang]?.[entry.data.slug]); const isService = Boolean(serviceTitles[entry.data.lang]?.[entry.data.slug]);
const route = entry.data.lang === 'en' ? `/${entry.data.slug}` : `/${entry.data.lang}/${entry.data.slug}`; const route = entry.data.lang === 'en' ? `/${entry.data.slug}` : `/${entry.data.lang}/${entry.data.slug}`;
const isTour = entry.data.lang === 'en' && entry.data.slug === 'tour';
const heroImage = pageHeroImages[entry.data.slug]; const heroImage = pageHeroImages[entry.data.slug];
if (entry.data.slug === 'team' && entry.data.lang === 'en' && !entry.data.team) { if (entry.data.slug === 'team' && entry.data.lang === 'en' && !entry.data.team) {
throw new Error('The English Team page requires structured team frontmatter.'); throw new Error('The English Team page requires structured team frontmatter.');
} }
--- ---
<BaseLayout title={entry.data.title} description={entry.data.description} image={entry.data.featuredImage || heroImage} lang={entry.data.lang}> <BaseLayout title={entry.data.title} description={entry.data.description} image={entry.data.featuredImage || heroImage} lang={entry.data.lang}>
{entry.data.slug === 'contact' && <Fragment slot="head"><link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" /></Fragment>} {(entry.data.slug === 'contact' || isTour) && <Fragment slot="head"><link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" /></Fragment>}
<PageHero title={entry.data.displayH1 ?? bannerTitle} subtitle={entry.data.slug === 'faqs' ? 'FAQs' : undefined} image={heroImage} constrain /> <PageHero title={entry.data.displayH1 ?? bannerTitle} subtitle={entry.data.slug === 'faqs' ? 'FAQs' : undefined} image={heroImage} constrain />
{entry.data.slug === 'team' && entry.data.lang === 'en' {entry.data.slug === 'team' && entry.data.lang === 'en'
? <TeamPage content={entry.data.team!} /> ? <TeamPage content={entry.data.team!} />
@@ -82,6 +84,7 @@ if (entry.data.slug === 'team' && entry.data.lang === 'en' && !entry.data.team)
: entry.data.slug === 'contact' : entry.data.slug === 'contact'
? <ContactPage title={bannerTitle} lang={entry.data.lang}><slot /></ContactPage> ? <ContactPage title={bannerTitle} lang={entry.data.lang}><slot /></ContactPage>
: <article class:list={['prose', 'source-page', 'container', { 'service-page': isService }]}><slot /></article>} : <article class:list={['prose', 'source-page', 'container', { 'service-page': isService }]}><slot /></article>}
{isTour && <TourMap />}
{isService && (entry.data.lang === 'en' || entry.data.lang === 'es') && <ServiceInquiryDrawer service={entry.data.slug} lang={entry.data.lang} route={route} />} {isService && (entry.data.lang === 'en' || entry.data.lang === 'es') && <ServiceInquiryDrawer service={entry.data.slug} lang={entry.data.lang} route={route} />}
{showForm && <FormShell lang={entry.data.lang} route={route} title={bannerTitle} logicalForm={entry.data.slug === 'referrals' ? 'referral' : 'service'} showBackground={entry.data.slug === 'client-consultation'} />} {showForm && <FormShell lang={entry.data.lang} route={route} title={bannerTitle} logicalForm={entry.data.slug === 'referrals' ? 'referral' : 'service'} showBackground={entry.data.slug === 'client-consultation'} />}
</BaseLayout> </BaseLayout>