diff --git a/frontend/src/components/TimeLogsPage/InstructorTimeLogsPage.jsx b/frontend/src/components/TimeLogsPage/InstructorTimeLogsPage.jsx index 7dc1eef..33fa75e 100644 --- a/frontend/src/components/TimeLogsPage/InstructorTimeLogsPage.jsx +++ b/frontend/src/components/TimeLogsPage/InstructorTimeLogsPage.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react' import { withRouter } from 'react-router-dom' import { connect } from 'react-redux' -import { TimeLogsSelectForm } from './TimeLogsSelectForm' +import { StudentSelectionForm } from '../common/StudentSelectionForm' import { TimeLogRow } from './TimeLogRow' import TimeLogChart from './TimeLogChart' import LoadingSpinner from '../common/LoadingSpinner' @@ -278,7 +278,7 @@ const InstructorTimeLogsPage = (props) => {
- { - +export const StudentSelectionForm = ({ + configurations, + selectedConfigurationId, + handleConfigurationChange, + groups, + selectedGroupId, + handleGroupChange, + students, + selectedStudentNumber, + handleStudentNumberChange, +}) => { const SelectorWrapper = ({ label, children }) => (
{label} @@ -21,7 +27,7 @@ export const TimeLogsSelectForm = ({ selectedConfigurationId, handleConfigurationChange, handleGroupChange, - handleStudentNumberChange + handleStudentNumberChange, }) => { return ( - )} + ) + } - const GroupIsInConfiguration = ( group, configurationId ) => { + const GroupIsInConfiguration = (group, configurationId) => { return group.configurationId === configurationId } - const GroupSelect = ({ - groups, - selectedGroupId, - handleGroupChange - }) => { + const GroupSelect = ({ groups, selectedGroupId, handleGroupChange }) => { return ( - )} + ) + } - const StudentIsInGroup = ( student, group_id ) => { - return groups.find(g => g.id === group_id)?.studentIds.includes(student.student_number) + const StudentIsInGroup = (student, group_id) => { + return groups + .find((g) => g.id === group_id) + ?.studentIds.includes(student.student_number) } const StudentSelect = ({ selectedGroupId, students, selectedStudentNumber, - handleStudentNumberChange + handleStudentNumberChange, }) => { return (