Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lhvy committed Aug 13, 2023
1 parent 4aad4e1 commit ee4d8a5
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 77 deletions.
Binary file modified frontend/src/assets/TermPlannerHelp/unschedule-dark.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/TermPlannerHelp/unschedule-dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/TermPlannerHelp/unschedule-light.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/TermPlannerHelp/unschedule-light.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ const Dashboard = ({ isLoading, structure, totalUOC, freeElectivesUOC }: Props)
let currUOC = 0;
// only consider disciplinary component courses
Object.keys(subgroupStructure.courses).forEach((courseCode) => {
if (courses[courseCode]?.plannedFor && currUOC < subgroupStructure.UOC) {
if (
courses[courseCode]?.plannedFor &&
currUOC < subgroupStructure.UOC &&
!courses[courseCode]?.ignoreFromProgression
) {
const courseUOC =
courses[courseCode].UOC *
getNumTerms(courses[courseCode].UOC, courses[courseCode].isMultiterm);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ const { Title } = Typography;
type Props = {
courses: ViewSubgroupCourse[];
view: Views;
title: string;
subheading: string;
description: string;
};

const IgnoredCoursesSection = ({ courses, view }: Props) => {
const GenericCoursesSection = ({ courses, view, title, subheading, description }: Props) => {
const uoc = courses.reduce(
(sum, course) => sum + (course.UOC ?? 0) * getNumTerms(course.UOC ?? 0, course.isMultiterm),
0
Expand All @@ -22,18 +25,15 @@ const IgnoredCoursesSection = ({ courses, view }: Props) => {
return (
<Collapsible
title={
<Title level={1} id="Progression Ignored" className="text">
Progression Ignored
<Title level={1} id={title} className="text">
{title}
</Title>
}
>
<Title level={4} className="text">
You have {uoc} UOC worth of additional courses ignored from your progression
You have {uoc} UOC worth of {subheading}
</Title>
<p>
These courses have been manually ignored from the progression count. You can undo this from
the Term Planner page if you wish.
</p>
<p>{description}</p>
{view === Views.TABLE ? (
<Table
dataSource={courses.map((c) => ({
Expand All @@ -50,4 +50,4 @@ const IgnoredCoursesSection = ({ courses, view }: Props) => {
);
};

export default IgnoredCoursesSection;
export default GenericCoursesSection;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import GenericCoursesSection from './GenericCoursesSection';

export default GenericCoursesSection;

This file was deleted.

19 changes: 15 additions & 4 deletions frontend/src/pages/ProgressionChecker/ProgressionChecker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ import PageTemplate from 'components/PageTemplate';
import { MAX_COURSES_OVERFLOW } from 'config/constants';
import type { RootState } from 'config/store';
import Dashboard from './Dashboard';
import FreeElectiveSection from './FreeElectivesSection';
import GenericCoursesSection from './GenericCoursesSection';
import GridView from './GridView';
import IgnoredCoursesSection from './IgnoredCoursesSection';
import S from './styles';
import TableView from './TableView';

Expand Down Expand Up @@ -292,8 +291,20 @@ const ProgressionChecker = () => {
)}
</Collapsible>
))}
<FreeElectiveSection courses={Object.values(overflowCourses)} view={view} />
<IgnoredCoursesSection courses={Object.values(ignoredCourses)} view={view} />
<GenericCoursesSection
courses={Object.values(overflowCourses)}
view={view}
title="Free Electives"
subheading="additional courses planned"
description="These courses may or may not be counted to your program. Please manually verify your progression with this information."
/>
<GenericCoursesSection
courses={Object.values(ignoredCourses)}
view={view}
title="Progression Ignored"
subheading="courses ignored from your progression"
description="These courses have been manually ignored from the progression count. You can undo this from the Term Planner page if you wish."
/>
</S.ProgressionViewContainer>
</S.Wrapper>
</PageTemplate>
Expand Down

0 comments on commit ee4d8a5

Please sign in to comment.