Skip to content

Commit 1d13ecf

Browse files
authored
Documentation (#145)
* Basic documentation
1 parent 7d69784 commit 1d13ecf

19 files changed

+77
-6
lines changed

my-app/src/presenters/PrerequisitePresenter.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ export const PrerequisitePresenter = observer((props) => {
489489
courses_taken.push(local[i]?.id)
490490
}
491491
}
492-
//console.log(local);
493492
let eligible = generateTree(courses_taken, copy);
494493
if (eligible) {
495494
root["style"]["backgroundColor"] = "lightgreen";

my-app/src/views/Components/CoursePagePopup.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import React, { useEffect, useRef, useState } from 'react';
22
import RatingComponent from "./RatingComponent.jsx";
33
import { model } from "../../model.js";
44

5+
/**
6+
* Handles the popup for a specific course page.
7+
*/
58

69
function CoursePagePopup({
710
favouriteCourses,

my-app/src/views/Components/FavouriteDropdown.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React, { useState } from 'react';
22
import { observer } from "mobx-react-lite";
33

4+
/**
5+
* Shows the dropdown menu to see the favourite flagged courses.
6+
*/
47
const FavouritesDropdown = observer((props) => {
58
const [copied, setCopied] = useState(false);
69

my-app/src/views/Components/RatingComponent.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import StarComponent from "./StarComponent.jsx";
3-
3+
/**
4+
* Component that handles reviews in the form of stars. StarComponent is used for the actual stars.
5+
*/
46
const RatingComponent = ({ value = 0, onChange, readOnly = false, className = "" }) => {
57
const handleRating = (starIndex, isLeftHalf) => {
68
if (readOnly) return;

my-app/src/views/Components/SideBarComponents/ButtonGroupField.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { useEffect, useState } from "react";
22
import ToolTip from './ToolTip';
33

4+
/**
5+
* The ButtonGroupField is used as a selector for the period.
6+
* Used by the SidebarView.
7+
* @param {*} props
8+
* @returns
9+
*/
410
export default function ButtonGroupField(props) {
511

612
const [activeIndex, setActiveIndex] = useState(0);

my-app/src/views/Components/SideBarComponents/CollapsibleCheckboxes.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import React, { useState, useRef } from "react";
22
import FilterEnableCheckbox from "./FilterEnableCheckbox";
33
import Tooltip from "./ToolTip";
44

5+
/**
6+
* Used by the SidebarView for filtering things with checkboxes.
7+
* @param {*} props
8+
* @returns
9+
*/
510
const CollapsibleCheckboxes = (props) => {
611
const [expanded, setExpanded] = useState([]);
712
const [filterEnabled, setFilterEnabled] = useState(props.filterEnable);

my-app/src/views/Components/SideBarComponents/CourseTranscriptList.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { useState, forwardRef } from "react";
2-
2+
/**
3+
* Shows a list of taken courses after uploading a transcript of records.
4+
* Used by the SidebarView.
5+
*/
36
const CourseTranscriptList = forwardRef((props,ref) => {
47
let local = [];
58
if (localStorage.getItem("completedCourses"))

my-app/src/views/Components/SideBarComponents/DropDownField.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { useRef, useEffect } from "react";
33
import FilterEnableCheckbox from "./FilterEnableCheckbox";
44
import Tooltip from "./ToolTip";
55

6+
/**
7+
* Used for selecting the level of a course.
8+
* See SidebarView for more.
9+
* @param {*} props
10+
* @returns
11+
*/
612
export default function DropDownField(props) {
713

814

my-app/src/views/Components/SideBarComponents/FilterEnableCheckbox.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import React, { forwardRef } from "react";
22

3+
/**
4+
* A basic checkbox to enable the filters.
5+
* Used in the SidebarView.
6+
*/
37
const FilterEnableCheckbox = forwardRef(({ initialValue, onToggle }, ref) => {
48
return (
59
<div className='mr-3'>

my-app/src/views/Components/SideBarComponents/MultipleChoiceButtons.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { useRef, useEffect } from "react";
33
import FilterEnableCheckbox from "./FilterEnableCheckbox";
44
import Tooltip from "./ToolTip";
55

6+
/**
7+
* A multiple choice selector used to select the period in the SidebarView.
8+
* @param {} props
9+
* @returns
10+
*/
611
export default function MultipleChoiceButtons(props) {
712
const [filterEnabled, setFilterEnabled] = useState(props.filterEnable);
813
const [selectedItems, setSelectedItems] = useState(props.initialValues || []);

0 commit comments

Comments
 (0)