* feat: enable teams support * feat: submit grade pending behavior * feat: submit error behavior * fix: Update src/data/services/lms/fakeData/testUtils.js Co-authored-by: leangseu-edx <83240113+leangseu-edx@users.noreply.github.com> Co-authored-by: leangseu-edx <83240113+leangseu-edx@users.noreply.github.com>
48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { connect } from 'react-redux';
|
|
|
|
import { Col, Row } from '@edx/paragon';
|
|
|
|
import { selectors } from 'data/redux';
|
|
import { RequestKeys } from 'data/constants/requests';
|
|
|
|
import ResponseDisplay from 'containers/ResponseDisplay';
|
|
import Rubric from 'containers/Rubric';
|
|
import ReviewErrors from './ReviewErrors';
|
|
|
|
/**
|
|
* <ReviewContent />
|
|
*/
|
|
export const ReviewContent = ({ isFailed, isLoaded, showRubric }) => (isLoaded || isFailed) && (
|
|
<div className="content-block">
|
|
<ReviewErrors />
|
|
{ isLoaded && (
|
|
<Row className="flex-nowrap">
|
|
<Col><ResponseDisplay /></Col>
|
|
{ showRubric && <Rubric /> }
|
|
</Row>
|
|
)}
|
|
</div>
|
|
);
|
|
ReviewContent.defaultProps = {
|
|
isFailed: false,
|
|
isLoaded: false,
|
|
showRubric: false,
|
|
};
|
|
ReviewContent.propTypes = {
|
|
isFailed: PropTypes.bool,
|
|
isLoaded: PropTypes.bool,
|
|
showRubric: PropTypes.bool,
|
|
};
|
|
|
|
export const mapStateToProps = (state) => ({
|
|
isFailed: selectors.requests.isFailed(state, { requestKey: RequestKeys.fetchSubmission }),
|
|
isLoaded: selectors.requests.isCompleted(state, { requestKey: RequestKeys.fetchSubmission }),
|
|
showRubric: selectors.app.showRubric(state),
|
|
});
|
|
|
|
export const mapDispatchToProps = {};
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ReviewContent);
|