fix(referrals): restore existing hosted referral CTA and remove native placeholder
This commit is contained in:
7 files changed
+27
-11
No files matched your search
@@ -7,7 +7,7 @@ import { formModeForRuntime, resolveFormAIframe, resolveFormMode, resolveMockFor
|
|||||||
const { lang = 'en', showBackground = false, route = '' } = Astro.props;
|
const { lang = 'en', showBackground = false, route = '' } = Astro.props;
|
||||||
const text = formMessages(lang);
|
const text = formMessages(lang);
|
||||||
const title = Astro.props.title ?? text.heading;
|
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 config = resolveFormMode(import.meta.env.PUBLIC_AIA_FORMS_MODE);
|
||||||
const mode = formModeForRuntime(config);
|
const mode = formModeForRuntime(config);
|
||||||
const mockResult = resolveMockFormResult(import.meta.env.PUBLIC_AIA_FORMS_MOCK_RESULT);
|
const mockResult = resolveMockFormResult(import.meta.env.PUBLIC_AIA_FORMS_MOCK_RESULT);
|
||||||
|
|||||||
@@ -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.
|
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.
|
||||||
|
|
||||||
<Button href="#form-title" center>Refer a Client</Button>
|
<Button href="https://form.jotform.com/231638510219149" center>Refer a Client</Button>
|
||||||
@@ -14,7 +14,7 @@ import PageHero from '../components/PageHero.astro';
|
|||||||
import ServiceInquiryDrawer from '../components/ServiceInquiryDrawer.astro';
|
import ServiceInquiryDrawer from '../components/ServiceInquiryDrawer.astro';
|
||||||
import { pageHeroImages } from '../data/page-visuals';
|
import { pageHeroImages } from '../data/page-visuals';
|
||||||
const { entry } = Astro.props;
|
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<string, Record<string, string>> = {
|
const serviceTitles: Record<string, Record<string, string>> = {
|
||||||
en: {
|
en: {
|
||||||
'aba-therapy': 'Behavioral',
|
'aba-therapy': 'Behavioral',
|
||||||
@@ -86,5 +86,5 @@ if (entry.data.slug === 'team' && entry.data.lang === 'en' && !entry.data.team)
|
|||||||
: <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 && <OpenStreetMap lang={entry.data.lang} />}
|
{isTour && <OpenStreetMap lang={entry.data.lang} />}
|
||||||
{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="service" showBackground={entry.data.slug === 'client-consultation'} />}
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export type FormMode = 'live' | 'off' | 'mock';
|
export type FormMode = 'live' | 'off' | 'mock';
|
||||||
export type LogicalForm = 'general' | 'service' | 'referral';
|
export type LogicalForm = 'general' | 'service';
|
||||||
export type MockFormResult = 'success' | 'failed' | 'unavailable';
|
export type MockFormResult = 'success' | 'failed' | 'unavailable';
|
||||||
|
|
||||||
export interface FormModeConfig {
|
export interface FormModeConfig {
|
||||||
@@ -170,7 +170,6 @@ export const formRouteMapping: ReadonlyArray<{
|
|||||||
{ route: '/client-consultation', logicalForm: 'service', kind: 'native-instance' },
|
{ route: '/client-consultation', logicalForm: 'service', kind: 'native-instance' },
|
||||||
{ route: '/es/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: '/schedule-consultation', logicalForm: 'service', kind: 'native-instance' },
|
||||||
{ route: '/referrals', logicalForm: 'referral', kind: 'native-instance' },
|
|
||||||
{ route: '/aba-therapy', logicalForm: 'service', kind: 'native-instance' },
|
{ route: '/aba-therapy', logicalForm: 'service', kind: 'native-instance' },
|
||||||
{ route: '/autism-evaluations', logicalForm: 'service', kind: 'native-instance' },
|
{ route: '/autism-evaluations', logicalForm: 'service', kind: 'native-instance' },
|
||||||
{ route: '/learner-social-club', logicalForm: 'service', kind: 'native-instance' },
|
{ route: '/learner-social-club', logicalForm: 'service', kind: 'native-instance' },
|
||||||
|
|||||||
@@ -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', () => {
|
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 $ = load(artifacts.get('staging').html.get(route));
|
||||||
const form = $('[data-aia-form]');
|
const form = $('[data-aia-form]');
|
||||||
assert.equal(form.length, 1, route);
|
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/);
|
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', () => {
|
test('Phase 7 author labels and Arabic credential isolation preserve archive SEO', () => {
|
||||||
for (const locale of ['en','es','ar']) {
|
for (const locale of ['en','es','ar']) {
|
||||||
const route = `${locale === 'en' ? '' : `/${locale}`}/library/author/rula-diab`;
|
const route = `${locale === 'en' ? '' : `/${locale}`}/library/author/rula-diab`;
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ test('Form A meeting preview requires explicit mock mode and remains staging-onl
|
|||||||
assert.equal(formAPreviewEnabled('TRUE', 'FALSE', 'mock'), true);
|
assert.equal(formAPreviewEnabled('TRUE', 'FALSE', 'mock'), true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('form mapping covers twelve native instances and five landing journeys', () => {
|
test('form mapping covers eleven native instances and five landing journeys', () => {
|
||||||
assert.equal(formRouteMapping.filter((entry) => entry.kind === 'native-instance').length, 12);
|
assert.equal(formRouteMapping.filter((entry) => entry.kind === 'native-instance').length, 11);
|
||||||
assert.equal(formRouteMapping.filter((entry) => entry.kind === 'landing-journey').length, 5);
|
assert.equal(formRouteMapping.filter((entry) => entry.kind === 'landing-journey').length, 5);
|
||||||
assert.equal(logicalFormForRoute('/contact'), 'general');
|
assert.equal(logicalFormForRoute('/contact'), 'general');
|
||||||
assert.equal(logicalFormForRoute('/es/client-consultation'), 'service');
|
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']) {
|
for (const route of ['/es/aba-therapy', '/es/autism-evaluations', '/es/learner-social-club']) {
|
||||||
assert.equal(logicalFormForRoute(route), 'service');
|
assert.equal(logicalFormForRoute(route), 'service');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/aba-therapy', 'Solicitar una consulta', '/es/client-consultation'],
|
||||||
['/es/autism-evaluations', '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'],
|
['/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'],
|
['/aba-therapy-intake-process', 'Take the First Step', '/client-consultation'],
|
||||||
['/es/aba-therapy-intake-process', 'Take the First Step', '/es/client-consultation'],
|
['/es/aba-therapy-intake-process', 'Take the First Step', '/es/client-consultation'],
|
||||||
['/services', 'Consult with a Client Advocate', '/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.length, 1, `${route}: ${label}`);
|
||||||
assert.equal(link.attr('href'), href, route);
|
assert.equal(link.attr('href'), href, route);
|
||||||
const target = new URL(href, site + 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);
|
const destination = page(target.pathname);
|
||||||
if (target.hash) assert.equal(destination(`[id="${target.hash.slice(1)}"]`).length, 1, href);
|
if (target.hash) assert.equal(destination(`[id="${target.hash.slice(1)}"]`).length, 1, href);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user