ready for testing
This commit is contained in:
@@ -7,10 +7,7 @@ import { StatefulButton } from '@edx/paragon';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faDownload, faSpinner } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
import {
|
||||
downloadBulkGradesReport,
|
||||
downloadInterventionReport,
|
||||
} from '../../data/actions/grades';
|
||||
import actions from 'data/actions';
|
||||
|
||||
export class BulkManagementControls extends React.Component {
|
||||
handleClickDownloadInterventions = () => {
|
||||
@@ -83,8 +80,8 @@ BulkManagementControls.propTypes = {
|
||||
export const mapStateToProps = () => ({ });
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
downloadBulkGradesReport,
|
||||
downloadInterventionReport,
|
||||
downloadBulkGradesReport: actions.grades.downloadReport.bulkGrades,
|
||||
downloadInterventionReport: actions.grades.downloadReport.intervention,
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(BulkManagementControls);
|
||||
|
||||
@@ -11,7 +11,8 @@ import {
|
||||
} from '@edx/paragon';
|
||||
|
||||
import selectors from 'data/selectors';
|
||||
import * as actions from 'data/actions';
|
||||
import actions from 'data/actions';
|
||||
import { updateGrades } from 'data/thunkActions/grades';
|
||||
|
||||
const GRADE_OVERRIDE_HISTORY_COLUMNS = [
|
||||
{ label: 'Date', key: 'date' },
|
||||
@@ -201,7 +202,7 @@ export const mapStateToProps = (state) => {
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
doneViewingAssignment: actions.grades.doneViewingAssignment,
|
||||
updateGrades: actions.grades.updateGrades,
|
||||
updateGrades,
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(EditModal);
|
||||
|
||||
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import selectors from 'data/selectors';
|
||||
import * as actions from 'data/actions';
|
||||
import actions from 'data/actions';
|
||||
import { updateGradesIfAssignmentGradeFiltersSet } from 'data/thunkActions/grades';
|
||||
|
||||
import SelectGroup from '../SelectGroup';
|
||||
|
||||
@@ -5,8 +5,9 @@ import { connect } from 'react-redux';
|
||||
|
||||
import { Button } from '@edx/paragon';
|
||||
|
||||
import { fetchGrades } from 'data/thunkActions/grades';
|
||||
import selectors from 'data/selectors';
|
||||
import * as actions from 'data/actions';
|
||||
import actions from 'data/actions';
|
||||
|
||||
import PercentGroup from '../PercentGroup';
|
||||
|
||||
|
||||
@@ -3,14 +3,8 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
<<<<<<< HEAD
|
||||
import * as gradesActions from 'data/actions/grades';
|
||||
import selectors from 'data/selectors';
|
||||
=======
|
||||
import { selectableAssignmentLabels } from 'data/selectors/filters';
|
||||
import * as actions from 'data/actions';
|
||||
>>>>>>> 5694a3b... update actions to use redux toolkit action creators
|
||||
|
||||
import actions from 'data/actions';
|
||||
import SelectGroup from '../SelectGroup';
|
||||
|
||||
export class AssignmentTypeFilter extends React.Component {
|
||||
@@ -76,6 +70,7 @@ export const mapStateToProps = (state) => ({
|
||||
selectedAssignmentType: selectors.filters.assignmentType(state),
|
||||
});
|
||||
|
||||
console.log({ actions });
|
||||
export const mapDispatchToProps = {
|
||||
filterAssignmentType: actions.filters.update.assignmentType,
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
Button,
|
||||
} from '@edx/paragon';
|
||||
|
||||
import { fetchGrades } from 'data/thunkActions/grades';
|
||||
import selectors from 'data/selectors';
|
||||
import actions from 'data/actions';
|
||||
import PercentGroup from '../PercentGroup';
|
||||
@@ -128,7 +129,7 @@ export const mapStateToProps = (state) => {
|
||||
};
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
updateFilter: actions.filter.update.courseGrade,
|
||||
updateFilter: actions.filters.update.courseGradeLimits,
|
||||
getUserGrades: fetchGrades,
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { fetchGrades } from 'data/thunkActions/grades';
|
||||
import selectors from 'data/selectors';
|
||||
import SelectGroup from '../SelectGroup';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
|
||||
|
||||
import { Collapsible, Form } from '@edx/paragon';
|
||||
|
||||
import * as filterActions from 'data/actions/filters';
|
||||
import actions from 'data/actions';
|
||||
import selectors from 'data/selectors';
|
||||
|
||||
import AssignmentTypeFilter from './AssignmentTypeFilter';
|
||||
@@ -114,7 +114,7 @@ export const mapStateToProps = (state) => ({
|
||||
});
|
||||
|
||||
export const mapDispatchToProps = {
|
||||
updateIncludeCourseRoleMembers: filterActions.updateIncludeCourseRoleMembers,
|
||||
updateIncludeCourseRoleMembers: actions.filters.update.includeCourseRoleMembers,
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(GradebookFilters);
|
||||
|
||||
@@ -219,7 +219,7 @@ GradebookTable.propTypes = {
|
||||
|
||||
export const mapStateToProps = (state) => {
|
||||
const { assignmentTypes, grades, root } = selectors;
|
||||
returg {
|
||||
return {
|
||||
areGradesFrozen: assignmentTypes.areGradesFrozen(state),
|
||||
format: grades.gradeFormat(state),
|
||||
grades: grades.allGrades(state),
|
||||
|
||||
@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
|
||||
import { StatusAlert } from '@edx/paragon';
|
||||
|
||||
import selectors from 'data/selectors';
|
||||
import * as actions from 'data/actions';
|
||||
import actions from 'data/actions';
|
||||
|
||||
export const maxCourseGradeInvalidMessage = 'Maximum course grade value must be between 0 and 100. ';
|
||||
export const minCourseGradeInvalidMessage = 'Minimum course grade value must be between 0 and 100. ';
|
||||
|
||||
@@ -10,7 +10,8 @@ import {
|
||||
import { fetchCohorts } from 'data/thunkActions/cohorts';
|
||||
import { fetchTracks } from 'data/thunkActions/tracks';
|
||||
import { getRoles } from 'data/thunkActions/roles';
|
||||
import * as actions from 'data/actions';
|
||||
|
||||
import actions from 'data/actions';
|
||||
import selectors from 'data/selectors';
|
||||
|
||||
import Gradebook from 'components/Gradebook';
|
||||
@@ -55,20 +56,22 @@ const mapStateToProps = (state, ownProps) => {
|
||||
const mapDispatchToProps = {
|
||||
downloadBulkGradesReport: actions.grades.downloadReport.bulkGrades,
|
||||
downloadInterventionReport: actions.grades.downloadReport.intervention,
|
||||
toggleFormat: actions.grades.toggleGradeFormat,
|
||||
|
||||
filterAssignmentType: actions.filters.update.assignmentType,
|
||||
initializeFilters: actions.filters.initialize,
|
||||
updateAssignmentFilter: actions.filters.update.assignment,
|
||||
updateAssignmentLimits: actions.filters.update.assignmentLimits,
|
||||
resetFilters: actions.filters.reset,
|
||||
|
||||
fetchGradeOverrideHistory,
|
||||
filterAssignmentType: actions.filter.update.assignmentType,
|
||||
getAssignmentTypes: fetchAssignmentTypes,
|
||||
getCohorts: fetchCohorts,
|
||||
getPrevNextGrades: fetchPrevNextGrades,
|
||||
getRoles,
|
||||
getTracks: fetchTracks,
|
||||
getUserGrades: fetchGrades,
|
||||
initializeFilters: actions.filters.initialize,
|
||||
resetFilters: actions.filters.reset,
|
||||
submitFileUploadFormData,
|
||||
toggleFormat: actions.grades.toggleGradeFormat,
|
||||
updateAssignmentFilter: actions.filters.update.assignment,
|
||||
updateAssignmentLimits: actions.filters.update.assignmentLimits,
|
||||
};
|
||||
|
||||
const GradebookPage = connect(
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { StrictDict } from 'utils';
|
||||
|
||||
const errorFetching = createAction('assignmentTypes/errorFetching');
|
||||
const startedFetching = createAction('assignmentTypes/startedFetching');
|
||||
|
||||
const received = createAction('assignmentTypes/results'); // payload
|
||||
const gotGradesFrozen = createAction('assignmentTypes/gotGradesFrozen'); // payload
|
||||
|
||||
export {
|
||||
errorFetching,
|
||||
startedFetching,
|
||||
received,
|
||||
gotGradesFrozen,
|
||||
const fetching = {
|
||||
error: createAction('assignmentTypes/fetching/error'),
|
||||
started: createAction('assignmentTypes/fetching/started'),
|
||||
received: createAction('assignmentTypes/fetching/received'),
|
||||
};
|
||||
const gotGradesFrozen = createAction('assignmentTypes/gotGradesFrozen');
|
||||
|
||||
const actions = StrictDict({
|
||||
fetching,
|
||||
gotGradesFrozen,
|
||||
});
|
||||
export default actions;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { StrictDict } from 'utils';
|
||||
|
||||
|
||||
const startedFetching = createAction('cohorts/startedFetching');
|
||||
const errorFetching = createAction('cohorts/errorFetching');
|
||||
const received = createAction('cohorts/received');
|
||||
|
||||
export {
|
||||
errorFetching,
|
||||
received,
|
||||
startedFetching,
|
||||
const fetching = {
|
||||
started: createAction('cohorts/startedFetching'),
|
||||
error: createAction('cohorts/errorFetching'),
|
||||
received: createAction('cohorts/received'),
|
||||
};
|
||||
|
||||
export default StrictDict({
|
||||
fetching,
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { StrictDict } from 'utils';
|
||||
|
||||
const gotBulkManagementConfig = createAction('config/gotBulkManagement'); // payload
|
||||
const gotBulkManagementConfig = createAction('config/gotBulkManagement');
|
||||
|
||||
export {
|
||||
export default StrictDict({
|
||||
gotBulkManagementConfig,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { StrictDict } from 'utils';
|
||||
import initialFilters from '../constants/filters';
|
||||
|
||||
const initialize = createAction('filters/initialize', ({
|
||||
@@ -26,16 +27,16 @@ const initialize = createAction('filters/initialize', ({
|
||||
}));
|
||||
|
||||
const reset = createAction('filters/reset'); // paylaod
|
||||
const update = {
|
||||
const update = StrictDict({
|
||||
assignment: createAction('filters/update/assignment'),
|
||||
assignmentType: createAction('filters/update/assignmentType'),
|
||||
assignmentLimits: createAction('filters/update/assignmentLimits'),
|
||||
courseGrade: createAction('filters/update/courseGrade'),
|
||||
courseGradeLimits: createAction('filters/update/courseGradeLimits'),
|
||||
includeCourseRoleMembers: createAction('filters/update/includeCourseRoleMembers'),
|
||||
};
|
||||
});
|
||||
|
||||
export {
|
||||
export default StrictDict({
|
||||
initialize,
|
||||
reset,
|
||||
update,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { StrictDict } from 'utils';
|
||||
|
||||
const csvUpload = {
|
||||
started: createAction('grades/csvUpload/started'),
|
||||
@@ -82,7 +83,7 @@ const banner = {
|
||||
|
||||
const doneViewingAssignment = createAction('grades/doneViewingAssignment');
|
||||
|
||||
export {
|
||||
export default StrictDict({
|
||||
banner,
|
||||
bulkHistory,
|
||||
csvUpload,
|
||||
@@ -94,4 +95,4 @@ export {
|
||||
toggleGradeFormat,
|
||||
update,
|
||||
uploadOverride,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import * as assignmentTypes from './assignmentTypes';
|
||||
import * as cohorts from './cohorts';
|
||||
import * as config from './config';
|
||||
import * as grades from './grades';
|
||||
import * as roles from './roles';
|
||||
import * as tracks from './tracks';
|
||||
import { StrictDict } from 'utils';
|
||||
|
||||
export {
|
||||
import assignmentTypes from './assignmentTypes';
|
||||
import cohorts from './cohorts';
|
||||
import config from './config';
|
||||
import filters from './filters';
|
||||
import grades from './grades';
|
||||
import roles from './roles';
|
||||
import tracks from './tracks';
|
||||
|
||||
export default StrictDict({
|
||||
assignmentTypes,
|
||||
cohorts,
|
||||
config,
|
||||
filters,
|
||||
grades,
|
||||
roles,
|
||||
tracks,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { StrictDict } from 'utils';
|
||||
|
||||
const errorFetching = createAction('roles/errorFetching');
|
||||
const received = createAction('roles/received');
|
||||
|
||||
export {
|
||||
export default StrictDict({
|
||||
errorFetching,
|
||||
received,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { StrictDict } from 'utils';
|
||||
|
||||
const fetching = {
|
||||
started: createAction('tracks/fetching/started'),
|
||||
@@ -7,6 +7,6 @@ const fetching = {
|
||||
received: createAction('tracks/fetching/received'),
|
||||
};
|
||||
|
||||
export {
|
||||
export default StrictDict({
|
||||
fetching,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as actions from '../actions/assignmentTypes';
|
||||
import actions from '../actions/assignmentTypes';
|
||||
|
||||
const initialState = {
|
||||
results: [],
|
||||
@@ -8,19 +8,19 @@ const initialState = {
|
||||
|
||||
const assignmentTypes = (state = initialState, { type, payload }) => {
|
||||
switch (type) {
|
||||
case actions.received.toString():
|
||||
case actions.fetching.received.toString():
|
||||
return {
|
||||
...state,
|
||||
results: payload,
|
||||
errorFetching: false,
|
||||
finishedFetching: true,
|
||||
};
|
||||
case actions.startedFetching.toString():
|
||||
case actions.fetching.started.toString():
|
||||
return {
|
||||
...state,
|
||||
startedFetching: true,
|
||||
};
|
||||
case actions.errorFetching.toString():
|
||||
case actions.fetching.error.toString():
|
||||
return {
|
||||
...state,
|
||||
finishedFetching: true,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as actions from '../actions/cohorts';
|
||||
import actions from '../actions/cohorts';
|
||||
|
||||
const initialState = {
|
||||
results: [],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { gotBulkManagementConfig } from '../actions/config';
|
||||
import actions from '../actions/config';
|
||||
|
||||
const reducer = (state = {}, action) => {
|
||||
switch (action.type) {
|
||||
case gotBulkManagementConfig.toString():
|
||||
case actions.gotBulkManagementConfig.toString():
|
||||
return {
|
||||
...state,
|
||||
bulkManagementAvailable: action.payload,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import filterSelectors from 'data/selectors/filters';
|
||||
import * as actions from '../actions/filters';
|
||||
import * as gradeActions from '../actions/grades';
|
||||
import actions from '../actions/filters';
|
||||
import gradeActions from '../actions/grades';
|
||||
import initialFilters from '../constants/filters';
|
||||
|
||||
const { getAssignmentsFromResultsSubstate, chooseRelevantAssignmentData } = filterSelectors;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as actions from '../actions/grades';
|
||||
import * as filterActions from '../actions/filters';
|
||||
import actions from '../actions/grades';
|
||||
import filterActions from '../actions/filters';
|
||||
|
||||
const initialState = {
|
||||
results: [],
|
||||
@@ -58,7 +58,7 @@ const grades = (state = initialState, { type, payload }) => {
|
||||
} = state;
|
||||
return rest;
|
||||
}
|
||||
case actions.gradeOverride.received.toString():
|
||||
case actions.overrideHistory.received.toString():
|
||||
return {
|
||||
...state,
|
||||
gradeOverrideHistoryResults: payload.overrideHistory,
|
||||
@@ -98,7 +98,7 @@ const grades = (state = initialState, { type, payload }) => {
|
||||
...state,
|
||||
gradeFormat: payload,
|
||||
};
|
||||
case filterActions.filterAssignmentType.toString():
|
||||
case filterActions.update.assignmentType.toString():
|
||||
return {
|
||||
...state,
|
||||
selectedAssignmentType: payload.filterType,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as actions from '../actions/roles';
|
||||
import actions from '../actions/roles';
|
||||
|
||||
const initialState = {
|
||||
canUserViewGradebook: null,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as actions from '../actions/tracks';
|
||||
import actions from '../actions/tracks';
|
||||
|
||||
const initialState = {
|
||||
results: [],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const selectors = {
|
||||
canUserViewGradebook: ({ roles }) => roles.canUserViewGradebook,
|
||||
canUserViewGradebook: ({ roles }) => !!roles.canUserViewGradebook,
|
||||
};
|
||||
|
||||
export default selectors;
|
||||
|
||||
@@ -5,8 +5,7 @@ import { createLogger } from 'redux-logger';
|
||||
import { createMiddleware } from 'redux-beacon';
|
||||
import Segment, { trackEvent, trackPageView } from '@redux-beacon/segment';
|
||||
|
||||
import * as actions from './actions';
|
||||
|
||||
import actions from './actions';
|
||||
import reducers from './reducers';
|
||||
|
||||
const loggerMiddleware = createLogger();
|
||||
@@ -68,7 +67,7 @@ const eventsMap = {
|
||||
label: payload.courseId,
|
||||
},
|
||||
})),
|
||||
[actions.grades.downloadReport.bulkGrade.toString()]: trackEvent(
|
||||
[actions.grades.downloadReport.bulkGrades.toString()]: trackEvent(
|
||||
({ payload }) => ({
|
||||
name: 'edx.gradebook.reports.grade_export.downloaded',
|
||||
properties: {
|
||||
@@ -77,7 +76,7 @@ const eventsMap = {
|
||||
},
|
||||
}),
|
||||
),
|
||||
[actions.grades.downloadReport.invervention.toString()]: trackEvent(
|
||||
[actions.grades.downloadReport.intervention.toString()]: trackEvent(
|
||||
({ payload }) => ({
|
||||
name: 'edx.gradebook.reports.intervention.downloaded',
|
||||
properties: {
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
|
||||
import * as assignmentTypes from '../actions/assignmentTypes';
|
||||
import * as config from '../actions/config';
|
||||
import actions from '../actions';
|
||||
|
||||
import LmsApiService from '../services/LmsApiService';
|
||||
|
||||
const { fetching, gotGradesFrozen } = actions.assignmentTypes;
|
||||
const { gotBulkManagementConfig } = actions.config;
|
||||
|
||||
const fetchAssignmentTypes = courseId => (
|
||||
(dispatch) => {
|
||||
dispatch(assignmentTypes.startedFetching());
|
||||
dispatch(fetching.started());
|
||||
return LmsApiService.fetchAssignmentTypes(courseId)
|
||||
.then(response => response.data)
|
||||
.then((data) => {
|
||||
dispatch(assignmentTypes.received(Object.keys(data.assignment_types)));
|
||||
dispatch(assignmentTypes.gotGradesFrozen(data.grades_frozen));
|
||||
dispatch(config.gotBulkManagementConfig(data.can_see_bulk_management));
|
||||
dispatch(fetching.received(Object.keys(data.assignment_types)));
|
||||
dispatch(gotGradesFrozen(data.grades_frozen));
|
||||
dispatch(gotBulkManagementConfig(data.can_see_bulk_management));
|
||||
})
|
||||
.catch(() => {
|
||||
dispatch(assignmentTypes.errorFetching());
|
||||
dispatch(fetching.error());
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
|
||||
import * as cohorts from '../actions/cohorts';
|
||||
import cohorts from '../actions/cohorts';
|
||||
|
||||
import LmsApiService from '../services/LmsApiService';
|
||||
|
||||
const fetchCohorts = courseId => (
|
||||
(dispatch) => {
|
||||
dispatch(cohorts.startedFetching());
|
||||
dispatch(cohorts.fetching.started());
|
||||
return LmsApiService.fetchCohorts(courseId)
|
||||
.then(response => response.data)
|
||||
.then((data) => {
|
||||
dispatch(cohorts.received(data.cohorts));
|
||||
dispatch(cohorts.fetching.received(data.cohorts));
|
||||
})
|
||||
.catch(() => {
|
||||
dispatch(cohorts.errorFetching());
|
||||
dispatch(cohorts.fetching.error());
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
|
||||
import * as filters from '../actions/filters';
|
||||
|
||||
import { getFilters } from '../selectors/filters';
|
||||
import filters from '../actions/filters';
|
||||
import selectors from '../selectors';
|
||||
|
||||
import { fetchGrades } from './grades';
|
||||
|
||||
const updateIncludeCourseRoleMembers = (includeCourseRoleMembers) => (dispatch, getState) => {
|
||||
dispatch(filters.update.includeCourseRoleMembers(includeCourseRoleMembers));
|
||||
const state = getState();
|
||||
const { cohort, track, assignmentType } = getFilters(state);
|
||||
const { cohort, track, assignmentType } = selectors.filters.allFilters(state);
|
||||
dispatch(fetchGrades(state.grades.courseId, cohort, track, assignmentType));
|
||||
};
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
|
||||
|
||||
import * as grades from '../actions/grades';
|
||||
import grades from '../actions/grades';
|
||||
import { sortAlphaAsc } from '../actions/utils';
|
||||
|
||||
import { getFilters } from '../selectors/filters';
|
||||
import {
|
||||
import selectors from '../selectors';
|
||||
|
||||
import GRADE_OVERRIDE_HISTORY_ERROR_DEFAULT_MSG from '../constants/errors';
|
||||
|
||||
import LmsApiService from '../services/LmsApiService';
|
||||
|
||||
const {
|
||||
formatMaxAssignmentGrade,
|
||||
formatMinAssignmentGrade,
|
||||
formatMaxCourseGrade,
|
||||
formatMinCourseGrade,
|
||||
formatGradeOverrideForDisplay,
|
||||
} from '../selectors/grades';
|
||||
|
||||
import GRADE_OVERRIDE_HISTORY_ERROR_DEFAULT_MSG from '../constants/errors';
|
||||
|
||||
import LmsApiService from '../services/LmsApiService';
|
||||
} = selectors.grades;
|
||||
|
||||
const defaultAssignmentFilter = 'All';
|
||||
|
||||
@@ -41,7 +42,7 @@ const fetchGrades = (
|
||||
courseGradeMin,
|
||||
courseGradeMax,
|
||||
includeCourseRoleMembers,
|
||||
} = getFilters(getState());
|
||||
} = selectors.filters.allFilters(getState());
|
||||
const { id: assignmentId } = assignment || {};
|
||||
const assignmentGradeMax = formatMaxAssignmentGrade(assignmentMax, { assignmentId });
|
||||
const assignmentGradeMin = formatMinAssignmentGrade(assignmentMin, { assignmentId });
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import * as roles from '../actions/roles';
|
||||
|
||||
import { getFilters } from '../selectors/filters';
|
||||
import roles from '../actions/roles';
|
||||
import selectors from '../selectors';
|
||||
|
||||
import { fetchCohorts } from './cohorts';
|
||||
import {
|
||||
@@ -24,7 +23,11 @@ const getRoles = courseId => (
|
||||
|
||||
const canUserViewGradebook = (response.is_staff || (response.roles.some(isAllowedRole)));
|
||||
dispatch(roles.received({ canUserViewGradebook, courseId }));
|
||||
const { cohort, track, assignmentType } = getFilters(getState());
|
||||
const {
|
||||
cohort,
|
||||
track,
|
||||
assignmentType,
|
||||
} = selectors.filters.allFilters(getState());
|
||||
if (canUserViewGradebook) {
|
||||
dispatch(fetchGrades(courseId, cohort, track, assignmentType));
|
||||
dispatch(fetchTracks(courseId));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import * as tracks from '../actions/tracks';
|
||||
import tracks from '../actions/tracks';
|
||||
|
||||
import { hasMastersTrack } from '../selectors/tracks';
|
||||
import selectors from '../selectors';
|
||||
|
||||
import {
|
||||
fetchBulkUpgradeHistory,
|
||||
@@ -16,7 +16,7 @@ const fetchTracks = courseId => (
|
||||
.then(response => response.data)
|
||||
.then((data) => {
|
||||
dispatch(tracks.fetching.received(data.course_modes));
|
||||
if (hasMastersTrack(data.course_modes)) {
|
||||
if (selectors.tracks.hasMastersTrack(data.course_modes)) {
|
||||
dispatch(fetchBulkUpgradeHistory(courseId));
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user