Skip to content

Commit

Permalink
Merge pull request #1180 from UniversityOfHelsinkiCS/trunk
Browse files Browse the repository at this point in the history
Fix warnings, enable sentry plugin
  • Loading branch information
Rochet2 authored Jul 29, 2019
2 parents 5cd2a16 + 4826c85 commit 98aaed4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ before_script:
- docker --version
- docker-compose --version
- export AUTHOR_NAME="$(git log -1 ${TRAVIS_COMMIT} --pretty="%aN")"
- export SENTRY_RELEASE_VERSION=${IMAGE}-${TRAVIS_COMMIT}
- if [[ -n "$TRAVIS_TAG" || ("$TRAVIS_BRANCH" = "master" && "$TRAVIS_PULL_REQUEST" = "false") ]];
then export SENTRY_RELEASE_VERSION=${IMAGE}-${TRAVIS_COMMIT};
fi

jobs:
include:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
nats:
image: nats-streaming
image: nats-streaming:0.15.1
command: -cid updaterNATS --file_slice_max_bytes 0 --file_slice_max_age 100h -store file -dir datastore
expose:
- "4222"
Expand Down Expand Up @@ -171,7 +171,7 @@ services:
container_name: updater_writer

scheduler_mongo:
image: mongo
image: mongo:4.0.10
volumes:
- ./mongodata:/data/db
expose:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Fragment } from 'react'
import { connect } from 'react-redux'
import { getActiveLanguage } from 'react-localize-redux'
import { Table } from 'semantic-ui-react'
import { arrayOf, shape, string, func, bool } from 'prop-types'
import { number, shape, string, func, bool } from 'prop-types'
import { getTextIn } from '../../../common'
import '../populationCourseStats.css'

Expand Down Expand Up @@ -91,7 +91,7 @@ const CourseRow = ({ statistics, cumulative, onCourseNameClickFn, isActiveCourse
CourseRow.propTypes = {
statistics: shape({
course: shape({ code: string, name: shape({}) }),
stats: shape({ students: arrayOf(shape({})), passed: bool, passingSemesters: shape({}), passingSemestersCumulative: shape({}) })
stats: shape({ students: number, passed: number, passingSemesters: shape({}), passingSemestersCumulative: shape({}) })
}).isRequired,
cumulative: bool.isRequired,
onCourseNameClickFn: func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { arrayOf, shape, string, func } from 'prop-types'
import CourseRow from './CourseRow'

export default class PassingSemesters extends Component {
propTypes = {
static propTypes = {
courseStatistics: arrayOf(shape({ course: shape({ code: string }) })).isRequired,
onCourseNameClickFn: func.isRequired,
isActiveCourseFn: func.isRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CourseStatsTab = ({ statistics, options, doSelect, selected }) => (
onChange={(_, { value }) => doSelect(value)}
/>
</Form>
{selected && <TeacherStatisticsTable statistics={statistics} onClickFn={null} />}
{selected && <TeacherStatisticsTable statistics={statistics} onClickFn={() => {}} />}
</div>
)

Expand Down Expand Up @@ -46,12 +46,12 @@ class CoursesTab extends Component {
const semesterOptions = this.semesterOptions()
const courseOptions = this.courseOptions()
const courseWithMostCredits = Object.values(courses)
.reduce((c1, c2) => (c1.stats.credits > c2.stats.credits ? c1 : c2))
.reduce((c1, c2) => (c1.stats.credits > c2.stats.credits ? c1 : c2), null)
this.setState({
semesterOptions,
courseOptions,
selectedSemester: semesterOptions[0].value,
selectedCourse: courseWithMostCredits.id
selectedSemester: semesterOptions.length > 0 ? semesterOptions[0].value : null,
selectedCourse: courseWithMostCredits != null ? courseWithMostCredits.id : null
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import '../PopulationQueryCard/populationQueryCard.css'

const statisticsTableTab = (title, statistics) => ({
menuItem: title,
render: () => <TeacherStatisticsTable statistics={statistics} onClickFn={null} />
render: () => <TeacherStatisticsTable statistics={statistics} onClickFn={() => {}} />
})

const formatStatisticsForTable = (statistics, language) => {
Expand All @@ -30,7 +30,7 @@ class TeacherDetails extends Component {
state={}

render() {
const { teacher, language } = this.props
const { teacher, language, history } = this.props
const { courses, years, semesters } = teacher.statistics

const panes = [
Expand All @@ -51,7 +51,7 @@ class TeacherDetails extends Component {
<Icon
name="remove"
className="controlIcon"
onClick={() => this.props.history.goBack()}
onClick={() => history.goBack()}
/>
</Card.Header>
<Card.Meta content={teacher.code} />
Expand Down
16 changes: 8 additions & 8 deletions services/oodikone2-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const DeadCodePlugin = require('webpack-deadcode-plugin')
// const SentryWebpackPlugin = require('@sentry/webpack-plugin')
const SentryWebpackPlugin = require('@sentry/webpack-plugin')

const devServerPort = 8081
const apiServerPort = 8080
Expand Down Expand Up @@ -81,14 +81,14 @@ module.exports = (env, args) => {
new MiniCssExtractPlugin({
filename: '[name]-[hash].css',
chunkFilename: '[id]-[hash].css'
}),
new SentryWebpackPlugin({
include: 'dist',
ignoreFile: '.sentrycliignore',
ignore: ['node_modules', 'webpack.config.js'],
release: sentryreleaseversion,
dryRun: noSentryVersion
})
// new SentryWebpackPlugin({
// include: 'dist',
// ignoreFile: '.sentrycliignore',
// ignore: ['node_modules', 'webpack.config.js'],
// release: sentryreleaseversion,
// dryRun: noSentryVersion
// })
],
optimization: {
minimizer: [new TerserPlugin({
Expand Down

0 comments on commit 98aaed4

Please sign in to comment.