-
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?
Changes from 5 commits
932274f
f7abdce
ca8f727
f8508b0
9b02be2
08092ed
e9f3394
febd2cd
740892d
8cd6018
388de8e
8ac9630
499a68d
f6e43d3
99012a6
e2fe2e3
d8f0363
f56972f
4eae90f
365cee7
5b7febb
25176b9
00df6a3
381cc90
7c51eb0
aa76a95
60ba70b
8c59fc0
ac10bcc
8afd28e
4152b28
f335de4
d318858
e195a16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -541,6 +541,7 @@ | |
], | ||
"concentrations": { | ||
"minOptions": 1, | ||
|
||
"concentrationOptions": [ | ||
{ | ||
"type": "SECTION", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,21 @@ export const majorOptionObjectComparator = ( | |
return majorNameComparator(a.value.toString(), b.value.toString()); | ||
}; | ||
|
||
/** | ||
* Converts a list of strings or numbers into a list of option objects for the | ||
* Select component, including an "Undecided" option. | ||
*/ | ||
export const convertToOptionObjectsIncludingUndecided = ( | ||
options: (string | number)[] | ||
): OptionObject[] => { | ||
const optionObjects = convertToOptionObjects(options); | ||
optionObjects.unshift({ | ||
label: "Undecided", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, updated in latest push |
||
value: "Undecided", | ||
}); | ||
return optionObjects; | ||
}; | ||
|
||
/** | ||
* Converts a list of strings or numbers into a list of option objects for the | ||
* Select component. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from "react"; | ||
import { InfoIcon } from "@chakra-ui/icons"; | ||
import { | ||
Accordion, | ||
AccordionItem, | ||
AccordionButton, | ||
AccordionIcon, | ||
AccordionPanel, | ||
Text, | ||
} from "@chakra-ui/react"; | ||
|
||
const ConcentrationDropdownWarning = () => { | ||
return ( | ||
<Accordion pb="sm" allowToggle> | ||
<AccordionItem | ||
borderRadius="lg" | ||
backgroundColor="red.100" | ||
border="1px #e63433 solid" | ||
> | ||
<AccordionButton> | ||
<InfoIcon mr="xs" color="red.400" /> | ||
<Text fontWeight="semibold" textAlign="left" fontSize="md" flex="1"> | ||
Missing Concentration! | ||
</Text> | ||
<AccordionIcon color="red.400" /> | ||
</AccordionButton> | ||
<AccordionPanel> | ||
<Text fontSize="sm"> | ||
A concentration is required for this major. Go to 'Edit | ||
plan' and select your desired concentration from the drop-down | ||
menu. | ||
</Text> | ||
</AccordionPanel> | ||
</AccordionItem> | ||
</Accordion> | ||
); | ||
}; | ||
|
||
export default ConcentrationDropdownWarning; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import { BETA_MAJOR_TOOLTIP_MSG } from "../../utils"; | |
import { HelperToolTip } from "../Help"; | ||
import { DraggableScheduleCourse } from "../ScheduleCourse"; | ||
import DropdownWarning from "./DropdownWarning"; | ||
import ConcentrationDropdownWarning from "./ConcentrationDropdownWarning"; | ||
import { COOP_BLOCK } from "./Sidebar"; | ||
import { SandboxArea } from "./SandboxArea"; | ||
|
||
|
@@ -61,11 +62,22 @@ const SidebarContainer: React.FC<PropsWithChildren<SidebarContainerProps>> = ({ | |
</Heading> | ||
</Flex> | ||
{subtitle && ( | ||
<Text fontSize="sm" color="primary.blue.dark.main"> | ||
<Text | ||
fontSize="sm" | ||
color={ | ||
subtitle === "Concentration Undecided" | ||
? "red.500" | ||
: "primary.blue.dark.main" | ||
} | ||
fontStyle={ | ||
subtitle === "Concentration Undecided" ? "italic" : "normal" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. just updated |
||
} | ||
> | ||
{subtitle} | ||
</Text> | ||
)} | ||
</Box> | ||
<ConcentrationDropdownWarning /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be in a conditional? |
||
{renderDropdownWarning && <DropdownWarning />} | ||
{creditsTaken !== undefined && ( | ||
<Flex mb="sm" alignItems="baseline" columnGap="xs"> | ||
|
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