-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
790 allow plans with no concentration #803
base: main
Are you sure you want to change the base?
Conversation
…hing appear saying that you have an undecided major
…ratio and a more nonchalant red italicized aesthetic subtitle informing you the same
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just remove clgs, could also add some comment here and there but logic LGTM
@@ -287,6 +287,7 @@ export function validateMajor2( | |||
): MajorValidationResult { | |||
const tracker = new Major2ValidationTracker(taken); | |||
let concentrationReq: Requirement2[] = []; | |||
console.log(concentrations); // this is "undecided" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary logs
return false; | ||
} | ||
|
||
console.log("ASDASDSA"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just updated 👍 thanks wennis
{subtitle} | ||
</Text> | ||
)} | ||
</Box> | ||
<ConcentrationDropdownWarning /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be in a conditional?
); | ||
const isValidConcentrationName = | ||
concentrations.includes(concentrationName) || | ||
concentrationName.toLowerCase() === "undecided"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should standardize how we are comparing to "undecided" vs "Undecided" string
packages/common/src/utils.ts
Outdated
): OptionObject[] => { | ||
const optionObjects = convertToOptionObjects(options); | ||
optionObjects.unshift({ | ||
label: "Undecided", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can create a UNDECIDED_OPTION constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, updated in latest push
…nvertToOptionObjects method
); | ||
const isValidConcentrationName = | ||
concentrations.includes(concentrationName) || | ||
concentrationName === "Undecided"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put "Undecided" as a constant
: "primary.blue.dark.main" | ||
} | ||
fontStyle={ | ||
subtitle === "Concentration Undecided" ? "italic" : "normal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also can be a constant value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just updated
@@ -36,14 +41,20 @@ export const majorOptionObjectComparator = ( | |||
/** | |||
* Converts a list of strings or numbers into a list of option objects for the | |||
* Select component. | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comms!
@@ -319,7 +319,8 @@ export const AddPlanModal: React.FC<AddPlanModalProps> = ({ | |||
name="concentration" | |||
placeholder="Select a Concentration" | |||
options={convertToOptionObjects( | |||
majorConcentrations.concentrations | |||
majorConcentrations.concentrations, | |||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you ever pass in false? Both times when you use convertToOptionObjects its true
); | ||
const isValidConcentrationName = | ||
concentrations.includes(concentrationName) || | ||
concentrationName === UNDECIDED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can change constant names to like UNDECIDED_STRING or UNDECIDED_STR for example to be a little more specific. Otherwise looks good
Description
For all majors that have concentrations, you can now select undecided as an option.
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Frontend changes to add undecided as an option when selecting concentrations as well as displaying warning dropdowns letting you know that the concentration is undecided and will eventually need changing. Also some backend validation changes that allow an undecided concentration to exist even though it's not defined anywhere in the major.
Closes #790
Type of change
Please tick the boxes that best match your changes.
yarn install
yarn dev:migration:run
How Has This Been Tested?
Visually