11import { TableProps } from '@mui/material' ;
2- import React , { FunctionComponent } from 'react' ;
2+ import React , { FunctionComponent , useContext } from 'react' ;
33
44import UOLoader from 'components/common/UOLoader' ;
55import ProposalQuestionaryDetails from 'components/proposal/ProposalQuestionaryDetails' ;
66import { TableRowData } from 'components/questionary/QuestionaryDetails' ;
7- import { BasicUserDetails } from 'generated/sdk' ;
7+ import UserList from 'components/user/UserList' ;
8+ import UserListItem from 'components/user/UserListItem' ;
9+ import { FeatureContext } from 'context/FeatureContextProvider' ;
10+ import { FeatureId } from 'generated/sdk' ;
811import { ProposalWithQuestionary } from 'models/questionary/proposal/ProposalWithQuestionary' ;
9- import { getFullUserNameWithBasicDetails } from 'utils/user' ;
1012
1113export default function ProposalQuestionaryReview (
1214 props : {
1315 data : ProposalWithQuestionary ;
1416 } & TableProps < FunctionComponent < unknown > >
1517) {
1618 const { data, ...restProps } = props ;
19+ const featureContext = useContext ( FeatureContext ) ;
20+ const isDataAccessUsersEnabled = featureContext . featuresMap . get (
21+ FeatureId . DATA_ACCESS_USERS
22+ ) ?. isEnabled ;
1723
1824 if ( ! data . questionaryId ) {
1925 return < UOLoader style = { { marginLeft : '50%' , marginTop : '100px' } } /> ;
@@ -34,14 +40,25 @@ export default function ProposalQuestionaryReview(
3440 { label : 'Abstract' , value : data . abstract } ,
3541 {
3642 label : 'Principal Investigator' ,
37- value : getFullUserNameWithBasicDetails ( data . proposer ) ,
43+ value : < UserListItem user = { data . proposer } /> ,
3844 } ,
3945 {
4046 label : 'Co-Proposers' ,
41- value : users
42- . map ( ( user : BasicUserDetails ) => getFullUserNameWithBasicDetails ( user ) )
43- . join ( ', ' ) ,
47+ value : < UserList users = { users } /> ,
4448 } ,
49+ ...( isDataAccessUsersEnabled && data . dataAccessUsers
50+ ? [
51+ {
52+ label : 'Data Access Users' ,
53+ value : (
54+ < UserList
55+ users = { data . dataAccessUsers }
56+ data-cy = "data-access-users-list"
57+ />
58+ ) ,
59+ } ,
60+ ]
61+ : [ ] ) ,
4562 ...( data . coProposerInvites ?. length > 0
4663 ? [
4764 {
0 commit comments