Skip to content

Commit

Permalink
[Courses tab] Include Hyv. grades in Excel
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Jun 19, 2024
1 parent 603774b commit 93aabb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion services/frontend/src/common/hooks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isEqual } from 'lodash'
import qs from 'query-string'
import { useCallback, useState, useEffect, useRef } from 'react'
import { useCallback, useEffect, useRef, useState } from 'react'

import { SEARCH_HISTORY_VERSION } from '@/constants'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,11 @@ const CoursesTable = ({ curriculum, includeSubstitutions, populationCourses, stu
const getTotalRowVal = (total, code) => total[code]

const getNumericGrade = grade => {
if (grade === 'Hyl.') {
return 0
const numericGrade = parseInt(grade, 10)
if (Number.isInteger(numericGrade)) {
return numericGrade
}
if (['1', '2', '3', '4', '5'].includes(grade)) {
return parseInt(grade, 10)
}
return null
return grade
}

const hasActiveEnrollments = (student, code) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, useContext, useState, useEffect } from 'react'
import { Icon, Card, Portal, Popup, Button } from 'semantic-ui-react'
import { Button, Card, Icon, Popup, Portal } from 'semantic-ui-react'

import './style.css'

Expand All @@ -9,8 +9,8 @@ const Header = ({ children, actions, onClickExport }) => {
const { isFullscreen, setFullscreen } = useContext(FigureContext)

return (
<Card.Content style={{ flexGrow: 0, display: 'flex', alignItems: 'center', padding: '1em', height: '3.25em' }}>
<div style={{ fontWeight: 'bold', fontSize: '1.1rem' }}>{children}</div>
<Card.Content style={{ alignItems: 'center', display: 'flex', flexGrow: 0, height: '3.25em', padding: '1em' }}>
<div style={{ fontSize: '1.1rem', fontWeight: 'bold' }}>{children}</div>
<div style={{ flexGrow: 1 }} />
<div style={{ marginRight: '1em' }}>{actions}</div>
<Button
Expand All @@ -32,7 +32,7 @@ const Header = ({ children, actions, onClickExport }) => {
/>
}
>
Toggle Fullscreen
Toggle fullscreen
</Popup>
</Card.Content>
)
Expand Down Expand Up @@ -74,7 +74,7 @@ export const FigureContainer = ({ children, style }) => {
<FigureContext.Provider value={{ isFullscreen, setFullscreen }}>
{isFullscreen ? (
<Portal open={isFullscreen}>
<div style={{ inset: '70px 0px 0px 0px', position: 'absolute', zIndex: 3, height: '10000vh' }}>
<div style={{ height: '10000vh', inset: '70px 0px 0px 0px', position: 'absolute', zIndex: 3 }}>
<Card fluid style={{ position: 'sticky', margin: 0, inset: 0, height: '100vh', zIndex: 2 }}>
{children}
</Card>
Expand Down

0 comments on commit 93aabb9

Please sign in to comment.