diff --git a/frontend/src/components/generic/RadioScore/index.js b/frontend/src/components/generic/RadioScore/index.js index a26e4eb52..c8c571acc 100644 --- a/frontend/src/components/generic/RadioScore/index.js +++ b/frontend/src/components/generic/RadioScore/index.js @@ -1,19 +1,7 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { - FormControl, - FormControlLabel, - FormLabel, - IconButton, - Radio, - RadioGroup, - Typography, -} from '@material-ui/core' -import { Email } from '@material-ui/icons' -import { Field } from 'formik' +import { FormControl, FormLabel, Radio, RadioGroup } from '@material-ui/core' import _ from 'lodash' -import { capitalize, toInteger, toString } from 'lodash-es' -import React, { useEffect, useState } from 'react' -import { popupCenter } from 'utils/misc' +import { toInteger } from 'lodash-es' +import React, { useState } from 'react' import junctionStyle from 'utils/styles' const scoreArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] @@ -51,6 +39,7 @@ export default ({ category, label, onSelectionChange, value = null }) => { > {scoreArray.map((score, index) => ( handleChange(index)} value={score} diff --git a/frontend/src/pages/_dashboard/renderDashboard/participant/project/ProjectsList.js b/frontend/src/pages/_dashboard/renderDashboard/participant/project/ProjectsList.js index dced7d63b..9ca1fe268 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/participant/project/ProjectsList.js +++ b/frontend/src/pages/_dashboard/renderDashboard/participant/project/ProjectsList.js @@ -5,6 +5,7 @@ import { Paper, Typography, Chip, Box, Grid } from '@material-ui/core' import * as DashboardSelectors from 'redux/dashboard/selectors' import Button from 'components/generic/Button' +import _ from 'lodash' export default props => { const event = useSelector(DashboardSelectors.event) @@ -29,6 +30,13 @@ export default props => { } setChallengeAndTrackSlugState(challengeAndTrackSlugToNameMap) }, [event]) + + const styling = { + trackMaxLength: 30, + challengeMaxLength: 30, + projectNameMaxLength: 30, + } + const ProjectCard = props => { const project = props.project return ( @@ -36,29 +44,35 @@ export default props => { - {project.name} + {_.truncate(project.name, { + length: styling.projectNameMaxLength, + })} {project.track && ( )} {project.challenges && project.challenges.map(challenge => ( diff --git a/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js b/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js index 2a34fbef9..493f8d1f1 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js @@ -47,6 +47,13 @@ export default ({ event }) => { const [projectScore, setProjectScore] = useState(projectScoreBase) const resetProjectData = () => { + if (Array.isArray(scoreCriteriaBase) && scoreCriteriaBase.length > 0) { + scoreCriteriaBase.forEach(criteria => { + if (criteria.score) { + delete criteria.score + } + }) + } setSelected(null) setScoreExists(false) setProjectScore(projectScoreBase)