@@ -131,6 +131,7 @@ export default props => {
onNext={handleSubmit}
errors={errors}
dirty={dirty}
+ sectionsInfo={sectionsInfo}
/>,
document.body,
)}
diff --git a/frontend/src/pages/_events/slug/register/RegistrationSectionCustom/index.js b/frontend/src/pages/_events/slug/register/RegistrationSectionCustom/index.js
index 2cf98bb5f..792b0ab68 100644
--- a/frontend/src/pages/_events/slug/register/RegistrationSectionCustom/index.js
+++ b/frontend/src/pages/_events/slug/register/RegistrationSectionCustom/index.js
@@ -47,7 +47,15 @@ const useStyles = makeStyles(theme => ({
},
}))
-export default ({ section, onNext, nextLabel, onPrev, prevLabel, data }) => {
+export default ({
+ section,
+ sectionsInfo,
+ onNext,
+ nextLabel,
+ onPrev,
+ prevLabel,
+ data,
+}) => {
const classes = useStyles()
const { registration } = useContext(EventDetailContext)
console.log('section', section)
@@ -159,15 +167,6 @@ export default ({ section, onNext, nextLabel, onPrev, prevLabel, data }) => {
key={question.name}
className={classes.question}
>
- {/*
-
-
*/}
{props => (
@@ -194,6 +193,7 @@ export default ({ section, onNext, nextLabel, onPrev, prevLabel, data }) => {
onNext={handleSubmit}
errors={errors}
dirty={dirty}
+ sectionsInfo={sectionsInfo}
/>,
document.body,
)}
diff --git a/frontend/src/pages/_events/slug/register/index.js b/frontend/src/pages/_events/slug/register/index.js
index d1ea8ca73..ab8da2982 100644
--- a/frontend/src/pages/_events/slug/register/index.js
+++ b/frontend/src/pages/_events/slug/register/index.js
@@ -146,11 +146,14 @@ export default RequiresPermission(() => {
finishRegistration,
} = useContext(EventDetailContext)
const userProfile = useSelector(UserSelectors.userProfile)
-
const [loading, setLoading] = useState(false)
const [formData, setFormData] = useState({})
const [activeStep, setActiveStep] = useState(0)
const [eventNewsLetterHidden, setEventNewsLetterHidden] = useState(true)
+
+ const globalNavbarElement = document.getElementById('global-navbar')
+ globalNavbarElement.style.display = 'none'
+
useEffect(() => {
setTimeout(function () {
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
@@ -235,6 +238,13 @@ export default RequiresPermission(() => {
return sorted.concat(event?.customQuestions ?? [])
}, [event])
+ const sectionsInfo = (sections, index) => {
+ return {
+ sections: sections.length,
+ activeSection: index + 1,
+ }
+ }
+
const setNextStep = useCallback(
(nextStep, values, path) => {
const newFormData = path
@@ -269,8 +279,10 @@ export default RequiresPermission(() => {
const sec = section.name
section.questions.forEach(question => {
const que = question.name
+ const label = question?.label || 'custom question'
const value = formData[sec][que]
const custom = {
+ label: label,
section: sec,
key: que,
value: value + '',
@@ -287,7 +299,9 @@ export default RequiresPermission(() => {
}
AnalyticsService.events.COMPLETE_REGISTRATION(slug)
setActiveStep(sections.length + 1)
+ globalNavbarElement.style.display = 'block'
} catch (e) {
+ globalNavbarElement.style.display = 'none'
dispatch(
SnackbarActions.error(
'Oops, something went wrong... Please try again',
@@ -332,6 +346,7 @@ export default RequiresPermission(() => {
isActive={activeStep === index}
section={section}
data={formData}
+ sectionsInfo={sectionsInfo(sections, index)}
onPrev={setPrevStep}
prevLabel={prevStep ? prevStep.label : null}
onNext={(values, path) => {
@@ -343,6 +358,7 @@ export default RequiresPermission(() => {
{
const baseFilter = { value: 'final', label: 'Final projects' }
const match = useRouteMatch()
- console.log('match', match)
- console.log('match URL', match.url)
const dispatch = useDispatch()
const { slug } = event
- const { reviewMethod } = event
- console.log('event data', event)
const { token } = match.params
const [data, setData] = useState({})
const [projects, setProjects] = useState([])
@@ -111,7 +106,8 @@ export default ({ event }) => {
onSelect={project =>
dispatch(push(`${match.url}/view/${project._id}`))
}
- showScore={reviewMethod === 'manualReview'}
+ showScore={true}
+ showReviewers={true}
token={token}
/>
diff --git a/frontend/src/pages/_projects/slug/view/projectId/EvaluationForm.js b/frontend/src/pages/_projects/slug/view/projectId/EvaluationForm.js
index 069a2974d..d0af0a652 100644
--- a/frontend/src/pages/_projects/slug/view/projectId/EvaluationForm.js
+++ b/frontend/src/pages/_projects/slug/view/projectId/EvaluationForm.js
@@ -1,6 +1,5 @@
-import React, { useState } from 'react'
-import { Formik, Form, Field, ErrorMessage } from 'formik'
-import Button from 'components/generic/Button'
+import React from 'react'
+import { Formik, Form, Field } from 'formik'
import { Box, Typography } from '@material-ui/core'
import RadioScore from 'components/generic/RadioScore'
import TextAreaInput from 'components/inputs/TextAreaInput'
@@ -8,15 +7,7 @@ import FormControl from 'components/inputs/FormControl'
import BottomBar from 'components/inputs/BottomBar'
import _ from 'lodash'
-const EvaluationForm = ({
- event,
- project,
- submit = () => {},
- score,
- scoreCriteria,
-}) => {
- console.log('Score from eval form', score)
-
+const EvaluationForm = ({ submit = () => {}, score, scoreCriteria }) => {
const allScoresSet = evalScores => {
const scoreList = evalScores.map(value => {
return value?.score ? value.score : null
@@ -26,16 +17,13 @@ const EvaluationForm = ({
const calculateScore = (criterias, decimalPlaces) => {
const multiplier = Math.pow(10, decimalPlaces)
- console.log('Multiplier', multiplier)
const scoreAverage =
criterias.reduce((acc, curr) => {
if (!curr.score) return acc
return curr.score + acc
}, 0) / criterias.length
- console.log('Score average before format', scoreAverage)
const scoreAverageFormatted =
Math.floor(scoreAverage * multiplier) / multiplier
- console.log('Score average', scoreAverageFormatted)
return scoreAverageFormatted
}
@@ -54,23 +42,14 @@ const EvaluationForm = ({
score.scoreCriteria = scoreFiltered
}
- // if (score.scoreCriteria.map) {
-
return (
<>
{formikProps => {
- console.log('formikProps from EvaluationForm', formikProps)
return (