Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<PractitionerInfo, 'uuid'> {
const practitionerInfo: PractitionerInfo = {};
console.info('Webhook request:', webhookRequest);

practitionerInfo.phoneNumber = webhookRequest[FIELD_NAMES.PHONE]['full'];
practitionerInfo.website = webhookRequest[FIELD_NAMES.WEBSITE] || '';
Expand All @@ -34,7 +47,7 @@ function getPractitionerInfo(webhookRequest): Omit<PractitionerInfo, 'uuid'> {
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(', ');
Expand Down
8 changes: 7 additions & 1 deletion apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
reload?: boolean;
setReload?: (arg: boolean) => void;
}> = ({ accessToken, reload, setReload }) => {
const { coords } = useGeolocated();

Check warning on line 416 in apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx

View workflow job for this annotation

GitHub Actions / pre-deploy

'coords' is assigned a value but never used
const [distanceFilterEnabled, setDistanceFilterEnabled] = useState(false);
const [clientCoordinates, setClientCoordinates] =
useState<GeolocationPosition>();
Expand Down Expand Up @@ -503,12 +503,12 @@
display: 'flex',
};

const regularStyles = {

Check warning on line 506 in apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx

View workflow job for this annotation

GitHub Actions / pre-deploy

'regularStyles' is assigned a value but never used
paddingTop: '20px',
paddingRight: '30px',
};

const adminStyles = {

Check warning on line 511 in apps/monarch/monarch-frontend/src/app/SearchTherapists.tsx

View workflow job for this annotation

GitHub Actions / pre-deploy

'adminStyles' is assigned a value but never used
paddingRight: '30px',
};

Expand Down Expand Up @@ -641,7 +641,13 @@
Website
</Box>
<Text>
<Link href={therapist.website} color="blue.600">
{/*
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.
*/}
<Link href={therapist.website.indexOf('//') === -1 ? `//${therapist.website}` : therapist.website} color="blue.600" target="_blank" rel="noopener">
{therapist.website}
</Link>
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Box mb='6'>
<Heading size='sm' mb='2'>
Expand Down
Loading