Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

23langloisj
Copy link
Contributor

@23langloisj 23langloisj commented Jan 31, 2025

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This requires a run of yarn install
  • This has migration changes and requires a run of yarn dev:migration:run

How Has This Been Tested?

Visually

Screenshot 2025-01-31 at 6 26 34 PM

Screenshot 2025-01-31 at 6 26 59 PM

@23langloisj 23langloisj self-assigned this Jan 31, 2025
Copy link

vercel bot commented Jan 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graduatenu-frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 5, 2025 0:08am

Copy link
Contributor

@denniwang denniwang left a 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary logs

packages/frontend/components/Plan/AddPlanModal.tsx Outdated Show resolved Hide resolved
return false;
}

console.log("ASDASDSA");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

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 />
Copy link
Contributor

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";
Copy link
Contributor

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

): OptionObject[] => {
const optionObjects = convertToOptionObjects(options);
optionObjects.unshift({
label: "Undecided",
Copy link
Contributor

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

Copy link
Contributor Author

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

);
const isValidConcentrationName =
concentrations.includes(concentrationName) ||
concentrationName === "Undecided";
Copy link
Contributor

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"
Copy link
Contributor

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

Copy link
Contributor Author

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.
*
Copy link
Contributor

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
Copy link
Contributor

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;

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Allow plans with no concentration even if a concentration is required
4 participants