Skip to content

Commit f3280dc

Browse files
daDevBoatkexanaDinoxhLSKprSailet03
authored
Prereq oaktree bug fix and added periods in listview (#108)
* sidebar component add * tailwind workin, beggining page building * structure * fixed app * Main design layout * initial sidebar * courseView init * the course page initial tests * Make it run on my comuter * Tree without database integration * fixes * npm update * add to page * Biiiiig Refactoring * Broken version of prereq tree * Fixed not rendering anything. Still broken * Working v1 * handling #prereqs * Test * removed commented out code * More info expands now * More info expands now * More info expands now * Start coding on line 135 in PrereqTreePresenter Mr. PO * Prereqs colored and expands more info * added css styling * Fixed copy bug * Crash fix in PrerequisitePresenter.jsx * merge fix * Prereq tree compression, error handling, debuging, database update * Added null support (hopefully) * Bug fixes * Desplays periods --------- Co-authored-by: kexana <deotsts@gmail.com> Co-authored-by: Sami Al Saati <sami.alsaati@hotmail.com> Co-authored-by: Kacper Lisik <lisik@kth.se> Co-authored-by: Elias Tosteberg <elias.tosteberg@gmail.com> Co-authored-by: Sailet03 <52610280+Sailet03@users.noreply.github.com>
1 parent ccce142 commit f3280dc

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

my-app/src/presenters/PrerequisitePresenter.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,7 @@ export const PrerequisitePresenter = observer((props) => {
459459
let key = Object.keys(prereqs);
460460
if (prereqs[key] === true) {
461461
return true;
462-
}
463-
else {
462+
} else {
464463
return false;
465464
}
466465

my-app/src/views/ListView.jsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ function ListView(props) {
2626
}
2727
};
2828

29+
const handlePeriods = (periods) => {
30+
let ret_string = "";
31+
if (periods) {
32+
let keys = Object.keys(periods);
33+
console.log(periods["P1"])
34+
for (let key of keys) {
35+
if (periods[key]) {
36+
ret_string += key + " | ";
37+
}
38+
}
39+
return ret_string.slice(0, -2);
40+
} else {
41+
return;
42+
}
43+
};
44+
45+
const handlePeriods2 = (course) => {
46+
return "Test";
47+
}
48+
49+
2950
useEffect(() => {
3051
setIsLoading(true);
3152
const initialCourses = props.sortedCourses.slice(0, 10);
@@ -145,8 +166,11 @@ function ListView(props) {
145166
className="p-5 mb-3 hover:bg-blue-100 flex items-center border border-b-black border-solid w-full rounded-lg cursor-pointer"
146167
>
147168
<div>
169+
<div className="codeNameContainer" style={{ display: 'flex' }}>
148170
<p className="font-bold text-[#000061]">{course.code}</p>
149-
<p className="font-bold">{course.name}</p>
171+
<p className="font-bold text-[#000061]" style={{color: "GrayText", opacity: 0.5, marginLeft: "0.5em"}}>{handlePeriods(course?.periods)}</p>
172+
</div>
173+
<p className="font-bold">{course.name} </p>
150174
<p
151175
className="text-gray-600"
152176
dangerouslySetInnerHTML={{

0 commit comments

Comments
 (0)