Skip to content

Commit

Permalink
cleanup frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
AaDalal committed Mar 23, 2024
1 parent d8e3b00 commit ad36cf0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 264 deletions.
10 changes: 2 additions & 8 deletions frontend/degree-plan/components/Requirements/QObject.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import { useDrag, useDrop } from "react-dnd";
import { ItemTypes } from "../dnd/constants";
import type { Course, DnDCourse, Fulfillment, Rule } from "@/types";
import styled from "@emotion/styled";
import nearley from "nearley";
import grammar from "@/util/q_object_grammar"
import { Icon } from "../common/bulma_derived_components";
import CoursePlanned, { BaseCourseContainer, SkeletonCourse } from "../FourYearPlan/CourseInPlan";
import assert from "assert";
import { ReviewPanelTrigger } from "../Infobox/ReviewPanel";
import { Draggable } from "../common/DnD";
import { useSWRCrud } from "@/hooks/swrcrud";
import useSWR from "swr";
import { useContext } from "react";
import { SearchPanelContext } from "../Search/SearchPanel";
import CourseInReq from "./CourseInReq";
Expand Down Expand Up @@ -348,6 +340,8 @@ const RuleLeaf = ({ q_json, fulfillmentsForRule, rule, satisfied, activeDegreePl
const t3 = transformSearchConditions(t2)
q_json = t3 as TransformedQObject;

console.log(q_json)

return (
<RuleLeafWrapper $wrap>
<QObject q={q_json} fulfillments={fulfillmentsForRule} rule={rule} satisfied={satisfied} activeDegreePlanId={activeDegreePlanId} />
Expand Down
14 changes: 1 addition & 13 deletions frontend/degree-plan/components/Requirements/ReqPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,7 @@ const ReqPanel = ({setModalKey, setModalObject, activeDegreeplan, isLoading, set
console.log('rules to fulfillments', rulesToCourses)
return rulesToCourses;
}, [fulfillments, isLoadingFulfillments])

// const getProgress = (rule: any) => {
// if (rule.q) {
// return [rulesToFulfillments[rule.id].length, rule.num] // rule.num is not the most accurate rep of number of reqs
// }
// let satisfied = 0, total = 0;
// for (let i = 0; i < rule.rules.length; i++) {
// const [satisfiedByRule, totalByRule] = getProgress(rule.rules[i]);
// satisfied += satisfiedByRule; total += totalByRule;
// }
// return [satisfied, total];
// }


return(
<PanelContainer>
<PanelHeader>
Expand Down
188 changes: 0 additions & 188 deletions frontend/degree-plan/util/q_object_grammar.js

This file was deleted.

55 changes: 0 additions & 55 deletions frontend/degree-plan/util/q_object_grammar.ne

This file was deleted.

0 comments on commit ad36cf0

Please sign in to comment.