From 0a66c9f54ece92bad60471b4e8df004988cb7bb0 Mon Sep 17 00:00:00 2001 From: Thomas Cottee Meldrum Date: Fri, 26 Sep 2025 11:42:25 +0100 Subject: [PATCH 1/2] feat: show tech review template to more roles --- .../review/ProposalReviewContent.tsx | 6 +- .../review/TechnicalReviewInformation.tsx | 81 ------------------- .../TechnicalReviewQuestionaryReview.tsx | 31 ++++--- 3 files changed, 23 insertions(+), 95 deletions(-) delete mode 100644 apps/frontend/src/components/review/TechnicalReviewInformation.tsx diff --git a/apps/frontend/src/components/review/ProposalReviewContent.tsx b/apps/frontend/src/components/review/ProposalReviewContent.tsx index acb65c9639..f8234a8dd7 100644 --- a/apps/frontend/src/components/review/ProposalReviewContent.tsx +++ b/apps/frontend/src/components/review/ProposalReviewContent.tsx @@ -26,13 +26,11 @@ import { ProposalDataTechnicalReview, useProposalData, } from 'hooks/proposal/useProposalData'; -import { TechnicalReviewWithQuestionary } from 'models/questionary/technicalReview/TechnicalReviewWithQuestionary'; import { getFullUserName } from 'utils/user'; import ProposalReviewContainer from './ProposalReviewContainer'; import ProposalTechnicalReviewerAssignment from './ProposalTechnicalReviewerAssignment'; import TechnicalReviewContainer from './TechnicalReviewContainer'; -import TechnicalReviewInformation from './TechnicalReviewInformation'; import TechnicalReviewQuestionaryReview from './TechnicalReviewQuestionaryReview'; import InternalReviews from '../internalReview/InternalReviews'; @@ -191,11 +189,9 @@ const ProposalReviewContent = ({ > - ) : !isUserOfficer && !isFapSec ? ( - ) : ( ); } diff --git a/apps/frontend/src/components/review/TechnicalReviewInformation.tsx b/apps/frontend/src/components/review/TechnicalReviewInformation.tsx deleted file mode 100644 index 1a7b9f53fb..0000000000 --- a/apps/frontend/src/components/review/TechnicalReviewInformation.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import Table from '@mui/material/Table'; -import TableBody from '@mui/material/TableBody'; -import TableCell from '@mui/material/TableCell'; -import TableRow from '@mui/material/TableRow'; -import Typography from '@mui/material/Typography'; -import { getTranslation } from '@user-office-software/duo-localisation'; -import React, { Fragment } from 'react'; - -import { TechnicalReview, UserRole } from 'generated/sdk'; -import { useCheckAccess } from 'hooks/common/useCheckAccess'; -import { getFullUserName } from 'utils/user'; - -type TechnicalReviewInformationProps = { - data: TechnicalReview | null | undefined; -}; - -const TechnicalReviewInformation = (props: TechnicalReviewInformationProps) => { - const isInstrumentScientist = useCheckAccess([UserRole.INSTRUMENT_SCIENTIST]); - - if (!props.data) { - return

Proposal has no technical review

; - } - - return ( - - ({ marginTop: theme.spacing(2) })} - gutterBottom - > - Technical Review - - - - - Status - - {props.data.status && getTranslation(props.data.status)} - - - {isInstrumentScientist && ( - - Internal Comment - - - )} - - Comment - - - - - Time Allocation({props.data.proposal?.call?.allocationTimeUnit}s) - - {props.data.timeAllocation} - - - Reviewer - {getFullUserName(props.data.reviewer)} - - - Technical review assignee - - {getFullUserName(props.data.technicalReviewAssignee)} - - - -
-
- ); -}; - -export default TechnicalReviewInformation; diff --git a/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx b/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx index 91282a9dd9..9dcc4f191d 100644 --- a/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx +++ b/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx @@ -4,6 +4,8 @@ import React, { FunctionComponent } from 'react'; import { DownloadableFileList } from 'components/common/DownloadableFileList'; import UOLoader from 'components/common/UOLoader'; import { TableRowData } from 'components/questionary/QuestionaryDetails'; +import { UserRole } from 'generated/sdk'; +import { useCheckAccess } from 'hooks/common/useCheckAccess'; import stripHtml from 'utils/stripHtml'; import ReviewQuestionaryDetails from './ReviewQuestionaryDetails'; @@ -14,6 +16,13 @@ export default function TechnicalReviewQuestionaryReview( data: TechnicalReviewWithQuestionary; } & TableProps> ) { + const internalUser = useCheckAccess([ + UserRole.USER_OFFICER, + UserRole.FAP_SECRETARY, + UserRole.INSTRUMENT_SCIENTIST, + UserRole.INTERNAL_REVIEWER, + ]); + const { data, ...restProps } = props; const fileId: { id: string }[] = data.files ? JSON.parse(data.files) : []; @@ -37,17 +46,21 @@ export default function TechnicalReviewQuestionaryReview( label: `Time allocation(${data.proposal?.call?.allocationTimeUnit}s)`, value: data.timeAllocation?.toString() || '', }, - { - label: 'Comment', - value: stripHtml(data.comment || ''), - }, - { - label: 'Internal Documents', - value: file.id)} />, - }, - { label: 'Public Comment', value: stripHtml(data.publicComment || '') }, + { label: 'Comment', value: stripHtml(data.publicComment || '') }, ]; + internalUser && + additionalDetails.push( + { + label: 'Internal Comment', + value: stripHtml(data.comment || ''), + }, + { + label: 'Internal Documents', + value: file.id)} />, + } + ); + return ( Date: Tue, 7 Oct 2025 15:52:46 +0100 Subject: [PATCH 2/2] Update apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx Co-authored-by: Yoganandan Pandiyan <132274772+yoganandaness@users.noreply.github.com> --- .../src/components/review/TechnicalReviewQuestionaryReview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx b/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx index 9dcc4f191d..2f264d74b4 100644 --- a/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx +++ b/apps/frontend/src/components/review/TechnicalReviewQuestionaryReview.tsx @@ -46,7 +46,7 @@ export default function TechnicalReviewQuestionaryReview( label: `Time allocation(${data.proposal?.call?.allocationTimeUnit}s)`, value: data.timeAllocation?.toString() || '', }, - { label: 'Comment', value: stripHtml(data.publicComment || '') }, + { label: 'Public Comment', value: stripHtml(data.publicComment || '') }, ]; internalUser &&