Skip to content

Commit

Permalink
removed undecided string everywhere and replaced with cosntants
Browse files Browse the repository at this point in the history
  • Loading branch information
23langloisj committed Feb 4, 2025
1 parent f6e43d3 commit 99012a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/api/src/major/major.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
SupportedMajors,
SupportedConcentrations,
} from "@graduate/common";
import { UNDECIDED } from "@graduate/common/dist/constants";
import { Injectable, Logger } from "@nestjs/common";
import { formatServiceCtx } from "../utils";
import { MAJOR_YEARS, MAJORS } from "./major-collator";
Expand Down Expand Up @@ -122,7 +123,7 @@ export class MajorService {

const isValidConcentrationName =
concentrations.includes(concentrationName) ||
concentrationName === "Undecided";
concentrationName === UNDECIDED;

if (!isValidConcentrationName) {
this.logger.debug(
Expand Down
6 changes: 4 additions & 2 deletions packages/frontend/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
getAllCoursesFromPlan,
getSectionError,
getAllCoursesInMajor,
UNDECIDED_CONCENTRATION,
UNDECIDED,
} from "../../utils";
import {
handleApiClientError,
Expand Down Expand Up @@ -210,8 +212,8 @@ const Sidebar: React.FC<SidebarProps> = memo(
<SidebarContainer
title={major.name}
subtitle={
selectedPlan.concentration === "Undecided"
? "Concentration Undecided"
selectedPlan.concentration === UNDECIDED
? UNDECIDED_CONCENTRATION
: selectedPlan.concentration
}
creditsTaken={creditsTaken}
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 @@ -11,6 +11,7 @@ export const BETA_MAJOR_TOOLTIP_MSG =
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 UNDECIDED = "Undecided";

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

0 comments on commit 99012a6

Please sign in to comment.