diff --git a/apps/monarch/monarch-backend/src/workflows/postPendingPractitioner.ts b/apps/monarch/monarch-backend/src/workflows/postPendingPractitioner.ts index c000225..1e2d8aa 100644 --- a/apps/monarch/monarch-backend/src/workflows/postPendingPractitioner.ts +++ b/apps/monarch/monarch-backend/src/workflows/postPendingPractitioner.ts @@ -12,20 +12,33 @@ async function postNewPendingPractitioner(req: Request, postPendingPractitioner: } // List of field names for JotForm submission request objects +// const FIELD_NAMES = { +// PHONE: 'q4_contact_number', +// WEBSITE: 'q26_website', +// MODALITY: 'q24_modality', +// BUSINESS_LOCATION: 'q6_business_location', +// BUSINESS_NAME: 'q32_business_name', +// MIN_AGE_SERVED: 'q30_min_age_served', +// EMAIL: 'q5_email', +// FULL_NAME: 'q3_full_name', +// LANGUAGES: 'q29_languages' +// } + const FIELD_NAMES = { - PHONE: 'q4_contact_number', - WEBSITE: 'q26_website', - MODALITY: 'q24_modality', - BUSINESS_LOCATION: 'q6_business_location', - BUSINESS_NAME: 'q32_business_name', - MIN_AGE_SERVED: 'q30_min_age_served', + PHONE: 'q6_contact_number', + WEBSITE: 'q9_website', + MODALITY: 'q12_modality', + BUSINESS_LOCATION: 'q11_business_location', + BUSINESS_NAME: 'q8_business_name', + MIN_AGE_SERVED: 'q18_min_age_served', EMAIL: 'q5_email', - FULL_NAME: 'q3_full_name', - LANGUAGES: 'q29_languages' + FULL_NAME: 'q4_full_name', + LANGUAGES: 'q52_languages' } function getPractitionerInfo(webhookRequest): Omit { const practitionerInfo: PractitionerInfo = {}; + console.info('Webhook request:', webhookRequest); practitionerInfo.phoneNumber = webhookRequest[FIELD_NAMES.PHONE]['full']; practitionerInfo.website = webhookRequest[FIELD_NAMES.WEBSITE] || ''; @@ -34,7 +47,7 @@ function getPractitionerInfo(webhookRequest): Omit { practitionerInfo.minAgeServed = parseInt(webhookRequest[FIELD_NAMES.MIN_AGE_SERVED] || 0); practitionerInfo.email = webhookRequest[FIELD_NAMES.EMAIL]; practitionerInfo.fullName = `${webhookRequest[FIELD_NAMES.FULL_NAME].first} ${webhookRequest[FIELD_NAMES.FULL_NAME].last}`; - practitionerInfo.languagesList = webhookRequest[FIELD_NAMES.LANGUAGES].split('\r\n') + practitionerInfo.languagesList = ['English'].concat(webhookRequest[FIELD_NAMES.LANGUAGES].split('\r\n')); const modalities = webhookRequest[FIELD_NAMES.MODALITY].split('\r\n') practitionerInfo.modality = modalities.join(', '); diff --git a/apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx b/apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx index 5fb696d..ce2a748 100644 --- a/apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx +++ b/apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx @@ -641,7 +641,13 @@ export const SearchTherapists: React.FC<{ Website - + {/* + If the given website value doesn't have a protocol (http:// or https://), prefix with // + which tells the browser to open the link as a root address (i.e. not prefixed by the page URL). + This way, if the given URL looks like 'www.site.com`, we open that actual URL instead of as a relative path. + Do this here so we don't display a weird link like '//www.site.com' to the user. + */} + {therapist.website} diff --git a/apps/monarch/monarch-frontend/src/app/components/LanguageFilter/index.tsx b/apps/monarch/monarch-frontend/src/app/components/LanguageFilter/index.tsx index 5d79305..2b98f5d 100644 --- a/apps/monarch/monarch-frontend/src/app/components/LanguageFilter/index.tsx +++ b/apps/monarch/monarch-frontend/src/app/components/LanguageFilter/index.tsx @@ -10,8 +10,7 @@ import { QueryContext } from '../../SearchTherapists'; const LanguageFilter: React.FC = () => { const queryContext = useContext(QueryContext); - const availableLanguages = ['English', 'Spanish', 'Polish', 'Portuguese','Korean', 'French', 'ASL', 'Chinese']; - + const availableLanguages = ['English', 'Spanish', 'Polish', 'Portuguese', 'Korean', 'French', 'ASL', 'Chinese', 'Haitian Creole', 'Russian', 'Vietnamese']; return (