Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -191,11 +189,9 @@ const ProposalReviewContent = ({
></TechnicalReviewContainer>
</Paper>
</Fragment>
) : !isUserOfficer && !isFapSec ? (
<TechnicalReviewInformation data={technicalReview as TechnicalReview} />
) : (
<TechnicalReviewQuestionaryReview
data={technicalReview as TechnicalReviewWithQuestionary}
data={technicalReview as TechnicalReview}
/>
);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -14,6 +16,13 @@ export default function TechnicalReviewQuestionaryReview(
data: TechnicalReviewWithQuestionary;
} & TableProps<FunctionComponent<unknown>>
) {
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) : [];
Expand All @@ -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: <DownloadableFileList fileIds={fileId.map((file) => file.id)} />,
},
{ label: 'Public Comment', value: stripHtml(data.publicComment || '') },
];

internalUser &&
Comment thread
yoganandaness marked this conversation as resolved.
additionalDetails.push(
{
label: 'Internal Comment',
value: stripHtml(data.comment || ''),
},
{
label: 'Internal Documents',
value: <DownloadableFileList fileIds={fileId.map((file) => file.id)} />,
}
);

return (
<ReviewQuestionaryDetails
questionaryId={data.questionaryId}
Expand Down