linting
This commit is contained in:
@@ -9,8 +9,6 @@ import {
|
||||
InputSelect,
|
||||
InputText,
|
||||
} from '@edx/paragon';
|
||||
import queryString from 'query-string';
|
||||
|
||||
import { selectableAssignmentLabels } from '../../data/selectors/filters';
|
||||
import {
|
||||
filterAssignmentType,
|
||||
@@ -22,12 +20,6 @@ import {
|
||||
updateAssignmentLimits,
|
||||
} from '../../data/actions/filters';
|
||||
|
||||
|
||||
const DECIMAL_PRECISION = 2;
|
||||
const GRADE_OVERRIDE_HISTORY_COLUMNS = [{ label: 'Date', key: 'date' }, { label: 'Grader', key: 'grader' },
|
||||
{ label: 'Reason', key: 'reason' },
|
||||
{ label: 'Adjusted grade', key: 'adjustedGrade' }];
|
||||
|
||||
export class Assignments extends React.Component {
|
||||
getAssignmentFilterOptions = () => [
|
||||
{ label: 'All', value: '' },
|
||||
@@ -81,7 +73,6 @@ export class Assignments extends React.Component {
|
||||
this.updateQueryParams({ assignmentType });
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Collapsible title="Assignments" open className="filter-group mb-3">
|
||||
@@ -125,7 +116,7 @@ export class Assignments extends React.Component {
|
||||
step={1}
|
||||
value={this.props.assignmentGradeMin}
|
||||
disabled={!this.props.selectedAssignment}
|
||||
onChange={this.props.setAssignmentGradeMax}
|
||||
onChange={this.props.setAssignmentGradeMin}
|
||||
/>
|
||||
<span className="input-percent-label">%</span>
|
||||
<InputText
|
||||
@@ -160,7 +151,9 @@ Assignments.defaultProps = {
|
||||
assignmentFilterOptions: [],
|
||||
selectedAssignment: '',
|
||||
selectedAssignmentType: '',
|
||||
}
|
||||
selectedCohort: null,
|
||||
selectedTrack: null,
|
||||
};
|
||||
|
||||
Assignments.propTypes = {
|
||||
assignmentGradeMin: PropTypes.string.isRequired,
|
||||
@@ -177,6 +170,7 @@ Assignments.propTypes = {
|
||||
subsectionLabel: PropTypes.string,
|
||||
})),
|
||||
filterAssignmentType: PropTypes.func.isRequired,
|
||||
getUserGrades: PropTypes.func.isRequired,
|
||||
selectedAssignmentType: PropTypes.string,
|
||||
selectedAssignment: PropTypes.string,
|
||||
selectedCohort: PropTypes.string,
|
||||
@@ -196,11 +190,11 @@ export const mapStateToProps = (state) => ({
|
||||
});
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
fetchGrades,
|
||||
getUserGrades: fetchGrades,
|
||||
filterAssignmentType,
|
||||
updateAssignmentFilter,
|
||||
updateAssignmentLimits,
|
||||
updateGradesIfAssignmentGradeFiltersSet,
|
||||
}
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Assignments);
|
||||
|
||||
@@ -82,7 +82,6 @@ export class BulkManagement extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Tab eventKey="bulk_management" title="Bulk Management">
|
||||
@@ -160,6 +159,7 @@ export class BulkManagement extends React.Component {
|
||||
BulkManagement.defaultProps = {
|
||||
bulkImportError: '',
|
||||
bulkManagementHistory: [],
|
||||
courseId: '',
|
||||
uploadSuccess: false,
|
||||
};
|
||||
|
||||
@@ -195,6 +195,6 @@ export const mapStateToProps = (state) => ({
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
submitFileUploadFormData,
|
||||
}
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(BulkManagement);
|
||||
|
||||
@@ -9,11 +9,9 @@ import { faDownload, faSpinner } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
import {
|
||||
downloadBulkGradesReport,
|
||||
downloadInterventionReport
|
||||
downloadInterventionReport,
|
||||
} from '../../data/actions/grades';
|
||||
|
||||
|
||||
|
||||
export class BulkManagementControls extends React.Component {
|
||||
handleClickDownloadInterventions = () => {
|
||||
this.props.downloadInterventionReport(this.props.courseId);
|
||||
@@ -66,6 +64,11 @@ export class BulkManagementControls extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
BulkManagementControls.defaultProps = {
|
||||
courseId: '',
|
||||
showSpinner: false,
|
||||
};
|
||||
|
||||
BulkManagementControls.propTypes = {
|
||||
courseId: PropTypes.string,
|
||||
gradeExportUrl: PropTypes.string.isRequired,
|
||||
@@ -77,7 +80,7 @@ BulkManagementControls.propTypes = {
|
||||
downloadInterventionReport: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export const mapStateToProps = (state) => ({ });
|
||||
export const mapStateToProps = () => ({ });
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
downloadBulkGradesReport,
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
|
||||
import {
|
||||
doneViewingAssignment,
|
||||
updateGrades
|
||||
updateGrades,
|
||||
} from '../../data/actions/grades';
|
||||
|
||||
const GRADE_OVERRIDE_HISTORY_COLUMNS = [{ label: 'Date', key: 'date' }, { label: 'Grader', key: 'grader' },
|
||||
@@ -133,51 +133,35 @@ export class EditModal extends React.Component {
|
||||
}
|
||||
|
||||
EditModal.defaultProps = {
|
||||
|
||||
areGradesFrozen: false,
|
||||
assignmentTypes: [],
|
||||
assignmentFilterOptions: [],
|
||||
canUserViewGradebook: false,
|
||||
cohorts: [],
|
||||
gradeOverrides: [],
|
||||
courseId: '',
|
||||
gradeOverrideCurrentEarnedGradedOverride: null,
|
||||
gradeOverrideHistoryError: '',
|
||||
gradeOverrides: [],
|
||||
gradeOriginalEarnedGraded: null,
|
||||
gradeOriginalPossibleGraded: null,
|
||||
location: {
|
||||
search: '',
|
||||
},
|
||||
courseId: '',
|
||||
selectedCohort: null,
|
||||
selectedTrack: null,
|
||||
selectedAssignmentType: '',
|
||||
selectedAssignment: '',
|
||||
showSpinner: false,
|
||||
tracks: [],
|
||||
bulkImportError: '',
|
||||
uploadSuccess: false,
|
||||
showBulkManagement: false,
|
||||
bulkManagementHistory: [],
|
||||
gradeOverrideHistoryError: '',
|
||||
totalUsersCount: null,
|
||||
filteredUsersCount: null,
|
||||
};
|
||||
|
||||
EditModal.propTypes = {
|
||||
|
||||
assignmentName: PropTypes.string,
|
||||
adjustedGradePossible: PropTypes.string,
|
||||
adjustedGradeValue: PropTypes.number,
|
||||
courseId: PropTypes.string,
|
||||
filterValue: PropTypes.string,
|
||||
open: PropTypes.bool,
|
||||
reasonForChange: PropTypes.string,
|
||||
setAdjustedGradeValue: PropTypes.func,
|
||||
setGradebookState: PropTypes.func,
|
||||
setReasonForChange: PropTypes.func,
|
||||
todaysDate: PropTypes.string,
|
||||
updateModuleId: PropTypes.string,
|
||||
updateUserId: PropTypes.string,
|
||||
updateUserName: PropTypes.string,
|
||||
|
||||
// Gradebook State
|
||||
adjustedGradePossible: PropTypes.string.isRequired,
|
||||
adjustedGradeValue: PropTypes.number.isRequired,
|
||||
assignmentName: PropTypes.string.isRequired,
|
||||
filterValue: PropTypes.string.isRequired,
|
||||
open: PropTypes.bool.isRequired,
|
||||
reasonForChange: PropTypes.string.isRequired,
|
||||
todaysDate: PropTypes.string.isRequired,
|
||||
updateModuleId: PropTypes.string.isRequired,
|
||||
updateUserId: PropTypes.string.isRequired,
|
||||
updateUserName: PropTypes.string.isRequired,
|
||||
|
||||
// Gradebook State Setters
|
||||
setAdjustedGradeValue: PropTypes.func.isRequired,
|
||||
setGradebookState: PropTypes.func.isRequired,
|
||||
setReasonForChange: PropTypes.func.isRequired,
|
||||
|
||||
// redux
|
||||
doneViewingAssignment: PropTypes.func.isRequired,
|
||||
@@ -204,11 +188,11 @@ export const mapStateToProps = (state) => ({
|
||||
grdaeOriginalPossibleGraded: state.grades.grdaeOriginalPossibleGraded,
|
||||
selectedCohort: state.filters.cohort,
|
||||
selectedTrack: state.filters.track,
|
||||
})
|
||||
});
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
doneViewingAssignment,
|
||||
updateGrades,
|
||||
}
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(EditModal);
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Table } from '@edx/paragon';
|
||||
import { formatDateForDisplay } from '../../data/actions/utils';
|
||||
import { getHeadings } from '../../data/selectors/grades';
|
||||
import { fetchGradeOverrideHistory } from '../../data/actions/grades';
|
||||
|
||||
const DECIMAL_PRECISION = 2;
|
||||
|
||||
export class GradebookTable extends React.Component {
|
||||
@@ -25,7 +26,7 @@ export class GradebookTable extends React.Component {
|
||||
this.props.setGradebookState({
|
||||
adjustedGradePossible,
|
||||
adjustedGradeValue: '',
|
||||
modalAssignmentName: `${subsection.subsection_name}`,
|
||||
assignmentName: `${subsection.subsection_name}`,
|
||||
modalOpen: true,
|
||||
reasonForChange: '',
|
||||
todaysDate: formatDateForDisplay(new Date()),
|
||||
@@ -35,7 +36,6 @@ export class GradebookTable extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getLearnerInformation = entry => (
|
||||
<div>
|
||||
<div>{entry.username}</div>
|
||||
@@ -160,7 +160,6 @@ export class GradebookTable extends React.Component {
|
||||
}
|
||||
|
||||
GradebookTable.defaultProps = {
|
||||
areGradesFrozen: false,
|
||||
grades: [],
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable react/sort-comp, react/button-has-type */
|
||||
/* eslint-disable react/sort-comp, react/button-has-type, import/no-named-as-default */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
@@ -7,21 +7,17 @@ import {
|
||||
Icon,
|
||||
InputSelect,
|
||||
InputText,
|
||||
Modal,
|
||||
SearchField,
|
||||
StatefulButton,
|
||||
StatusAlert,
|
||||
Table,
|
||||
Tab,
|
||||
Tabs,
|
||||
} from '@edx/paragon';
|
||||
import queryString from 'query-string';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faDownload, faSpinner, faFilter } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faFilter } from '@fortawesome/free-solid-svg-icons';
|
||||
import { configuration } from '../../config';
|
||||
import PageButtons from '../PageButtons';
|
||||
import Drawer from '../Drawer';
|
||||
import { formatDateForDisplay } from '../../data/actions/utils';
|
||||
import initialFilters from '../../data/constants/filters';
|
||||
import ConnectedFilterBadges from '../FilterBadges';
|
||||
|
||||
@@ -45,7 +41,6 @@ export default class Gradebook extends React.Component {
|
||||
filterValue: '',
|
||||
isMinCourseGradeFilterValid: true,
|
||||
isMaxCourseGradeFilterValid: true,
|
||||
modalAssignmentName: '',
|
||||
modalOpen: false,
|
||||
reasonForChange: '',
|
||||
todaysDate: '',
|
||||
@@ -247,14 +242,15 @@ export default class Gradebook extends React.Component {
|
||||
|
||||
createLimitedSetter = (...keys) => (values) => this.setState(
|
||||
keys.reduce(
|
||||
(obj, key) => ( values[key] === undefined ? obj : { ...obj, [key]: values[key] } ),
|
||||
{}
|
||||
)
|
||||
(obj, key) => (values[key] === undefined ? obj : { ...obj, [key]: values[key] }),
|
||||
{},
|
||||
),
|
||||
)
|
||||
|
||||
safeSetState = this.createLimitedSetter(
|
||||
'adjustedGradePossible',
|
||||
'adjustedGradeValue',
|
||||
'assignmnentName',
|
||||
'modalOpen',
|
||||
'reasonForChange',
|
||||
'todaysDate',
|
||||
@@ -383,14 +379,15 @@ export default class Gradebook extends React.Component {
|
||||
updateUserId={this.state.updateUserId}
|
||||
updateUserName={this.state.updateUserName}
|
||||
/>
|
||||
|
||||
|
||||
</Tab>
|
||||
{this.props.showBulkManagement &&
|
||||
{this.props.showBulkManagement
|
||||
&& (
|
||||
<BulkManagement
|
||||
courseId={this.props.courseId}
|
||||
gradeExportUrl={this.props.gradeExportUrl}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
</Tabs>
|
||||
</div>
|
||||
)}
|
||||
@@ -401,7 +398,7 @@ export default class Gradebook extends React.Component {
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<Assignments
|
||||
<Assignments
|
||||
assignmentGradeMin={this.state.assignmentGradeMin}
|
||||
assignmentGradeMax={this.state.assignmentGradeMax}
|
||||
courseId={this.props.courseId}
|
||||
@@ -470,7 +467,6 @@ Gradebook.defaultProps = {
|
||||
cohorts: [],
|
||||
courseId: '',
|
||||
filteredUsersCount: null,
|
||||
grades: [],
|
||||
location: {
|
||||
search: '',
|
||||
},
|
||||
@@ -492,28 +488,10 @@ Gradebook.propTypes = {
|
||||
id: PropTypes.number,
|
||||
})),
|
||||
courseId: PropTypes.string,
|
||||
fetchGradeOverrideHistory: PropTypes.func.isRequired,
|
||||
filteredUsersCount: PropTypes.number,
|
||||
format: PropTypes.string.isRequired,
|
||||
getRoles: PropTypes.func.isRequired,
|
||||
getUserGrades: PropTypes.func.isRequired,
|
||||
gradeExportUrl: PropTypes.string.isRequired,
|
||||
grades: PropTypes.arrayOf(PropTypes.shape({
|
||||
percent: PropTypes.number,
|
||||
section_breakdown: PropTypes.arrayOf(PropTypes.shape({
|
||||
attempted: PropTypes.bool,
|
||||
category: PropTypes.string,
|
||||
label: PropTypes.string,
|
||||
module_id: PropTypes.string,
|
||||
percent: PropTypes.number,
|
||||
scoreEarned: PropTypes.number,
|
||||
scorePossible: PropTypes.number,
|
||||
subsection_name: PropTypes.string,
|
||||
})),
|
||||
user_id: PropTypes.number,
|
||||
user_name: PropTypes.string,
|
||||
})),
|
||||
headings: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||
history: PropTypes.shape({
|
||||
push: PropTypes.func,
|
||||
}).isRequired,
|
||||
|
||||
Reference in New Issue
Block a user