Skip to content

Commit

Permalink
bring back countries to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
totutotu committed Jul 2, 2019
1 parent 9a191e9 commit 276e426
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,14 @@ const throughputStatsForStudytrack = async (studytrack, since) => {
const studentnumbers = await studentnumbersWithAllStudyrightElements([studytrack], startDate, endDate, false, false)
const creditsForStudyprogramme =
await productivityCreditsFromStudyprogrammeStudents(studytrack, startDate, studentnumbers)
console.log('ASDFASDFADSF')
const [credits, graduated, theses, genders, countries, transferredTo, endedStudyright] =
await statsForClass(studentnumbers, startDate, studytrack, endDate)
console.log(countries)
//console.log(year)
//console.log(transferredFrom.rows.map(r => r.get({ plain: true })))
// theres so much shit in the data that transefferFrom doesnt rly mean anything
delete genders[null]
delete countries[null]
delete countries[undefined]
const creditValues = credits.reduce((acc, curr) => {
acc.mte30 = curr >= 30 ? acc.mte30 + 1 : acc.mte30
acc.mte60 = curr >= 60 ? acc.mte60 + 1 : acc.mte60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ const ThroughputTable = ({ history, throughput, thesis, loading, error, studypro
}
const data = throughput && throughput.data ? throughput.data.filter(year => year.credits.length > 0) : []
const genders = data.length > 0 ? uniq(flatten(data.map(year => Object.keys(year.genders)))) : []
const countries = data.length > 0 && throughput.totals.countries ? uniq(flatten(data.map(year => Object.keys(year.countries)))).sort() : []
const countries = data.length > 0 && throughput.totals.countries ?
uniq(flatten(data.map(year => Object.keys(year.countries)))).sort() : []
const renderGenders = genders.length > 0
const renderCountries = false // countries.length > 0, disabled for now
const renderCountries = countries.length > 0
let thesisTypes = []
if (thesis) {
thesisTypes = thesis.map(t => t.thesisType)
Expand Down

0 comments on commit 276e426

Please sign in to comment.