Components

PlanOfStudy

<PlanOfStudy param />

Constructor

# <PlanOfStudy param />

Functional React component for displaying the plan of a student in a table format.

PropTypes:
Name Type Required Description Default
param object Yes An object that contains the user's ID to execute the getPlanByStudentID query

View Source components/users/PlanOfStudy.js, line 7

  • module:moment

The plan of study in a table format

React.ReactElement

Requires

  • module:moment

Methods

# static loader() → {React.ReactElement}

Helper function to display a loading spinner

View Source components/helpers.js, line 216

  • module:react-feather.Loader

Returns the loader component

React.ReactElement

Type Definitions

useState

# AssignmentState

Properties:
Name Type Attributes Default Description
assignment useState.state <optional>
null

This component state holds all the information regarding the assignments that are part of the student's Plan of Study. The structure of the value that is present after component load comes from the getPlan function.

setAssignments useState.resolver

View Source components/users/PlanOfStudy.js, line 34

useState

# CourseState

Properties:
Name Type Attributes Default Description
courses useState.state <optional>
null

The course state is similar to the EnrollmentState.enrollment, as it is set on component load. There are no differences between individual states besides their value and in the case of the loading state, the data type that is used. All other states are either array of objects or true objects. The value that is set on load can be observed by looking at the getPlan function.

setCourses useState.resolver

This function is used to update the value of the courses state.

View Source components/users/PlanOfStudy.js, line 28

useState

# EnrollmentState

Properties:
Name Type Attributes Default Description
enrollment useState.state <optional>
null

The enrollment state of the current component. This read-only variable is set on component load to the enrollment we get from the getPlan function promise return. This variable is used throughout the component to render enrollment details and all relations that are populated by the API in the returned object.

setEnrollment useState.resolver

This function is used solely to update the value of the enrollment state.

View Source components/users/PlanOfStudy.js, line 22

useState

# LoadingState

Properties:
Name Type Attributes Default Description
loading useState.state <optional>
true

A simple loading state that toggles it's value. Once all data fetching is complete, the value is set to false. Until that is complete, this component will render the <Loader /> component.

setLoading useState.resolver

This function is used extensively in this component to control when the render should change.

View Source components/users/PlanOfStudy.js, line 40