From 67adb9491f27b1087164da52cc84c4f1786f14e9 Mon Sep 17 00:00:00 2001 From: Frinze Erin Lapuz Date: Fri, 2 Sep 2022 16:30:49 +0800 Subject: [PATCH 1/3] movement and initialisation of review page viewed by the coordinator --- .../CourseEvaluation/Reviews/ReviewCard.tsx | 12 +++++++-- .../{[id].tsx => [id]/index.tsx} | 0 .../[id]/review/[reviewId].tsx | 26 +++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) rename frontend/pages/course-evaluation/{[id].tsx => [id]/index.tsx} (100%) create mode 100644 frontend/pages/course-evaluation/[id]/review/[reviewId].tsx diff --git a/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx b/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx index 4d6fb5c..9bd51ad 100644 --- a/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx +++ b/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx @@ -13,6 +13,7 @@ import { userDisplayName } from '@/components/utils/generic'; import ReviewProgress from '@/components/Reviewer/ReviewProgress'; import AreYouSureModalButton from '@/components/utils/AreYouSureModalButton'; import useAuthenticatedAPIClient from '@/components/hooks/useAuthenticatedAPIClient'; +import { useRouter } from 'next/router'; type Props = { review: ReviewListEntry; @@ -23,6 +24,7 @@ const ReviewCard = (props: Props) => { const axios = useAuthenticatedAPIClient(); const { mutate } = useSWRConfig(); + const router = useRouter(); const handleDelete = async () => { try { @@ -43,8 +45,14 @@ const ReviewCard = (props: Props) => { {userDisplayName(review.reviewer)} - {/* TODO: #19 (part 1) */} - { + const { courseReview } = useCourseReview(false); + const { courseEvaluation } = useCourseEvaluation(); + + const allSteps = getReviewStepsWithState(courseReview); + + return ( + + + + ); +}; + +export default Summary; From 337ff8d7d73d11f3a0194dd5157708ea52573c0f Mon Sep 17 00:00:00 2001 From: Frinze Erin Lapuz Date: Fri, 2 Sep 2022 16:44:10 +0800 Subject: [PATCH 2/3] individual reviewer page summary for coordinator --- .../[id]/review/[reviewId].tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx b/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx index e200145..61970ef 100644 --- a/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx +++ b/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx @@ -4,15 +4,41 @@ import BodyCard from '@/components/utils/BodyCard'; import useCourseReview from '@/components/hooks/useCourseReview'; import useCourseEvaluation from '@/components/hooks/useCourseEvaluation'; import ReviewSummarySubmissionContent from '@/components/Reviewer/Submit/ReviewSummarySubmissionContent'; +import Typography from '@mui/material/Typography'; +import { userDisplayName } from '@/components/utils/generic'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import CardHeader from '@mui/material/CardHeader'; +import Container from '@mui/material/Container'; +import CardActions from '@mui/material/CardActions'; +import Button from '@mui/material/Button'; +import { useRouter } from 'next/router'; +import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore'; const Summary = () => { const { courseReview } = useCourseReview(false); const { courseEvaluation } = useCourseEvaluation(); + const router = useRouter(); const allSteps = getReviewStepsWithState(courseReview); return ( + + + + + Below is the summary of what the reviewer has put in. + + + Date: Fri, 2 Sep 2022 16:46:28 +0800 Subject: [PATCH 3/3] lint fixes --- frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx | 4 +++- frontend/pages/course-evaluation/[id]/review/[reviewId].tsx | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx b/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx index 9bd51ad..ed53a4a 100644 --- a/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx +++ b/frontend/components/CourseEvaluation/Reviews/ReviewCard.tsx @@ -50,7 +50,9 @@ const ReviewCard = (props: Props) => { variant="outlined" color="primary" onClick={() => { - router.push(`/course-evaluation/${review.course_evaluation.id}/review/${review.id}`); + router.push( + `/course-evaluation/${review.course_evaluation.id}/review/${review.id}`, + ); }} > View diff --git a/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx b/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx index 61970ef..b0a345c 100644 --- a/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx +++ b/frontend/pages/course-evaluation/[id]/review/[reviewId].tsx @@ -4,7 +4,6 @@ import BodyCard from '@/components/utils/BodyCard'; import useCourseReview from '@/components/hooks/useCourseReview'; import useCourseEvaluation from '@/components/hooks/useCourseEvaluation'; import ReviewSummarySubmissionContent from '@/components/Reviewer/Submit/ReviewSummarySubmissionContent'; -import Typography from '@mui/material/Typography'; import { userDisplayName } from '@/components/utils/generic'; import Card from '@mui/material/Card'; import CardContent from '@mui/material/CardContent'; @@ -36,7 +35,7 @@ const Summary = () => { Below is the summary of what the reviewer has put in. - +