@@ -133,8 +133,8 @@ const CopilotRequestForm: FC<{}> = () => {
133
133
updatedFormErrors . complexity = 'Selection is required'
134
134
}
135
135
136
- if ( ! formValues . requiresCommunicatn ) {
137
- updatedFormErrors . requiresCommunicatn = 'Selection is required'
136
+ if ( ! formValues . requiresCommunication ) {
137
+ updatedFormErrors . requiresCommunication = 'Selection is required'
138
138
}
139
139
140
140
if ( ! formValues . paymentType ) {
@@ -174,7 +174,21 @@ const CopilotRequestForm: FC<{}> = () => {
174
174
. then ( ( ) => {
175
175
toast . success ( 'Copilot request sent successfully' )
176
176
// Reset form after successful submission
177
- setFormValues ( { } )
177
+ setFormValues ( {
178
+ complexity : '' ,
179
+ copilotUsername : '' ,
180
+ numHoursPerWeek : '' ,
181
+ numWeeks : '' ,
182
+ otherPaymentType : '' ,
183
+ overview : '' ,
184
+ paymentType : '' ,
185
+ projectId : '' ,
186
+ projectType : '' ,
187
+ requiresCommunication : '' ,
188
+ skills : [ ] ,
189
+ startDate : undefined ,
190
+ tzRestrictions : '' ,
191
+ } )
178
192
setIsFormChanged ( false )
179
193
setFormErrors ( { } )
180
194
setExistingCopilot ( '' )
@@ -251,7 +265,7 @@ const CopilotRequestForm: FC<{}> = () => {
251
265
tabIndex = { 0 }
252
266
type = 'text'
253
267
onChange = { bind ( handleFormValueChange , this , 'copilotUsername' ) }
254
- value = { formValues . copilotUserName }
268
+ value = { formValues . copilotUsername }
255
269
/>
256
270
</ div >
257
271
)
@@ -369,34 +383,37 @@ const CopilotRequestForm: FC<{}> = () => {
369
383
label = 'Weeks'
370
384
name = 'weeks'
371
385
placeholder = 'Type the number of weeks'
372
- value = { formValues . numWeeks as string }
386
+ value = { formValues . numWeeks ?. toString ( ) }
373
387
onChange = { bind ( handleFormValueChange , this , 'numWeeks' ) }
374
388
error = { formErrors . numWeeks }
375
389
tabIndex = { 0 }
390
+ forceUpdateValue
376
391
/>
377
392
< p className = { styles . formRow } > Are there any timezone requirements or restrictions?</ p >
378
393
< InputText
379
394
dirty
380
395
type = 'text'
381
396
label = 'Timezone Requirements'
382
- name = 'weeks '
397
+ name = 'tzRequirements '
383
398
placeholder = 'Type your response here'
384
399
value = { formValues . tzRestrictions as string }
385
400
onChange = { bind ( handleFormValueChange , this , 'tzRestrictions' ) }
386
401
error = { formErrors . tzRestrictions }
387
402
tabIndex = { 0 }
403
+ forceUpdateValue
388
404
/>
389
405
< p className = { styles . formRow } > What do you expect the commitment to be per week in hours?</ p >
390
406
< InputText
391
407
dirty
392
408
type = 'number'
393
409
label = 'Hours'
394
- name = 'weeks '
410
+ name = 'hours '
395
411
placeholder = 'Type the number of hours required per week'
396
- value = { formValues . numHoursPerWeek as string }
412
+ value = { formValues . numHoursPerWeek ?. toString ( ) }
397
413
onChange = { bind ( handleFormValueChange , this , 'numHoursPerWeek' ) }
398
414
error = { formErrors . numHoursPerWeek }
399
415
tabIndex = { 0 }
416
+ forceUpdateValue
400
417
/>
401
418
< p className = { styles . formRow } >
402
419
Will this project require direct spoken communication with the customer
@@ -408,19 +425,19 @@ const CopilotRequestForm: FC<{}> = () => {
408
425
name = 'yes'
409
426
id = 'yes'
410
427
value = 'yes'
411
- checked = { formValues . requiresCommunicatn === 'yes' }
412
- onChange = { bind ( handleFormValueChange , this , 'requiresCommunicatn ' ) }
428
+ checked = { formValues . requiresCommunication === 'yes' }
429
+ onChange = { bind ( handleFormValueChange , this , 'requiresCommunication ' ) }
413
430
/>
414
431
< InputRadio
415
432
label = 'No'
416
433
name = 'no'
417
434
id = 'no'
418
435
value = 'no'
419
- checked = { formValues . requiresCommunicatn === 'no' }
420
- onChange = { bind ( handleFormValueChange , this , 'requiresCommunicatn ' ) }
436
+ checked = { formValues . requiresCommunication === 'no' }
437
+ onChange = { bind ( handleFormValueChange , this , 'requiresCommunication ' ) }
421
438
/>
422
439
</ div >
423
- { formErrors . requiresCommunicatn && (
440
+ { formErrors . requiresCommunication && (
424
441
< p className = { styles . error } >
425
442
< IconSolid . ExclamationIcon />
426
443
{ formErrors . requiresCommunicatn }
0 commit comments