diff --git a/components/review/stages/ReviewDriveToLearnStage.tsx b/components/review/stages/ReviewDriveToLearnStage.tsx index b74022bc..29316e74 100644 --- a/components/review/stages/ReviewDriveToLearnStage.tsx +++ b/components/review/stages/ReviewDriveToLearnStage.tsx @@ -16,12 +16,14 @@ interface Props { name: string; application: ApplicationDTO | undefined; scores: ReviewScores; + viewOnly?: boolean; } export const ReviewDriveToLearnStage = ({ name, application, scores, + viewOnly = false, }: Props) => { const updateScore = useContext(ReviewSetScoresContext); const shortAnswerStr = application?.shortAnswerQuestions[0]; diff --git a/components/review/stages/ReviewEndStage.tsx b/components/review/stages/ReviewEndStage.tsx index e2b24d92..d7096e13 100644 --- a/components/review/stages/ReviewEndStage.tsx +++ b/components/review/stages/ReviewEndStage.tsx @@ -12,6 +12,7 @@ interface Props { scores: ReviewScores; endData: ReviewEndData; setEndData: Dispatch>; + viewOnly?: boolean; } const LeftPanelContent = ({ @@ -164,6 +165,7 @@ export const ReviewEndStage = ({ scores, endData, setEndData, + viewOnly = false, }: Props) => { const [validationError, setValidationError] = useState(false); diff --git a/components/review/stages/ReviewEndSuccessStage.tsx b/components/review/stages/ReviewEndSuccessStage.tsx index 6eace76c..6f8fd878 100644 --- a/components/review/stages/ReviewEndSuccessStage.tsx +++ b/components/review/stages/ReviewEndSuccessStage.tsx @@ -5,9 +5,13 @@ import { ReviewSetStageContext } from "../shared/ReviewContext"; export type Props = { name: string; + viewOnly?: boolean; }; -export const ReviewEndSuccessStage = ({ name }: Props) => { +export const ReviewEndSuccessStage = ({ + name, + viewOnly = false, +}: Props) => { const setStage = useContext(ReviewSetStageContext); return ( diff --git a/components/review/stages/ReviewInfoStage.tsx b/components/review/stages/ReviewInfoStage.tsx index 7b1658b9..9b083711 100644 --- a/components/review/stages/ReviewInfoStage.tsx +++ b/components/review/stages/ReviewInfoStage.tsx @@ -11,6 +11,8 @@ export interface ReviewStageProps { name: string; application: ApplicationDTO | undefined; scores: ReviewScores; + /** When true, review UI is read-only (e.g. admin audit). */ + viewOnly?: boolean; } const InfoBanner = () => ( @@ -49,6 +51,7 @@ export const ReviewInfoStage = ({ name, application, scores, + viewOnly = false, }: ReviewStageProps): React.ReactElement => { const shortAnswerStr = application?.shortAnswerQuestions[0]; const shortAnswerJSON = shortAnswerStr ? JSON.parse(shortAnswerStr) : []; diff --git a/components/review/stages/ReviewPassionForSocialGoodStage.tsx b/components/review/stages/ReviewPassionForSocialGoodStage.tsx index 7771abfa..015e2137 100644 --- a/components/review/stages/ReviewPassionForSocialGoodStage.tsx +++ b/components/review/stages/ReviewPassionForSocialGoodStage.tsx @@ -16,12 +16,14 @@ export interface Props { name: string; application: ApplicationDTO | undefined; scores: ReviewScores; + viewOnly?: boolean; } export const ReviewPassionForSocialGoodStage = ({ name, application, scores, + viewOnly = false, }: Props) => { const updateScore = useContext(ReviewSetScoresContext); const shortAnswerStr = application?.shortAnswerQuestions[0]; diff --git a/components/review/stages/ReviewSkillStage.tsx b/components/review/stages/ReviewSkillStage.tsx index 593f7099..259e3793 100644 --- a/components/review/stages/ReviewSkillStage.tsx +++ b/components/review/stages/ReviewSkillStage.tsx @@ -34,6 +34,7 @@ export const ReviewSkillStage = ({ name, application, scores, + viewOnly = false, }: ReviewStageProps) => { const theme = useTheme(); const updateScore = useContext(ReviewSetScoresContext); diff --git a/components/review/stages/ReviewTeamPlayerStage.tsx b/components/review/stages/ReviewTeamPlayerStage.tsx index 3bc9113a..72e55c05 100644 --- a/components/review/stages/ReviewTeamPlayerStage.tsx +++ b/components/review/stages/ReviewTeamPlayerStage.tsx @@ -16,9 +16,15 @@ interface Props { name: string; application: ApplicationDTO | undefined; scores: ReviewScores; + viewOnly?: boolean; } -export const ReviewTeamPlayerStage = ({ name, application, scores }: Props) => { +export const ReviewTeamPlayerStage = ({ + name, + application, + scores, + viewOnly = false, +}: Props) => { const theme = useTheme(); const updateScore = useContext(ReviewSetScoresContext); const shortAnswerStr = application?.shortAnswerQuestions[0]; diff --git a/pages/review/index.tsx b/pages/review/index.tsx index 781970ab..3340d6ff 100644 --- a/pages/review/index.tsx +++ b/pages/review/index.tsx @@ -76,6 +76,7 @@ const ReviewsPages: NextPage = () => { const [scores, setScores] = useState(initialScores); const reviewId = router.isReady ? getReviewId(router.query) : null; + const viewOnly = router.query.mode === "view"; const name = application?.firstName + " " + application?.lastName; const authenticatedUser = useAuthenticatedUser(); @@ -108,6 +109,7 @@ const ReviewsPages: NextPage = () => { name={name} application={application} scores={scores} + viewOnly={viewOnly} /> ); case ReviewStage.PFSG: @@ -116,6 +118,7 @@ const ReviewsPages: NextPage = () => { name={name} application={application} scores={scores} + viewOnly={viewOnly} /> ); case ReviewStage.TP: @@ -124,6 +127,7 @@ const ReviewsPages: NextPage = () => { name={name} application={application} scores={scores} + viewOnly={viewOnly} /> ); case ReviewStage.D2L: @@ -132,6 +136,7 @@ const ReviewsPages: NextPage = () => { name={name} application={application} scores={scores} + viewOnly={viewOnly} /> ); case ReviewStage.SKL: @@ -140,6 +145,7 @@ const ReviewsPages: NextPage = () => { name={name} application={application} scores={scores} + viewOnly={viewOnly} /> ); case ReviewStage.END: @@ -150,11 +156,12 @@ const ReviewsPages: NextPage = () => { scores={scores} endData={endData} setEndData={setEndData} + viewOnly={viewOnly} /> ); case ReviewStage.END_SUCCESS: default: - return ; + return ; } };