Skip to content

Commit

Permalink
added constants for undecided strings
Browse files Browse the repository at this point in the history
  • Loading branch information
23langloisj committed Feb 4, 2025
1 parent febd2cd commit f6e43d3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export const wrongPasswordError = "Incorrect Password";
export const forgotPasswordTokenExpiredError = "Token expired";
export const unableToSendEmail = "Unable to send email";
export const emailAlreadyConfirmed = "Email already confirmed";
export const UNDECIDED = "Undecided";
3 changes: 2 additions & 1 deletion packages/common/src/major2-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Err,
Ok,
} from "./types";
import { UNDECIDED } from "./constants";
import { assertUnreachable, courseToString } from "./course-utils";

/**
Expand Down Expand Up @@ -339,7 +340,7 @@ export function getConcentrationsRequirement(
return [];
}
// Allow undecided concentrations
if (inputConcentrations === "Undecided") {
if (inputConcentrations === UNDECIDED) {
return [];
}
const concentrationRequirements = [];
Expand Down
5 changes: 3 additions & 2 deletions packages/frontend/components/Sidebar/SidebarContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import DropdownWarning from "./DropdownWarning";
import ConcentrationDropdownWarning from "./ConcentrationDropdownWarning";
import { COOP_BLOCK } from "./Sidebar";
import { SandboxArea } from "./SandboxArea";
import { UNDECIDED_CONCENTRATION } from "../../utils";

interface SidebarContainerProps {
title: string;
Expand Down Expand Up @@ -65,12 +66,12 @@ const SidebarContainer: React.FC<PropsWithChildren<SidebarContainerProps>> = ({
<Text
fontSize="sm"
color={
subtitle === "Concentration Undecided"
subtitle === UNDECIDED_CONCENTRATION
? "red.500"
: "primary.blue.dark.main"
}
fontStyle={
subtitle === "Concentration Undecided" ? "italic" : "normal"
subtitle === UNDECIDED_CONCENTRATION ? "italic" : "normal"
}
>
{subtitle}
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const BETA_MAJOR_TOOLTIP_MSG =
"Requirements for beta majors have not been validated and therefore may be inconsistent with your degree audit.";
export const GEN_PLACEHOLDER_MSG =
"General Placeholderse are generic courses that you can place in your plan if you do not know yet what to take but want the requirements to be fulfilled";
export const UNDECIDED_CONCENTRATION = "Concentration Undecided";

export const defaultGuestStudent: GetStudentResponse = {
uuid: undefined,
Expand Down

0 comments on commit f6e43d3

Please sign in to comment.