Skip to content

Commit

Permalink
Merge pull request #1141 from UniversityOfHelsinkiCS/trunk
Browse files Browse the repository at this point in the history
Fixed when passed, configure sentry releases
  • Loading branch information
Rochet2 authored Jul 19, 2019
2 parents 12324a0 + dd19fca commit 5777497
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class CourseStatsCounter {
failedMany: {},
improvedPassedGrade: {},
notParticipated: { ...allstudents },
notParticipatedOrFailed: { ...allstudents }
notParticipatedOrFailed: { ...allstudents },
markedToSemester: {}
}
this.stats = {
students: 0,
Expand Down Expand Up @@ -67,15 +68,20 @@ class CourseStatsCounter {
this.stats.passingSemesters[semester]++
}

markToSemester(studentnumber) {
this.students.markedToSemester[studentnumber] = true
}

markCredit(studentnumber, grade, passed, failed, improved, semester) {
// studentnumber = `${shajs('sha256').update(process.env.key + studentnumber).digest('hex')}`
this.markAttempt()
this.markParticipation(studentnumber)
this.markGrade(grade, passed, failed, improved)
this.markToAll(studentnumber)
if (passed) {
if (!improved && !this.students.passed[studentnumber]) {
if (!this.students.markedToSemester[studentnumber]) {
this.markPassedSemester(semester)
this.markToSemester(studentnumber)
}
this.markPassingGrade(studentnumber)
} else if (improved) {
Expand Down

This file was deleted.

5 changes: 4 additions & 1 deletion services/oodikone2-frontend/src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const IS_PRODUCTION = process.env.NODE_ENV === 'production'

try {
if (IS_PRODUCTION && BASE_PATH === '/') {
Sentry.init({ dsn: 'https://[email protected]/3' }) // eslint-disable-line
Sentry.init({
dsn: 'https://[email protected]/3',
release: process.env.SENTRY_RELEASE_VERSION
})
}
} catch (e) {
console.log(e) // eslint-disable-line
Expand Down
2 changes: 1 addition & 1 deletion services/oodikone2-frontend/src/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const getTextIn = (texts, language) => {
}

export const useTabs = (id, initialTab, { location, replace }) => {
const [tab, setTab] = useState(null)
const [tab, setTab] = useState(-1)
const [didMount, setDidMount] = useState(false)

const pushToUrl = (newTab) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ class CreditAccumulationGraphHighCharts extends Component {
createTooltip = (point) => {
const { students, language, translate } = this.props
const targetCourse = this.sortCoursesByDate(students[0].courses)
.find(c => c.course.code === point.key)
.find(c => (
point.key === c.course.code &&
point.x === new Date(c.date).getTime()
))

if (!targetCourse) return ''

Expand Down
6 changes: 4 additions & 2 deletions services/oodikone2-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const apiAddress = process.env.BACKEND_ADDR || 'localhost'
const backendURL = `http://${apiAddress}:${apiServerPort}`
const BASE_PATH = process.env.BASE_PATH || '/'
const sentrydryrun = !Boolean(process.env.SENTRY_RELEASE_VERSION)
const sentryreleaseversion = sentrydryrun ? 'dryRun' : process.env.SENTRY_RELEASE_VERSION

module.exports = (env, args) => {
const { mode } = args
Expand Down Expand Up @@ -73,7 +74,8 @@ module.exports = (env, args) => {
USER_ADMINER_URL: JSON.stringify(process.env.USER_ADMINER_URL),
ADMINER_URL: JSON.stringify(process.env.ADMINER_URL),
KONE_ADMINER_URL: JSON.stringify(process.env.KONE_ADMINER_URL),
USAGE_ADMINER_URL: JSON.stringify(process.env.USAGE_ADMINER_URL)
USAGE_ADMINER_URL: JSON.stringify(process.env.USAGE_ADMINER_URL),
SENTRY_RELEASE_VERSION: JSON.stringify(sentryreleaseversion)
}
}),
new MiniCssExtractPlugin({
Expand All @@ -84,7 +86,7 @@ module.exports = (env, args) => {
include: 'dist',
ignoreFile: '.sentrycliignore',
ignore: ['node_modules', 'webpack.config.js'],
release: sentrydryrun ? 'dryRun' : process.env.SENTRY_RELEASE_VERSION,
release: sentryreleaseversion,
dryRun: sentrydryrun
})
],
Expand Down

0 comments on commit 5777497

Please sign in to comment.