@@ -133,100 +133,108 @@ function TeamDetailsModal({ open, onClose, submitForm, addedRoles }) {
133
133
< th > Start month</ th >
134
134
< th > </ th >
135
135
</ tr >
136
- { addedRoles . map ( ( { searchId : id , name, numberOfResources, durationWeeks, startMonth } ) => (
137
- < tr styleName = "role-row" key = { id } >
138
- < td > { name } </ td >
139
- < td >
140
- < Field
141
- validate = { validateExists }
142
- name = { `${ id } .numberOfResources` }
143
- initialValue = { numberOfResources }
144
- >
145
- { ( { input, meta } ) => (
146
- < NumberInput
147
- name = { input . name }
148
- value = { input . value }
149
- onChange = { input . onChange }
150
- onBlur = { input . onBlur }
151
- onFocus = { input . onFocus }
152
- min = "1"
153
- error = { meta . touched && meta . error }
154
- />
136
+ { addedRoles . map (
137
+ ( {
138
+ searchId : id ,
139
+ name,
140
+ numberOfResources,
141
+ durationWeeks,
142
+ startMonth,
143
+ } ) => (
144
+ < tr styleName = "role-row" key = { id } >
145
+ < td > { name } </ td >
146
+ < td >
147
+ < Field
148
+ validate = { validateExists }
149
+ name = { `${ id } .numberOfResources` }
150
+ initialValue = { numberOfResources }
151
+ >
152
+ { ( { input, meta } ) => (
153
+ < NumberInput
154
+ name = { input . name }
155
+ value = { input . value }
156
+ onChange = { input . onChange }
157
+ onBlur = { input . onBlur }
158
+ onFocus = { input . onFocus }
159
+ min = "1"
160
+ error = { meta . touched && meta . error }
161
+ />
162
+ ) }
163
+ </ Field >
164
+ < Error name = { `${ id } .numberOfResources` } />
165
+ </ td >
166
+ < td >
167
+ < Field
168
+ validate = { validateExists }
169
+ name = { `${ id } .durationWeeks` }
170
+ initialValue = { durationWeeks }
171
+ >
172
+ { ( { input, meta } ) => (
173
+ < NumberInput
174
+ name = { input . name }
175
+ value = { input . value }
176
+ onChange = { input . onChange }
177
+ onBlur = { input . onBlur }
178
+ onFocus = { input . onFocus }
179
+ min = "4"
180
+ error = { meta . touched && meta . error }
181
+ />
182
+ ) }
183
+ </ Field >
184
+ < Error name = { `${ id } .durationWeeks` } />
185
+ </ td >
186
+ < td >
187
+ { startMonth || startMonthVisible [ id ] ? (
188
+ < >
189
+ < Field
190
+ name = { `${ id } .startMonth` }
191
+ initialValue = { new Date ( startMonth ) . getTime ( ) }
192
+ >
193
+ { ( props ) => (
194
+ < MonthPicker
195
+ name = { props . input . name }
196
+ value = { props . input . value }
197
+ onChange = { props . input . onChange }
198
+ onBlur = { props . input . onBlur }
199
+ onFocus = { props . input . onFocus }
200
+ />
201
+ ) }
202
+ </ Field >
203
+ < Error name = { `${ id } .startMonth` } />
204
+ </ >
205
+ ) : (
206
+ < div styleName = "flex-container" >
207
+ < button
208
+ styleName = "toggle-button"
209
+ onClick = { ( ) =>
210
+ setStartMonthVisible ( ( prevState ) => ( {
211
+ ...prevState ,
212
+ [ id ] : true ,
213
+ } ) )
214
+ }
215
+ >
216
+ Add Start Month
217
+ </ button >
218
+ < InformationTooltip
219
+ iconSize = "14px"
220
+ text = "Requested start month for this position."
221
+ />
222
+ </ div >
155
223
) }
156
- </ Field >
157
- < Error name = { `${ id } .numberOfResources` } />
158
- </ td >
159
- < td >
160
- < Field
161
- validate = { validateExists }
162
- name = { `${ id } .durationWeeks` }
163
- initialValue = { durationWeeks }
164
- >
165
- { ( { input, meta } ) => (
166
- < NumberInput
167
- name = { input . name }
168
- value = { input . value }
169
- onChange = { input . onChange }
170
- onBlur = { input . onBlur }
171
- onFocus = { input . onFocus }
172
- min = "1"
173
- error = { meta . touched && meta . error }
174
- />
175
- ) }
176
- </ Field >
177
- < Error name = { `${ id } .durationWeeks` } />
178
- </ td >
179
- < td >
180
- { startMonth || startMonthVisible [ id ] ? (
181
- < >
182
- < Field
183
- name = { `${ id } .startMonth` }
184
- initialValue = { new Date ( startMonth ) . getTime ( ) }
185
- >
186
- { ( props ) => (
187
- < MonthPicker
188
- name = { props . input . name }
189
- value = { props . input . value }
190
- onChange = { props . input . onChange }
191
- onBlur = { props . input . onBlur }
192
- onFocus = { props . input . onFocus }
193
- />
194
- ) }
195
- </ Field >
196
- < Error name = { `${ id } .startMonth` } />
197
- </ >
198
- ) : (
199
- < div styleName = "flex-container" >
200
- < button
201
- styleName = "toggle-button"
202
- onClick = { ( ) =>
203
- setStartMonthVisible ( ( prevState ) => ( {
204
- ...prevState ,
205
- [ id ] : true ,
206
- } ) )
207
- }
208
- >
209
- Add Start Month
210
- </ button >
211
- < InformationTooltip
212
- iconSize = "14px"
213
- text = "Requested start month for this position."
214
- />
215
- </ div >
216
- ) }
217
- </ td >
218
- < td >
219
- < button
220
- styleName = "delete-role"
221
- onClick = { ( ) => {
222
- dispatch ( deleteSearchedRole ( id ) ) ;
223
- } }
224
- >
225
- < IconCrossLight height = "12px" width = "12px" />
226
- </ button >
227
- </ td >
228
- </ tr >
229
- ) ) }
224
+ </ td >
225
+ < td >
226
+ < button
227
+ styleName = "delete-role"
228
+ onClick = { ( ) => {
229
+ dispatch ( deleteSearchedRole ( id ) ) ;
230
+ } }
231
+ >
232
+ < IconCrossLight height = "12px" width = "12px" />
233
+ </ button >
234
+ </ td >
235
+ </ tr >
236
+ )
237
+ ) }
230
238
</ table >
231
239
</ div >
232
240
</ BaseCreateModal >
0 commit comments