diff --git a/backend/modules/project/controller.js b/backend/modules/project/controller.js index 703df643..4ac02368 100644 --- a/backend/modules/project/controller.js +++ b/backend/modules/project/controller.js @@ -241,16 +241,20 @@ controller.getDataForPartnerReviewing = async (event, user) => { recruiter => recruiter.recruiterId === user.sub, ) if (challengeOrg) { - const challengeData = _.find( - event.challenges, - challenge => challenge.partner === challengeOrg.organization, - ) - const projectsFilteredByChallenge = _.filter( - projectsWithExistingTeamsAndFinal, - project => _.includes(project.challenges, challengeData.slug), - ) + const challengesArray = [] + event.challenges.map(challenge => { + if (challenge.partner === challengeOrg.organization) { + challengesArray.push(challenge.slug) + } + }) + const projectsFilteredByChallenge = [] + + projectsWithExistingTeamsAndFinal.map(project => { + if (_.includes(challengesArray, project.challenges[0])) { + projectsFilteredByChallenge.push(project) + } + }) data.projects = projectsFilteredByChallenge - data.challenge = challengeData } else { data.projects = [] } diff --git a/frontend/src/components/modals/ProjectReviewModal/index.js b/frontend/src/components/modals/ProjectReviewModal/index.js index 2957cd74..58d7e5ef 100644 --- a/frontend/src/components/modals/ProjectReviewModal/index.js +++ b/frontend/src/components/modals/ProjectReviewModal/index.js @@ -30,6 +30,9 @@ const ProjectScoreModal = ({ )} {projectScoreData?.reviewers?.length > 0 && projectScoreData.reviewers.map((reviewer, index) => { + if (!reviewer?.message) { + return null + } return ( { @@ -179,7 +180,12 @@ const ProjectsGridItem = ({ {project.challenges.map((challenge, index) => ( ))} @@ -251,9 +257,11 @@ const ProjectsGridItem = ({ 1 ? 'people' @@ -262,8 +270,8 @@ const ProjectsGridItem = ({ > + - {project.reviewers.length - - 1} + {project?.scoreData + ?.reviewers?.length - 1} ) diff --git a/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/Blocks/AlertBlock.js b/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/Blocks/AlertBlock.js index 47e1fcc1..ca15b4fd 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/Blocks/AlertBlock.js +++ b/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/Blocks/AlertBlock.js @@ -1,29 +1,21 @@ import React from 'react' -import { useSelector } from 'react-redux' import { Grid, Typography } from '@material-ui/core' -import * as DashboardSelectors from 'redux/dashboard/selectors' import GradientBox from 'components/generic/GradientBox' import { Alerts } from '../../../../../../components/messaging/alerts' import TimeLineBlock from '../Blocks/TimeLineBlock' const makeBoxStyles = () => ({ - - backgroundColor: '#f7fafc', border: `2px solid #e2e8f0`, borderRadius: '6px', - height: '100%' + height: '100%', //TODO: blurr the bottom // backgroundColor: '#f8f8f8', - }) const makeTimelineStyles = () => ({ - - - backgroundColor: '#f7fafc', border: `2px solid #e2e8f0`, borderRadius: '6px', @@ -31,39 +23,34 @@ const makeTimelineStyles = () => ({ overflow: 'auto', - - // backgroundColor: '#f8f8f8', - }) export default ({ alerts = [] }) => { - return ( <> - - 0 && ( + - - Announcements - -
- -
- -
- + + + Announcements + +
+ +
+
+ )} + 0 ? 4 : 12}> {
-
+ ) } diff --git a/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/index.js b/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/index.js index 07092359..528c9e0f 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/generalPages/default/index.js @@ -22,18 +22,10 @@ import { EventPageScripts } from '@hackjunction/shared' import { useSelector } from 'react-redux' import * as DashboardSelectors from 'redux/dashboard/selectors' // import * as AuthSelectors from 'redux/auth/selectors' -import * as UserSelectors from 'redux/user/selectors' // import PartnerReviewingBlock from './Blocks/PartnerReviewingBlock' export default ({ alerts }) => { - const user = useSelector(UserSelectors.userProfile) const event = useSelector(DashboardSelectors.event) const projects = useSelector(DashboardSelectors.projects) - // const isPartner = - // user.userId == 'google-oauth2|108766439620242776277' || - // (useSelector(AuthSelectors.idTokenData)?.roles?.includes('Recruiter') && - // !useSelector(AuthSelectors.idTokenData)?.roles?.includes( - // 'SuperAdmin', - // )) return ( diff --git a/frontend/src/pages/_dashboard/renderDashboard/index.js b/frontend/src/pages/_dashboard/renderDashboard/index.js index ff48dd25..3a7b6bcb 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/index.js @@ -1,8 +1,7 @@ import React, { useEffect, useState } from 'react' -import { useRouteMatch, useLocation } from 'react-router' +import { useRouteMatch } from 'react-router' import { useDispatch, useSelector } from 'react-redux' -import { makeStyles } from '@material-ui/core/styles' import PageWrapper from 'components/layouts/PageWrapper' import PartnerDashboard from './partner' @@ -11,12 +10,10 @@ import OrganizerDashboard from './organiser' import * as DashboardSelectors from 'redux/dashboard/selectors' import * as DashboardActions from 'redux/dashboard/actions' -import * as OrganiserActions from 'redux/organiser/actions' import * as AuthSelectors from 'redux/auth/selectors' import * as UserSelectors from 'redux/user/selectors' import * as UserActions from 'redux/user/actions' -import { useTranslation } from 'react-i18next' import { useLazyQuery, useSubscription } from '@apollo/client' import { ALERTS_QUERY } from 'graphql/queries/alert' import { NEW_ALERTS_SUBSCRIPTION } from 'graphql/subscriptions/alert' @@ -27,21 +24,6 @@ import { } from 'graphql/queries/events' // import { Chat } from 'components/messaging/chat' -const useStyles = makeStyles(theme => ({ - sidebarTop: { - padding: theme.spacing(3), - height: '100%', - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - justifyContent: 'center', - }, - sidebarLogo: { - width: '100%', - objectFit: 'contain', - }, -})) - export default role => { const match = useRouteMatch() const dispatch = useDispatch() diff --git a/frontend/src/pages/_dashboard/renderDashboard/partner/index.js b/frontend/src/pages/_dashboard/renderDashboard/partner/index.js index 69f23fde..e8785df6 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/partner/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/partner/index.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import React, { useEffect, useState } from 'react' import { useRouteMatch, useLocation } from 'react-router' import DashboardIcon from '@material-ui/icons/Dashboard' @@ -23,7 +23,6 @@ import CalendarPage from './calendar' import RecruitmentPage from './partnerrecruitment' import MapPage from '../generalPages/map' -import { useTranslation } from 'react-i18next' import Badge from '@material-ui/core/Badge' import ProjectsPage from './projects' @@ -54,7 +53,6 @@ export default ({ lockedPages, }) => { const classes = useStyles() - const { t } = useTranslation() const match = useRouteMatch() const location = useLocation() const [alertCount, setAlertCount] = useState(originalAlertCount) @@ -92,7 +90,7 @@ export default ({ ), - label: t('Dashboard_'), + label: 'Dashboard', component: () => { setAlertCount(0) if (shownPages?.experimental) { @@ -129,7 +127,7 @@ export default ({ exact: true, icon: , hidden: !shownPages?.hackerPack, - label: t('Hackerpack_'), + label: 'Hackerpack', component: HackerpackPage, }, { diff --git a/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js b/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js index a7d8cf69..2a34fbef 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/partner/projects/index.js @@ -191,19 +191,17 @@ export default ({ event }) => { return ( <>
- {inputData?.challenge?.name && ( - 1 || - inputData?.projects.length < 1 - ? 's' - : '' - }`} - /> - )} + 1 || + inputData?.projects.length < 1 + ? 's' + : '' + }`} + />
@@ -235,8 +233,6 @@ export default ({ event }) => { {scoreCriteriaBase && scoreCriteriaBase.length > 0 && (