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..2f264d74b4 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 || '') }, ]; + internalUser && + additionalDetails.push( + { + label: 'Internal Comment', + value: stripHtml(data.comment || ''), + }, + { + label: 'Internal Documents', + value: file.id)} />, + } + ); + return (