Skip to content
Open
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
2 changes: 1 addition & 1 deletion apps/backend/src/learner-info/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export enum InterestArea {
}

/**
* School of the applicant, includes well-known medical schools, or an other option
* School of the applicant — duplicate enum lives in apps/frontend/src/api/types.ts (keep in sync).
*/
export enum School {
BIDMC_RESIDENTS = 'BIDMC - Residents',
Expand Down
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 32 additions & 4 deletions apps/frontend/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,42 @@ export interface Application extends AvailabilityFields {
}

/**
* School of the applicant, includes well-known medical schools, or an other option
* School of the applicant — kept in sync with apps/backend/src/learner-info/types.ts
* TODO: add this to a shared package
*/
export enum School {
HARVARD_MEDICAL_SCHOOL = 'Harvard Medical School',
BIDMC_RESIDENTS = 'BIDMC - Residents',
BMC_ADDICTION_MEDICINE = 'BMC Addiction Medicine',
BMC_FAMILY_MEDICINE = 'BMC - Family Medicine',
BMC_CENTER_FOR_MULTICULTURAL_TRAINING_IN_PSYCHOLOGY = 'BMC SOM - Center for Multicultural Training in Psychology',
BOSTON_COLLEGE_LYNCH_SCHOOL = 'Boston College - Lynch School of Ed and Human Development',
BOSTON_GRADUATE_SCHOOL_OF_PSYCHOANALYSIS = 'Boston Graduate School of Psychoanalysis',
BOSTON_UNIVERSITY = 'Boston University',
BOSTON_MEDICAL_CENTER_GRAYKEN_CENTER = 'Boston Medical Center Grayken Center',
BOSTON_UNIVERSITY_SCHOOL_OF_MEDICINE_PA = 'Boston University SOM DGMS physician assistant program',
BU_MENTAL_HEALTH_COUNSELING_AND_BEHAVIORAL_MEDICINE = 'BU Mental Health Counseling and Behavioral Medicine Program',
BWH_ADDICTION_MEDICINE = 'BWH Addiction Medicine',
CAPELLA_UNIVERSITY = 'Capella University',
FISHER_COLLEGE = 'Fisher College',
GEORGETOWN_UNIVERSITY_SCHOOL_OF_MEDICINE = 'Georgetown University School of Medicine',
JOHNS_HOPKINS = 'Johns Hopkins',
STANFORD_MEDICINE = 'Stanford Medicine',
MAYO_CLINIC = 'Mayo Clinic',
LABOURE_COLLEGE = 'Laboure College',
MEDEX_NORTHWEST_PA = 'Medex Northwest PA',
MGH_ADDICTION_MEDICINE = 'MGH Addiction Medicine',
MGH_PEDIATRIC_RESIDENCY_PROGRAM = 'MGH Pediatric Residency Program',
MICHIGAN_STATE_UNIVERSITY = 'Michigan State University',
NORTHEASTERN = 'Northeastern',
NORTHEASTERN_BOUVE_COLLEGE_OF_HEALTH_SCIENCES = 'Northeastern Bouve College of Health Sciences',
NORWICH_UNIVERSITY = 'Norwich University',
SALEM_STATE = 'Salem State',
STATE_UNIVERSITY_OF_NEW_YORK = 'State University of New York',
UMASS_BOSTON_NP_PA = 'UMass Boston - NP/PA',
UMASS_BOSTON_NURSING = 'UMass Boston - Nursing',
UNIVERSITY_OF_WASHINGTON_SCHOOL_OF_MEDICINE = 'University of Washington School of Medicine',
WESTERN_GOVERNORS_UNIVERSITY = 'Western Governors University',
WORCESTER_STATE_UNIVERSITY = 'Worcester State University',
OTHER = 'Other',
DOES_NOT_APPLY = 'Does not apply',
}

export interface LearnerInfo {
Expand Down
31 changes: 28 additions & 3 deletions apps/frontend/src/components/SchoolAffiliationFrame.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { useEffect, useState } from 'react';
import { Button, Circle, Flex, Heading, Input, Text } from '@chakra-ui/react';
import {
Button,
Circle,
Flex,
Heading,
Image,
Input,
Text,
} from '@chakra-ui/react';
import { normalizeDateToDay } from '@utils/applicationFilters';
import { schoolEmblemPublicUrl } from '@utils/schoolEmblemUrl';

export interface SchoolAffiliationProps {
schoolName: string;
Expand Down Expand Up @@ -47,6 +56,12 @@ const SchoolAffiliationFrame = ({
const [isEditing, setIsEditing] = useState(false);
const [saving, setSaving] = useState(false);
const [error, setError] = useState<string | null>(null);
const emblemUrl = schoolEmblemPublicUrl(schoolName);
const [emblemFailed, setEmblemFailed] = useState(false);

useEffect(() => {
setEmblemFailed(false);
}, [emblemUrl]);

useEffect(() => {
if (isEditing) return;
Expand Down Expand Up @@ -136,8 +151,18 @@ const SchoolAffiliationFrame = ({
>
{isLearner ? (
<>
<Circle size="120px" bg="gray.300" flexShrink={0}>
{/* Placeholder for University Logo */}
<Circle size="120px" bg="gray.300" flexShrink={0} overflow="hidden">
{emblemUrl && !emblemFailed ? (
<Image
src={emblemUrl}
alt=""
w="100%"
h="100%"
objectFit="contain"
aria-hidden
onError={() => setEmblemFailed(true)}
/>
) : null}
</Circle>

{/* University Column */}
Expand Down
13 changes: 13 additions & 0 deletions apps/frontend/src/utils/schoolEmblemUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export function schoolEmblemPublicUrl(schoolName: string): string | null {
if (!schoolName) {
// if no school name
return null;
}

const formattedSchoolName = schoolName
.toLowerCase()
.replace(/[^a-z0-9]+/g, '_') // spaces/non-alphanumeric characters => underscore
.replace(/^_+|_+$/g, ''); // trim leading/trailing underscores

return `/assets/school-emblems/${formattedSchoolName}.png`;
}
Loading