Skip to content

Commit

Permalink
fix bug with refresh in course population
Browse files Browse the repository at this point in the history
  • Loading branch information
esakemp committed Aug 13, 2019
1 parent 3cdd036 commit 92c5f57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const mapStateToProps = ({ coursePopulation, localize, singleCourseStats, popula
selectedStudents = difference(samples.map(s => s.studentNumber), selectedStudents)
}
}

console.log(singleCourseStats)
return ({
studentData: coursePopulation.students,
courses: coursePopulation.courses,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { courseCreditFilter } from '../../populationFilters'
const CourseCreditFilter = ({ coursecode, courseData, filter, setPopulationFilterAction, removePopulationFilterAction }) => {
const [credits, setCredits] = useState(0)
const handleFilter = () => {
setPopulationFilterAction(courseCreditFilter({ credits, coursecode, coursename: courseData[coursecode].name }))
setPopulationFilterAction(courseCreditFilter({ credits, coursecode, coursename: courseData.name }))
}

const handleChange = (e, { value }) => {
Expand Down Expand Up @@ -38,7 +38,7 @@ const CourseCreditFilter = ({ coursecode, courseData, filter, setPopulationFilte
/>
</Form.Field>
<Form.Field>
<label>credits from course {courseData[coursecode].name}</label>
<label>credits from course {courseData.name}</label>
</Form.Field>
<Form.Field>
<Button
Expand Down Expand Up @@ -71,8 +71,8 @@ CourseCreditFilter.propTypes = {
coursecode: string.isRequired
}

const mapStateToProps = ({ courseStats }) => ({
courseData: courseStats.data
const mapStateToProps = ({ singleCourseStats }) => ({
courseData: singleCourseStats.stats
})

export default connect(mapStateToProps, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { gradeFilter } from '../../populationFilters'
const GradeFilter = ({ coursecode, courseData, filter, setPopulationFilterAction, removePopulationFilterAction }) => {
const [grade, setGrade] = useState(0)
const handleFilter = () => {
setPopulationFilterAction(gradeFilter({ grade, coursecode, coursename: courseData[coursecode].name }))
setPopulationFilterAction(gradeFilter({ grade, coursecode, coursename: courseData.name }))
}

const handleChange = (e, { value }) => {
Expand Down Expand Up @@ -42,7 +42,7 @@ const GradeFilter = ({ coursecode, courseData, filter, setPopulationFilterAction
/>
</Form.Field>
<Form.Field>
<label>from course {courseData[coursecode].name}</label>
<label>from course {courseData.name}</label>
</Form.Field>
<Form.Field>
<Button
Expand Down Expand Up @@ -75,8 +75,8 @@ GradeFilter.propTypes = {
coursecode: string.isRequired
}

const mapStateToProps = ({ courseStats }) => ({
courseData: courseStats.data
const mapStateToProps = ({ singleCourseStats }) => ({
courseData: singleCourseStats.stats
})

export default connect(mapStateToProps, {
Expand Down

0 comments on commit 92c5f57

Please sign in to comment.