diff --git a/src/components/Application.tsx b/src/components/Application.tsx index 0dcf27abdc..a3c750e19f 100644 --- a/src/components/Application.tsx +++ b/src/components/Application.tsx @@ -31,10 +31,6 @@ export interface IDispatchProps { handlePlaygroundExternalSelect: (external: ExternalLibraryName) => void; } -const assessmentRenderFactory = (cat: string) => (routerProps: RouteComponentProps) => ( - -); - const assessmentRegExp = ':assessmentId(-?\\d+)?/:questionId(\\d+)?'; class Application extends React.Component { @@ -54,10 +50,7 @@ class Application extends React.Component {
- + @@ -97,6 +90,8 @@ const parsePlayground = (props: IApplicationProps) => { } }; +const toIncubator = (routerProps: RouteComponentProps) => ; + const parsePrgrm = (props: RouteComponentProps<{}>) => { const qsParsed = qs.parse(props.location.hash); // legacy support diff --git a/src/components/__tests__/__snapshots__/Application.tsx.snap b/src/components/__tests__/__snapshots__/Application.tsx.snap index 08abf477e4..059cf23338 100644 --- a/src/components/__tests__/__snapshots__/Application.tsx.snap +++ b/src/components/__tests__/__snapshots__/Application.tsx.snap @@ -6,7 +6,7 @@ exports[`Application renders correctly 1`] = `
- + diff --git a/src/components/incubator/EditingWorkspace.tsx b/src/components/incubator/EditingWorkspace.tsx index cac1ea6bcb..5a3b8f10de 100644 --- a/src/components/incubator/EditingWorkspace.tsx +++ b/src/components/incubator/EditingWorkspace.tsx @@ -356,6 +356,7 @@ class AssessmentWorkspace extends React.Component, IStateProps {} @@ -30,12 +27,7 @@ export interface IDispatchProps { handleSubmitAssessment: (id: number) => void; } -export interface IOwnProps { - assessmentCategory: string; -} - export interface IStateProps { - assessmentOverviews?: IAssessmentOverview[]; isStudent: boolean; } @@ -79,40 +71,21 @@ class Assessment extends React.Component { } } - // If there is an assessment to render, create a workspace. The assessment - // overviews must still be loaded for this, to send the due date. - // else if (assessmentId !== null && this.props.assessmentOverviews !== undefined) { - // const overview = this.props.assessmentOverviews.filter(a => a.id === assessmentId)[0] - // const assessmentProps: AssessmentProps = { - // assessmentId, - // questionId, - // notAttempted: overview.status === AssessmentStatuses.not_attempted, - // closeDate: overview.closeAt - // } - // return - // } - - // Otherwise, render a list of assessments to the user. - let display: JSX.Element; - if (this.props.assessmentOverviews === undefined) { - display = } />; - } else { - /** Mission editing card */ - const missionEditingCard = this.state.editingOverview ? ( - - ) : null; - - display = ( - <> - - {missionEditingCard} - - ); - } + /** Mission editing card */ + const missionEditingCard = this.state.editingOverview ? ( + + ) : null; + + const display = ( + <> + + {missionEditingCard} + + ); // Finally, render the ContentDisplay. return ( diff --git a/src/containers/incubator/index.ts b/src/containers/incubator/index.ts index 9f63746feb..885473ea8a 100644 --- a/src/containers/incubator/index.ts +++ b/src/containers/incubator/index.ts @@ -2,22 +2,12 @@ import { connect, MapDispatchToProps, MapStateToProps } from 'react-redux'; import { withRouter } from 'react-router'; import { bindActionCreators, Dispatch } from 'redux'; -import { - fetchAssessmentOverviews, - submitAssessment, - updateAssessment -} from '../../actions/session'; -import { IAssessmentOverview } from '../../components/assessment/assessmentShape'; -import Assessment, { IDispatchProps, IOwnProps, IStateProps } from '../../components/incubator'; +import { fetchAssessmentOverviews, submitAssessment } from '../../actions/session'; +import Assessment, { IDispatchProps, IStateProps } from '../../components/incubator'; import { IState, Role } from '../../reducers/states'; -const mapStateToProps: MapStateToProps = (state, props) => { - const categoryFilter = (overview: IAssessmentOverview) => - overview.category === props.assessmentCategory; +const mapStateToProps: MapStateToProps = (state, props) => { const stateProps: IStateProps = { - assessmentOverviews: state.session.assessmentOverviews - ? state.session.assessmentOverviews.filter(categoryFilter) - : undefined, isStudent: state.session.role ? state.session.role === Role.Student : true }; return stateProps; @@ -27,8 +17,7 @@ const mapDispatchToProps: MapDispatchToProps = (dispatch: Di bindActionCreators( { handleAssessmentOverviewFetch: fetchAssessmentOverviews, - handleSubmitAssessment: submitAssessment, - newAssessment: updateAssessment + handleSubmitAssessment: submitAssessment }, dispatch );