diff --git a/www/src/components/FormShell.astro b/www/src/components/FormShell.astro index 28acc45..daca858 100644 --- a/www/src/components/FormShell.astro +++ b/www/src/components/FormShell.astro @@ -7,7 +7,7 @@ import { formModeForRuntime, resolveFormAIframe, resolveFormMode, resolveMockFor const { lang = 'en', showBackground = false, route = '' } = Astro.props; const text = formMessages(lang); const title = Astro.props.title ?? text.heading; -const logicalForm: LogicalForm = Astro.props.logicalForm ?? (Astro.props.title === 'Physician & Insurer Referrals' ? 'referral' : 'service'); +const logicalForm: LogicalForm = Astro.props.logicalForm ?? 'service'; const config = resolveFormMode(import.meta.env.PUBLIC_AIA_FORMS_MODE); const mode = formModeForRuntime(config); const mockResult = resolveMockFormResult(import.meta.env.PUBLIC_AIA_FORMS_MOCK_RESULT); diff --git a/www/src/content/pages/en/referrals.mdx b/www/src/content/pages/en/referrals.mdx index 903aafc..0aaced2 100644 --- a/www/src/content/pages/en/referrals.mdx +++ b/www/src/content/pages/en/referrals.mdx @@ -26,4 +26,4 @@ At the Arizona Institute for Autism, we are here to support your clients reach n To provide the highest level of optimal care, we know that it is essential to provide a working partnership with the client’s diagnostic provider, physician, and their insurance company. To facilitate this collaboration, we have built a system of reporting metrics on the child’s treatment plan with supporting progress charts we share with our partners. This information keeps everyone involved up to date on the client’s progress and future needs. If you are an insurance company or diagnostic provider interested in working with us, contact us to learn more about our referral process. - + diff --git a/www/src/layouts/PageLayout.astro b/www/src/layouts/PageLayout.astro index 41b02b0..2a41be7 100644 --- a/www/src/layouts/PageLayout.astro +++ b/www/src/layouts/PageLayout.astro @@ -14,7 +14,7 @@ import PageHero from '../components/PageHero.astro'; import ServiceInquiryDrawer from '../components/ServiceInquiryDrawer.astro'; import { pageHeroImages } from '../data/page-visuals'; const { entry } = Astro.props; -const showForm = ['client-consultation', 'schedule-consultation', 'referrals'].includes(entry.data.slug); +const showForm = ['client-consultation', 'schedule-consultation'].includes(entry.data.slug); const serviceTitles: Record> = { en: { 'aba-therapy': 'Behavioral', @@ -86,5 +86,5 @@ if (entry.data.slug === 'team' && entry.data.lang === 'en' && !entry.data.team) :
} {isTour && } {isService && (entry.data.lang === 'en' || entry.data.lang === 'es') && } - {showForm && } + {showForm && } diff --git a/www/src/utils/form-integration.ts b/www/src/utils/form-integration.ts index b70baff..23d58c6 100644 --- a/www/src/utils/form-integration.ts +++ b/www/src/utils/form-integration.ts @@ -1,5 +1,5 @@ export type FormMode = 'live' | 'off' | 'mock'; -export type LogicalForm = 'general' | 'service' | 'referral'; +export type LogicalForm = 'general' | 'service'; export type MockFormResult = 'success' | 'failed' | 'unavailable'; export interface FormModeConfig { @@ -170,7 +170,6 @@ export const formRouteMapping: ReadonlyArray<{ { route: '/client-consultation', logicalForm: 'service', kind: 'native-instance' }, { route: '/es/client-consultation', logicalForm: 'service', kind: 'native-instance' }, { route: '/schedule-consultation', logicalForm: 'service', kind: 'native-instance' }, - { route: '/referrals', logicalForm: 'referral', kind: 'native-instance' }, { route: '/aba-therapy', logicalForm: 'service', kind: 'native-instance' }, { route: '/autism-evaluations', logicalForm: 'service', kind: 'native-instance' }, { route: '/learner-social-club', logicalForm: 'service', kind: 'native-instance' }, diff --git a/www/tools/library.test.mjs b/www/tools/library.test.mjs index 1233f3a..1dec9ea 100644 --- a/www/tools/library.test.mjs +++ b/www/tools/library.test.mjs @@ -1075,7 +1075,7 @@ test('Phase 7 privacy page preserves policy sections and reciprocal eligible nav }); test('Phase 9 off-mode form surfaces localize Spanish without enabling submission', () => { - for (const route of ['/es/contact','/es/client-consultation','/contact','/client-consultation','/referrals','/schedule-consultation']) { + for (const route of ['/es/contact','/es/client-consultation','/contact','/client-consultation','/schedule-consultation']) { const $ = load(artifacts.get('staging').html.get(route)); const form = $('[data-aia-form]'); assert.equal(form.length, 1, route); @@ -1095,6 +1095,18 @@ test('Phase 9 off-mode form surfaces localize Spanish without enabling submissio assert.match($('#aia-openstreetmap').attr('data-tile-alt'), /^Mapa de OpenStreetMap/); }); +test('referrals retains the existing hosted Jotform CTA without rendering a local form', () => { + for (const mode of ['staging', 'indexing']) { + const $ = load(artifacts.get(mode).html.get('/referrals')); + const link = $('main a').filter((_i, element) => $(element).text().trim() === 'Refer a Client'); + assert.equal(link.length, 1, mode); + assert.equal(link.attr('href'), 'https://form.jotform.com/231638510219149'); + assert.ok(link.hasClass('content-button')); + assert.equal($('[data-aia-form], [data-jotform-form-a], #form-title').length, 0); + assert.equal($('main form').length, 0); + } +}); + test('Phase 7 author labels and Arabic credential isolation preserve archive SEO', () => { for (const locale of ['en','es','ar']) { const route = `${locale === 'en' ? '' : `/${locale}`}/library/author/rula-diab`; diff --git a/www/tools/phase9-nonproduction.test.mjs b/www/tools/phase9-nonproduction.test.mjs index 41a3b69..f26731d 100644 --- a/www/tools/phase9-nonproduction.test.mjs +++ b/www/tools/phase9-nonproduction.test.mjs @@ -45,12 +45,12 @@ test('Form A meeting preview requires explicit mock mode and remains staging-onl assert.equal(formAPreviewEnabled('TRUE', 'FALSE', 'mock'), true); }); -test('form mapping covers twelve native instances and five landing journeys', () => { - assert.equal(formRouteMapping.filter((entry) => entry.kind === 'native-instance').length, 12); +test('form mapping covers eleven native instances and five landing journeys', () => { + assert.equal(formRouteMapping.filter((entry) => entry.kind === 'native-instance').length, 11); assert.equal(formRouteMapping.filter((entry) => entry.kind === 'landing-journey').length, 5); assert.equal(logicalFormForRoute('/contact'), 'general'); assert.equal(logicalFormForRoute('/es/client-consultation'), 'service'); - assert.equal(logicalFormForRoute('/referrals'), 'referral'); + assert.equal(logicalFormForRoute('/referrals'), undefined); for (const route of ['/es/aba-therapy', '/es/autism-evaluations', '/es/learner-social-club']) { assert.equal(logicalFormForRoute(route), 'service'); } diff --git a/www/tools/seo.test.mjs b/www/tools/seo.test.mjs index 8f4cf16..cf1f58b 100644 --- a/www/tools/seo.test.mjs +++ b/www/tools/seo.test.mjs @@ -548,7 +548,7 @@ test('Phase 5A conversion CTAs resolve to the intended published local route or ['/es/aba-therapy', 'Solicitar una consulta', '/es/client-consultation'], ['/es/autism-evaluations', 'Solicitar una consulta', '/es/client-consultation'], ['/es/learner-social-club', 'Solicitar una consulta', '/es/client-consultation'], - ['/referrals', 'Refer a Client', '#form-title'], + ['/referrals', 'Refer a Client', 'https://form.jotform.com/231638510219149'], ['/aba-therapy-intake-process', 'Take the First Step', '/client-consultation'], ['/es/aba-therapy-intake-process', 'Take the First Step', '/es/client-consultation'], ['/services', 'Consult with a Client Advocate', '/client-consultation'], @@ -563,6 +563,11 @@ test('Phase 5A conversion CTAs resolve to the intended published local route or assert.equal(link.length, 1, `${route}: ${label}`); assert.equal(link.attr('href'), href, route); const target = new URL(href, site + route); + if (target.origin !== new URL(site).origin) { + assert.equal(route, '/referrals', 'only the explicitly approved referral CTA leaves the site'); + assert.equal(target.href, 'https://form.jotform.com/231638510219149'); + continue; + } const destination = page(target.pathname); if (target.hash) assert.equal(destination(`[id="${target.hash.slice(1)}"]`).length, 1, href); }