Skip to content

Commit b60e4db

Browse files
authored
Merge pull request #854 from topcoder-platform/profiles-app
MP-312 & MP-313 update work exp modal -> dev
2 parents 2179f1b + 4dc7377 commit b60e4db

File tree

5 files changed

+34
-40
lines changed

5 files changed

+34
-40
lines changed

src/apps/onboarding/src/components/modal-add-work/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import moment from 'moment'
55

66
import { Button, IconSolid, InputDatePicker, InputSelect, InputText, Tooltip } from '~/libs/ui'
77
import { FormInputCheckbox } from '~/apps/self-service/src/components/form-elements'
8+
import { INDUSTRIES_OPTIONS } from '~/libs/shared'
89

9-
import { INDUSTRIES_OPTIONS } from '../../config'
1010
import OnboardingBaseModal from '../onboarding-base-modal'
1111
import WorkInfo, { emptyWorkInfo } from '../../models/WorkInfo'
1212

src/apps/onboarding/src/config/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,3 @@ export const ACTIONS: {
2525
UPDATE_MEMBER_PHOTO_URL: 'UPDATE_MEMBER_PHOTO_URL',
2626
},
2727
}
28-
29-
export const INDUSTRIES_OPTIONS: string[] = [
30-
'Banking',
31-
'Consumer goods',
32-
'Energy',
33-
'Entertainment',
34-
'Healthcare',
35-
'Pharma',
36-
'Tech & technology services',
37-
'Telecoms',
38-
'Public sector',
39-
'Travel & hospitality',
40-
]

src/apps/profiles/src/member-profile/work-expirence/ModifyWorkExpirenceModal/ModifyWorkExpirenceModal.tsx

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
/* eslint-disable complexity */
22
import { Dispatch, FC, MutableRefObject, SetStateAction, useRef, useState } from 'react'
3-
import { bind, trim } from 'lodash'
3+
import { bind, sortBy, trim } from 'lodash'
44
import { toast } from 'react-toastify'
55
import classNames from 'classnames'
66

7-
import { BaseModal, Button, IconOutline, InputDatePicker, InputText } from '~/libs/ui'
7+
import { BaseModal, Button, IconOutline, InputDatePicker, InputSelect, InputText } from '~/libs/ui'
88
import {
99
createMemberTraitsAsync,
1010
updateMemberTraitsAsync,
1111
UserProfile, UserTrait,
1212
UserTraitCategoryNames,
1313
UserTraitIds,
1414
} from '~/libs/core'
15+
import { INDUSTRIES_OPTIONS } from '~/libs/shared'
1516

1617
import { WorkExpirenceCard } from '../WorkExpirenceCard'
1718

@@ -61,6 +62,12 @@ const ModifyWorkExpirenceModal: FC<ModifyWorkExpirenceModalProps> = (props: Modi
6162
]
6263
= useState<UserTrait[] | undefined>(props.workExpirence)
6364

65+
const industryOptions: any = sortBy(INDUSTRIES_OPTIONS)
66+
.map(v => ({
67+
label: v,
68+
value: v,
69+
}))
70+
6471
function handleModifyWorkExpirenceSave(): void {
6572
if (addingNewItem || editedItemIndex !== undefined) {
6673
handleFormAction()
@@ -307,30 +314,17 @@ const ModifyWorkExpirenceModal: FC<ModifyWorkExpirenceModalProps> = (props: Modi
307314
onChange={bind(handleFormValueChange, this, 'position')}
308315
value={formValues.position as string}
309316
/>
310-
<div className={styles.row}>
311-
<InputText
312-
name='industry'
313-
label='Industry'
314-
error={formErrors.industry}
315-
placeholder='Enter an industry'
316-
dirty
317-
tabIndex={0}
318-
type='text'
319-
onChange={bind(handleFormValueChange, this, 'industry')}
320-
value={formValues.industry as string}
321-
/>
322-
<InputText
323-
name='city'
324-
label='City'
325-
error={formErrors.city}
326-
placeholder='Enter a city'
327-
dirty
328-
tabIndex={0}
329-
type='text'
330-
onChange={bind(handleFormValueChange, this, 'city')}
331-
value={formValues.city as string}
332-
/>
333-
</div>
317+
<InputSelect
318+
tabIndex={0}
319+
options={industryOptions}
320+
value={formValues.industry as string}
321+
onChange={bind(handleFormValueChange, this, 'industry')}
322+
name='industry'
323+
label='Industry'
324+
placeholder='Select industry'
325+
dirty
326+
error={formErrors.industry}
327+
/>
334328
<div className={styles.row}>
335329
<InputDatePicker
336330
label='Start Date'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export const INDUSTRIES_OPTIONS: string[] = [
2+
'Banking',
3+
'Consumer goods',
4+
'Energy',
5+
'Entertainment',
6+
'Healthcare',
7+
'Pharma',
8+
'Tech & technology services',
9+
'Telecoms',
10+
'Public sector',
11+
'Travel & hospitality',
12+
]

src/libs/shared/lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export * from './hooks'
44
export * from './services'
55
export * from './swr-config'
66
export * from './utils'
7+
export * from './constants'

0 commit comments

Comments
 (0)