diff --git a/src/components/astro/AstroClassroomsTable.jsx b/src/components/astro/AstroClassroomsTable.jsx index 261b3368..60088d80 100644 --- a/src/components/astro/AstroClassroomsTable.jsx +++ b/src/components/astro/AstroClassroomsTable.jsx @@ -27,7 +27,7 @@ const AstroClassroomsTable = (props) => { return ( - + {props.children} diff --git a/src/components/classrooms/ClassroomsManager.jsx b/src/components/classrooms/ClassroomsManager.jsx index 5bc8b153..4829ace6 100644 --- a/src/components/classrooms/ClassroomsManager.jsx +++ b/src/components/classrooms/ClassroomsManager.jsx @@ -13,7 +13,6 @@ import { } from '../../ducks/classrooms'; import ClassroomFormContainer from '../../containers/classrooms/ClassroomFormContainer'; -import ConfirmationDialog from '../common/ConfirmationDialog'; import ClassroomsTableContainer from '../../containers/classrooms/ClassroomsTableContainer'; const ClassroomsManager = (props) => { @@ -24,14 +23,6 @@ const ClassroomsManager = (props) => { {props.classroomInstructions}
+ + + + + + + + + {props.classrooms.map((classroom) => { + // TODO update URL once we have staging/production hosts + + const joinURL = `${window.location.host}/#/${props.selectedProgram.slug}/students/classrooms/${classroom.id}/join?token=${classroom.joinToken}`; + // Can we get linked assignments with classrooms in single get request? + // No, if we want this, then we need to open an issue with the API + // TODO replace classifications_target with calculated percentage + + // The trailing slash is inconsistent in React Router 4's match.url property... + const editURL = (props.match.url[props.match.url.length - 1] === '/') ? props.match.url : `${props.match.url}/`; + return ( + + + + + {((props.assignments[classroom.id] && + props.assignments[classroom.id].length === 0 && + props.assignmentsStatus === ASSIGNMENTS_STATUS.FETCHING) || + (Object.keys(props.assignments).length === 0 && + props.assignmentsStatus === ASSIGNMENTS_STATUS.FETCHING)) && + + + } + {(props.assignments[classroom.id] && + props.assignments[classroom.id].length === 0 && + props.assignmentsStatus === ASSIGNMENTS_STATUS.SUCCESS) && + + + } + {(props.assignments[classroom.id] && + props.assignmentsStatus === ASSIGNMENTS_STATUS.SUCCESS) && + props.assignments[classroom.id].map((assignment) => { + return ( + + + + + + + ); + })} + + ); + })} +
Your ClassroomsCompletedDue DateView Project
+ + + + + + + + + + No assignments have been created yet. + + + + {assignment.name} + + {(assignment.metadata && assignment.metadata.classifications_target) ? + assignment.metadata.classifications_target : ''} + + + + + Project Page{' '} +
+
+ ); +}; + +DarienClassroomsTable.defaultProps = { + closeConfirmationDialog: () => {}, + maybeDeleteAssignment: () => {}, + maybeDeleteClassroom: () => {}, + selectClassroom: () => {}, + toggleAssignmentForm: () => {}, + ...CLASSROOMS_INITIAL_STATE, + ...ASSIGNMENTS_INITIAL_STATE +}; + +DarienClassroomsTable.propTypes = { + closeConfirmationDialog: PropTypes.func, + maybeDeleteAssignment: PropTypes.func, + maybeDeleteClassroom: PropTypes.func, + selectClassroom: PropTypes.func, + toggleAssignmentForm: PropTypes.func, + ...CLASSROOMS_PROPTYPES, + ...ASSIGNMENTS_PROPTYPES +}; + +export default DarienClassroomsTable; diff --git a/src/components/darien/DarienHome.jsx b/src/components/darien/DarienHome.jsx index fc874ab5..e8f311dc 100644 --- a/src/components/darien/DarienHome.jsx +++ b/src/components/darien/DarienHome.jsx @@ -50,7 +50,7 @@ class DarienHome extends React.Component { Are you an educator or a student/explorer? Make your selection to get started! -