@@ -32,6 +32,8 @@ type ManageGroupFormProps = {
3232 accessibleInteractiveInstrumentIds : Set < string > ;
3333 defaultIdentificationMethod ?: SubjectIdentificationMethod ;
3434 idValidationRegex ?: null | string ;
35+ minimumAge ?: number ;
36+ minimumAgeApplied ?: boolean ;
3537 subjectIdDisplayLength ?: number ;
3638 } ;
3739 } ;
@@ -86,6 +88,40 @@ const ManageGroupForm = ({ data, onSubmit, readOnly }: ManageGroupFormProps) =>
8688 fr : "Paramètres d'affichage"
8789 } )
8890 } ,
91+ {
92+ fields : {
93+ minimumAgeApplied : {
94+ kind : 'boolean' ,
95+ label : t ( {
96+ en : 'Apply Minimum Age For Subjects' ,
97+ fr : 'Appliquer un âge minimum aux sujets'
98+ } ) ,
99+ variant : 'radio'
100+ } ,
101+ // eslint-disable-next-line perfectionist/sort-objects
102+ minimumAge : {
103+ deps : [ 'minimumAgeApplied' ] ,
104+ kind : 'dynamic' ,
105+ render : ( data ) => {
106+ if ( data . minimumAgeApplied ) {
107+ return {
108+ kind : 'number' ,
109+ label : t ( {
110+ en : 'Enter minimum age' ,
111+ fr : "Entrez l'âge minimum"
112+ } ) ,
113+ variant : 'input'
114+ } ;
115+ }
116+ return null ;
117+ }
118+ }
119+ } ,
120+ title : t ( {
121+ en : 'Age Limit Settings' ,
122+ fr : "Paramètres de l'âge"
123+ } )
124+ } ,
89125 {
90126 fields : {
91127 defaultIdentificationMethod : {
@@ -157,6 +193,8 @@ const ManageGroupForm = ({ data, onSubmit, readOnly }: ManageGroupFormProps) =>
157193 idValidationRegex : $RegexString . optional ( ) ,
158194 idValidationRegexErrorMessageEn : z . string ( ) . optional ( ) ,
159195 idValidationRegexErrorMessageFr : z . string ( ) . optional ( ) ,
196+ minimumAge : z . number ( ) . int ( ) . positive ( ) . optional ( ) ,
197+ minimumAgeApplied : z . boolean ( ) . optional ( ) ,
160198 subjectIdDisplayLength : z . number ( ) . int ( ) . min ( 1 )
161199 } ) }
162200 onSubmit = { ( data ) => {
@@ -169,6 +207,8 @@ const ManageGroupForm = ({ data, onSubmit, readOnly }: ManageGroupFormProps) =>
169207 en : data . idValidationRegexErrorMessageEn ,
170208 fr : data . idValidationRegexErrorMessageFr
171209 } ,
210+ minimumAge : data . minimumAge ,
211+ minimumAgeApplied : data . minimumAgeApplied ,
172212 subjectIdDisplayLength : data . subjectIdDisplayLength
173213 }
174214 } ) ;
0 commit comments