Skip to content

Commit 45b867e

Browse files
author
himaniraghav3
committed
project types and basic fixes
1 parent 6c5bd34 commit 45b867e

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

src/apps/copilots/src/constants/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ export enum ProjectType {
44
marathonCopilot = 'Data Science (Marathon Copilot)',
55
sprintCopilot = 'Data Science (Sprint Copilot)',
66
marathonTester = 'Data Science (Marathon Tester)',
7-
qa = 'QA',
7+
qa = 'QA (Quality Assurance)',
8+
ai='AI (Artificial Intelligence)',
89
}
910

1011
export const ProjectTypes = [
@@ -14,4 +15,5 @@ export const ProjectTypes = [
1415
ProjectType.marathonTester,
1516
ProjectType.sprintCopilot,
1617
ProjectType.qa,
18+
ProjectType.ai,
1719
]

src/apps/copilots/src/pages/copilot-request-form/index.tsx

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ const CopilotRequestForm: FC<{}> = () => {
133133
updatedFormErrors.complexity = 'Selection is required'
134134
}
135135

136-
if (!formValues.requiresCommunicatn) {
137-
updatedFormErrors.requiresCommunicatn = 'Selection is required'
136+
if (!formValues.requiresCommunication) {
137+
updatedFormErrors.requiresCommunication = 'Selection is required'
138138
}
139139

140140
if (!formValues.paymentType) {
@@ -174,7 +174,21 @@ const CopilotRequestForm: FC<{}> = () => {
174174
.then(() => {
175175
toast.success('Copilot request sent successfully')
176176
// 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+
})
178192
setIsFormChanged(false)
179193
setFormErrors({})
180194
setExistingCopilot('')
@@ -251,7 +265,7 @@ const CopilotRequestForm: FC<{}> = () => {
251265
tabIndex={0}
252266
type='text'
253267
onChange={bind(handleFormValueChange, this, 'copilotUsername')}
254-
value={formValues.copilotUserName}
268+
value={formValues.copilotUsername}
255269
/>
256270
</div>
257271
)
@@ -369,34 +383,37 @@ const CopilotRequestForm: FC<{}> = () => {
369383
label='Weeks'
370384
name='weeks'
371385
placeholder='Type the number of weeks'
372-
value={formValues.numWeeks as string}
386+
value={formValues.numWeeks?.toString()}
373387
onChange={bind(handleFormValueChange, this, 'numWeeks')}
374388
error={formErrors.numWeeks}
375389
tabIndex={0}
390+
forceUpdateValue
376391
/>
377392
<p className={styles.formRow}>Are there any timezone requirements or restrictions?</p>
378393
<InputText
379394
dirty
380395
type='text'
381396
label='Timezone Requirements'
382-
name='weeks'
397+
name='tzRequirements'
383398
placeholder='Type your response here'
384399
value={formValues.tzRestrictions as string}
385400
onChange={bind(handleFormValueChange, this, 'tzRestrictions')}
386401
error={formErrors.tzRestrictions}
387402
tabIndex={0}
403+
forceUpdateValue
388404
/>
389405
<p className={styles.formRow}>What do you expect the commitment to be per week in hours?</p>
390406
<InputText
391407
dirty
392408
type='number'
393409
label='Hours'
394-
name='weeks'
410+
name='hours'
395411
placeholder='Type the number of hours required per week'
396-
value={formValues.numHoursPerWeek as string}
412+
value={formValues.numHoursPerWeek?.toString()}
397413
onChange={bind(handleFormValueChange, this, 'numHoursPerWeek')}
398414
error={formErrors.numHoursPerWeek}
399415
tabIndex={0}
416+
forceUpdateValue
400417
/>
401418
<p className={styles.formRow}>
402419
Will this project require direct spoken communication with the customer
@@ -408,19 +425,19 @@ const CopilotRequestForm: FC<{}> = () => {
408425
name='yes'
409426
id='yes'
410427
value='yes'
411-
checked={formValues.requiresCommunicatn === 'yes'}
412-
onChange={bind(handleFormValueChange, this, 'requiresCommunicatn')}
428+
checked={formValues.requiresCommunication === 'yes'}
429+
onChange={bind(handleFormValueChange, this, 'requiresCommunication')}
413430
/>
414431
<InputRadio
415432
label='No'
416433
name='no'
417434
id='no'
418435
value='no'
419-
checked={formValues.requiresCommunicatn === 'no'}
420-
onChange={bind(handleFormValueChange, this, 'requiresCommunicatn')}
436+
checked={formValues.requiresCommunication === 'no'}
437+
onChange={bind(handleFormValueChange, this, 'requiresCommunication')}
421438
/>
422439
</div>
423-
{formErrors.requiresCommunicatn && (
440+
{formErrors.requiresCommunication && (
424441
<p className={styles.error}>
425442
<IconSolid.ExclamationIcon />
426443
{formErrors.requiresCommunicatn}

0 commit comments

Comments
 (0)