@@ -4,10 +4,11 @@ import Select from '../../Select'
44import cn from 'classnames'
55import styles from './ReviewType-Field.module.scss'
66import Tooltip from '../../Tooltip'
7- import { DES_TRACK_ID , REVIEW_TYPES , MESSAGE } from '../../../config/constants'
7+ import { DES_TRACK_ID , REVIEW_TYPES , MESSAGE , QA_TRACK_ID } from '../../../config/constants'
88
99const ReviewTypeField = ( { reviewers, challenge, onUpdateOthers, onUpdateSelect } ) => {
1010 const isDesignChallenge = challenge . trackId === DES_TRACK_ID
11+ const isQAChallenge = challenge . trackId === QA_TRACK_ID
1112 const defaultReviewType = isDesignChallenge ? REVIEW_TYPES . INTERNAL : REVIEW_TYPES . COMMUNITY
1213 const reviewType = challenge . reviewType ? challenge . reviewType . toLowerCase ( ) : defaultReviewType
1314 const isCommunity = reviewType === REVIEW_TYPES . COMMUNITY
@@ -19,7 +20,7 @@ const ReviewTypeField = ({ reviewers, challenge, onUpdateOthers, onUpdateSelect
1920 id = 'community'
2021 checked = { isCommunity }
2122 disabled = { disabled }
22- onChange = { ( e ) => e . target . checked && onUpdateOthers ( { field : 'reviewType' , value : 'community' } ) }
23+ onChange = { ( e ) => e . target . checked && onUpdateOthers ( { field : 'reviewType' , value : REVIEW_TYPES . COMMUNITY } ) }
2324 />
2425 < label htmlFor = 'community' >
2526 < div className = { styles . radioButtonLabel } >
@@ -28,6 +29,22 @@ const ReviewTypeField = ({ reviewers, challenge, onUpdateOthers, onUpdateSelect
2829 < input type = 'hidden' />
2930 </ label >
3031 </ div > )
32+ const internalOption = ( disabled ) => ( < div className = { styles . tcRadioButton } >
33+ < input
34+ name = 'internal'
35+ type = 'radio'
36+ id = 'internal'
37+ disabled = { disabled }
38+ checked = { isInternal }
39+ onChange = { ( e ) => e . target . checked && onUpdateOthers ( { field : 'reviewType' , value : REVIEW_TYPES . INTERNAL } ) }
40+ />
41+ < label htmlFor = 'internal' >
42+ < div className = { styles . radioButtonLabel } >
43+ Internal
44+ </ div >
45+ < input type = 'hidden' />
46+ </ label >
47+ </ div > )
3148 return (
3249 < div >
3350 < div className = { styles . row } >
@@ -47,21 +64,15 @@ const ReviewTypeField = ({ reviewers, challenge, onUpdateOthers, onUpdateSelect
4764 }
4865 </ div >
4966 < div className = { styles . subRow } >
50- < div className = { styles . tcRadioButton } >
51- < input
52- name = 'internal'
53- type = 'radio'
54- id = 'internal'
55- checked = { isInternal }
56- onChange = { ( e ) => e . target . checked && onUpdateOthers ( { field : 'reviewType' , value : 'internal' } ) }
57- />
58- < label htmlFor = 'internal' >
59- < div className = { styles . radioButtonLabel } >
60- Internal
61- </ div >
62- < input type = 'hidden' />
63- </ label >
64- </ div >
67+ {
68+ isQAChallenge &&
69+ < Tooltip content = { MESSAGE . INTERNAL_REVIEW_DISABLED } >
70+ { internalOption ( true ) }
71+ </ Tooltip >
72+ }
73+ { ! isQAChallenge &&
74+ internalOption ( )
75+ }
6576 {
6677 isInternal && (
6778 < Select
0 commit comments