Skip to main content

Popup Slice

The slice holding information about the current popup being shown.

State

type PopupSlice = {
deletePlan: boolean;
addPlan: boolean;
toAddName: string;
toAddMajor: Major | null;
generateAdd: boolean;
deleteYear: boolean;
yearToDelete: Year | null;
deleteCourse: boolean;
courseToDelete: { course: UserCourse; year: number } | null;
showCourseInfo: boolean;
courseToShow: UserCourse | null;
addingPrereq: boolean;
};
PropertyTypeDescription
deletePlanbooleanWhether or not the user is currently deleting a plan
addPlanbooleanWhether or not the user is currently adding a plan
toAddNamestringThe name of the plan the user is adding
toAddMajorMajor | nullThe major of the plan the user is adding
generateAddbooleanUsed to start plan generation
deleteYearbooleanWhether or not the user is currently deleting a year
yearToDeleteYear | nullThe year the user is deleting
deleteCoursebooleanWhether or not the user is currently deleting a course
courseToDelete{ course: UserCourse; year: number } | nullThe information of the course the user is deleting
showCourseInfobooleanWhether or not the application is currently showing course info
addingPrereqbooleanWhether or not the user is adding a prereq from the course display

Reducers

ReducerAction Payload TypeState Affeccted
updateGeneratePlanAddStatusbooleangenerateAdd
updateDeleteYearStatusbooleandeleteYear
updateYearToDeleteYear | nullyearToDelete
clearToAddtoAddName, toAddMajor
updateAddingPlanStatusbooleanaddPlan
updateToAddNamestringtoAddName
updateToAddMajorMajortoAddMajor
updateDeletePlanStatusbooleandeletePlan
updateDeleteCourseStatusbooleandeleteCourse
updateCourseToDelete{ course: UserCourse; year: Year } | nullcourseToDelete
updateShowCourseInfobooleanshowCourseInfo
updateCourseToShowUserCourse | nullcourseToShow
``updateAddingPrereqbooleanaddingPrereq

updateGeneratePlanAddStatus

Used to update whether a new plan is being created or not.

ComponentDescription
GenerateNewPlanResets generateAdd to false after adding a new plan
HandleUserEntryDummySets generateAdd to true after user login promise in afterPromise helper
HandleUserEntryDummySets generateAdd to true for guest/existing users in handleExistingUser helper

updateDeleteYearStatus

Used to display the DeleteYearPopup component.

ComponentDescription
YearSettingsDropdownSets deleteYear to true in activateDeleteYearPopup helper to delete a year from dropdown settings
DeleteYearPopupResets deleteYear to false in activateDeleteYear helper a successful delete request to API
DeleteYearPopupResets deleteYear to false in cancel helper to cancel deleting a year

clearToAdd

ComponentDescription
GenerateNewPlanResets toAddName and toAddMajor properties after a new plan is successfully generated

updateAddingPlanStatus

ComponentDescription
HandleUserEntryDummySets addPlan property to true when a new guest user is created that doesn't have a plan
HandleUserEntryDummySets addPlan property to true if there are no preexisting plans retrieved in processRetrievedPlans helper
HandleUserEntryDummySets addPlan property to false after importing a shared plan's years in addImportedYears helper
HandleUserEntryDummySets addPlan property to false in handleFinishAdding helper
PlanChooseSets addPlan property to true in handlePlanChange helper
PlanAddSets addPlan property to false in createNewPlan helper
PlanAddSets addPlan property to false in createCancel helper

updateToAddName

ComponentDescription
HandleUserEntryDummyUpdates toAddName property in afterPromise helper
HandleUserEntryDummyUpdates toAddName property in handleExistingUser helper
PlanAddUpdates toAddName property in handleNameChange event handler helper

updateToAddMajor

ComponentDescription
HandleUserEntryDummyUpdates toAddMajor property in afterPromise helper
HandleUserEntryDummyUpdates toAddMajor property in handleExistingUser helper
PlanAddUpdates toAddName property in handleMajorChange event handler helper

updateDeletePlanStatus

ComponentDescription
ActionBarSets deletePlan property to true in activateDeletePlan helper
DeletePlanPopupSets deletePlan property to false in deleteCurrentPlan helper
DeletePlanPopupSets deletePlan property to false in cancel helper

updateDeleteCourseStatus

ComponentDescription
CourseComponentSets deleteCourse property to true in deleteCourse helper
DeleteCoursePopupSets deleteCourse property to false in actiavteDeleteCourse helper
DeleteCoursePopupSets deleteCourse property to false in cancel helper

updateCourseToDelete

ComponentDescription
CourseComponentUpdates courseToDelete property in deleteCourse helper
DeleteCoursePopupUpdates courseToDelete property to null in actiavteDeleteCourse helper
DeleteCoursePopupUpdates courseToDelete property to null in cancel helper

updateShowCourseInfo

ComponentDescription
CourseComponentSets showCourseInfo property to true in displayCourses helper
CourseDisplayPopupSets showCourseInfo property to false in postAddCourse helper
CourseDisplayPopupSets showCourseInfo property to false on button click
SisCourseSets showCourseInfo property to false in addPrereq helper

updateCourseToShow

ComponentDescription
CourseComponentUpdates courseToShow property in displayCourses helper
CourseDisplayPopupUpdates courseToShow property to null in handlePostAddCourse helper
CourseDisplayPopupUpdates courseToShow property to null on button click
SisCourseUpdates courseToShow property to null in addPrereq helper

updateAddingPrereq

ComponentDescription
SemesterSets addingPrereq property to false in handlePostResponse helper
AddingPrereqPopupSets addingPrereq property to false on button click
SisCourseSets addingPrereq property to true in addPrereq helper

Selectors

SelectorProperty
selecteGeneratePlanAddStatusgenerateAdd
selecteDeleteYearStatusdeleteYear
selectYearToDeleteyearToDelete
selectDeletePlanStatusdeletePlan
selectAddingPlanStatusaddPlan
selectToAddNametoAddName
selectToAddMajortoAddMajor
selectCourseToDeletecourseToDelete
selectDeleteCourseStatusdeleteCourse
selectShowCourseInfoshowCourseInfo
selectCourseToShowcourseToShow
selectAddingPrereqaddingPrereq

selectGeneratePlanAddStatus

ComponentDescription
GenerateNewPlanWhen toggled to true, generates a new plan and sends appropriate requests to API
HandleUserEntryDummyUsed in conditional for plan importing and creation

selectDeleteYearStatus

ComponentDescription
indexCondition for rendering DeleteYearPopup component

selectYearToDelete

ComponentDescription
DeleteYearPopupUsed for information in the popup confirmation. Used in activateDeleteYear helper to send a delete request to API

selectDeletePlanStatus

ComponentDescription
indexCondition for rendering DeletePlanPopup component

selectAddingPlanStatus

ComponentDescription
indexCondition for rendering PlanAdd popup component

selectToAddName

ComponentDescription
PlanAddUsed as default input value for new plan name
GenerateNewPlanUsed to change the name of the new plan being as it is generated

selectToAddMajor

ComponentDescription
PlanAddUsed in createNewPlan helper, displaying an error if toAddMajor is null
GenerateNewPlanUsed to create Major distributions for for generating new plans, also as a conditional

selectCourseToDelete

ComponentDescription
indexCondition for rendering DeleteCoursePopup component
DeleteCoursePopupUsed to determine which course to delete in activateDeleteCourse helper

selectDeleteCourseStatus

No references. Deprecated?

selectCourseInfoStatus

ComponentDescription
indexCondition for rendering CourseDisplayPopup component
SisCourseUsed in conditionals for getAddPrereqButton, getAddCourseUI, and getAddCourseButton helpers

selectCourseToShow

ComponentDescription
CourseDisplayPopupUsed to many different helpers to display course information (e.g. title, year, credits, etc)
PrereqDisplayUsed in getNonStringPrereq helper to determine year to check
PlaceholderUsed for updating courses in updateCourse and handleUpdateResponse helpers
SisCourseUsed for updating courses in updateCourse and handleUpdate helpers

selectAddingPrereqs

ComponentDescription
indexCondition for displaying AddingPrereqPopup component
SemesterCondition for displaying button for addCourse helper
YearComponentUsed for formatting CSS of Semester components inside YearComponent