From 2d41bc4d406a09e7bd8e9ebc53ec1e5395ca8fed Mon Sep 17 00:00:00 2001 From: Evan Platzer Date: Thu, 19 Sep 2024 13:47:05 -0400 Subject: [PATCH 1/4] Enrollment Checkin: Fix checkIn service types --- src/services/checkIn.ts | 59 +++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/src/services/checkIn.ts b/src/services/checkIn.ts index 1197d02192..467beccd7d 100644 --- a/src/services/checkIn.ts +++ b/src/services/checkIn.ts @@ -1,12 +1,11 @@ -import { AuthError, NotFoundError } from "./error"; -import http from "./http"; +import http from './http'; /** * these holds prevent a student from checking in */ type MajorHolds = { RegistrarHold: boolean; - HighSchoolTranscriptHold: boolean; + HighSchoolHold: boolean; FinancialHold: boolean; MedicalHold: boolean; MustRegisterForClasses: boolean; @@ -20,6 +19,8 @@ type MinorHolds = { MajorHold: boolean; }; +type Holds = MajorHolds & MinorHolds; + type EmergencyContact = { /** the sequence number of the contact, (1, 2, or 3) */ SEQ_NUMBER: number; @@ -34,54 +35,48 @@ type EmergencyContact = { MobilePhoneIN: boolean; }; -type PersonalPhone = { +type PhoneInfo = { PersonalPhone: number; MakePrivate: boolean; - NoPhone: boolean; }; -type Demographic = { - /** whether or not a student is Hispanic/Latino or prefers not to say */ - Ethnicity: number; - Race: Race; -}; +// type Demographic = { +// /** whether or not a student is Hispanic/Latino or prefers not to say */ +// Ethnicity: number; +// Race: Race; +// }; export enum Race { - NativeAmerican = "Native American or Alaskan Native", - Asian = "Asian", - Black = "Black or African American", - Hawaiian = "Native Hawaiian or Other Pacific Islander", - White = "White", + NativeAmerican = 'Native American or Alaskan Native', + Asian = 'Asian', + Black = 'Black or African American', + Hawaiian = 'Native Hawaiian or Other Pacific Islander', + White = 'White', } -type EnrollmentCheckin = { - Holds: string; - NewStudent: number; -} & PersonalPhone & - MajorHolds & - MinorHolds & - Demographic; +// type EnrollmentCheckin = { +// Holds: string; +// NewStudent: number; +// } & MajorHolds & +// MinorHolds & +// Demographic; const getStatus = (): Promise => http.get(`checkIn/status`); const markCompleted = (): Promise => http.put(`checkIn/status`); -const getHolds = (): Promise => http.get(`checkIn/holds`); +const getHolds = (): Promise => http.get(`checkIn/holds`); -const getEmergencyContacts = ( - username: string -): Promise => +const getEmergencyContacts = (username: string): Promise => http.get(`profiles/emergency-contact/${username}/`); -const submitPhone = (data: EnrollmentCheckin): Promise => - http.put(`checkIn/cellphone`, data); +const submitPhone = (data: PhoneInfo): Promise => http.put(`checkIn/cellphone`, data); const submitContact = (data: EmergencyContact): Promise => http.post(`checkIn/emergencycontact`, data); -const submitDemographic = ( - data: EnrollmentCheckin -): Promise => http.put(`checkIn/demographic`, data); +// const submitDemographic = (data: EnrollmentCheckin): Promise => +// http.put(`checkIn/demographic`, data); const checkInService = { getStatus, @@ -90,7 +85,7 @@ const checkInService = { getEmergencyContacts, submitPhone, submitContact, - submitDemographic, + // submitDemographic, }; export default checkInService; From 93a9ac239078b5011be726048d756adc1aeb28ec Mon Sep 17 00:00:00 2001 From: Evan Platzer Date: Thu, 19 Sep 2024 13:50:26 -0400 Subject: [PATCH 2/4] Enrollment Checkin: handle NoPhone When the user says that they don't have a phone number, this was previously sent to the database. But the database handled this by doing nothing. So we can simplify by doing nothing onSubmit with the phone info when the user says that they don't have a phone number. --- src/views/EnrollmentCheckIn/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/EnrollmentCheckIn/index.jsx b/src/views/EnrollmentCheckIn/index.jsx index b457d96a1f..ca71f1c543 100644 --- a/src/views/EnrollmentCheckIn/index.jsx +++ b/src/views/EnrollmentCheckIn/index.jsx @@ -252,7 +252,9 @@ const EnrollmentCheckIn = (props) => { checkInService.submitContact(emergencyContact1); checkInService.submitContact(emergencyContact2); checkInService.submitContact(emergencyContact3); - checkInService.submitPhone(phoneInfo); + if (!phoneInfo.NoPhone) { + checkInService.submitPhone(phoneInfo); + } // checkInService.submitDemographic(formatDemographic(demographic)); checkInService.markCompleted(profile.ID); setActiveStep(5); From 84fbef1bf45f3675c2625bf1958c75c0ed5cb2ce Mon Sep 17 00:00:00 2001 From: Evan Platzer Date: Thu, 19 Sep 2024 16:00:47 -0400 Subject: [PATCH 3/4] Enrollment Checkin: Add SMSOptedIn field --- src/services/checkIn.ts | 1 + .../components/UpdatePhone/index.jsx | 28 +++++++++++++++++-- src/views/EnrollmentCheckIn/index.jsx | 2 ++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/services/checkIn.ts b/src/services/checkIn.ts index 467beccd7d..67e93f8a14 100644 --- a/src/services/checkIn.ts +++ b/src/services/checkIn.ts @@ -38,6 +38,7 @@ type EmergencyContact = { type PhoneInfo = { PersonalPhone: number; MakePrivate: boolean; + SMSOptedIn: boolean; }; // type Demographic = { diff --git a/src/views/EnrollmentCheckIn/components/UpdatePhone/index.jsx b/src/views/EnrollmentCheckIn/components/UpdatePhone/index.jsx index 78ebfb1d4b..b32de31572 100644 --- a/src/views/EnrollmentCheckIn/components/UpdatePhone/index.jsx +++ b/src/views/EnrollmentCheckIn/components/UpdatePhone/index.jsx @@ -2,9 +2,12 @@ import { Checkbox, FormControl, FormControlLabel, + FormLabel, Grid, Input, InputLabel, + Radio, + RadioGroup, Typography, } from '@mui/material'; import { forwardRef } from 'react'; @@ -29,7 +32,7 @@ const UpdatePhone = ({ phoneInfo, handleChangePhoneInfo, handleCheckPhoneInfo }) - Phone Number + Phone Number + + + Do you give permission for Gordon College to text you? + + } label="Yes" /> + } label="No" /> + + + By checking yes, you agree to receive text messages from Gordon College. Message & data + rates may apply. Message frequency varies. Reply HELP for help or STOP to cancel. View + Terms of Service and Privacy Policy https://www.gordon.edu/webprivacy.cfm. + + + } @@ -58,7 +80,7 @@ const UpdatePhone = ({ phoneInfo, handleChangePhoneInfo, handleCheckPhoneInfo }) control={ } diff --git a/src/views/EnrollmentCheckIn/index.jsx b/src/views/EnrollmentCheckIn/index.jsx index ca71f1c543..6d564e6f4b 100644 --- a/src/views/EnrollmentCheckIn/index.jsx +++ b/src/views/EnrollmentCheckIn/index.jsx @@ -80,6 +80,7 @@ const EnrollmentCheckIn = (props) => { PersonalPhone: '', MakePrivate: false, NoPhone: false, + SMSOptedIn: undefined, }); const [privacyAgreements, setPrivacyAgreements] = useState({ @@ -145,6 +146,7 @@ const EnrollmentCheckIn = (props) => { PersonalPhone: profile.MobilePhone, MakePrivate: Boolean(profile.IsMobilePhonePrivate), NoPhone: false, + SMSOptedIn: undefined, }); } } else { From def6bfaf8959dd9af23af104c16b8e0375a6f3c6 Mon Sep 17 00:00:00 2001 From: Evan Platzer Date: Thu, 19 Sep 2024 16:01:12 -0400 Subject: [PATCH 4/4] Enrollment Checkin: fix loading --- src/views/EnrollmentCheckIn/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/EnrollmentCheckIn/index.jsx b/src/views/EnrollmentCheckIn/index.jsx index 6d564e6f4b..65928e88b4 100644 --- a/src/views/EnrollmentCheckIn/index.jsx +++ b/src/views/EnrollmentCheckIn/index.jsx @@ -154,10 +154,10 @@ const EnrollmentCheckIn = (props) => { } } // We only want to stop loading now if the profile has already been loaded. - setLoading(loadingProfile); + setLoading(false); }; loadData(); - }, [profile, loadingProfile]); + }, [profile]); useEffect(() => { navigate('/enrollmentcheckin', { replace: true, state: { step: activeStep } });