File tree Expand file tree Collapse file tree 3 files changed +48
-3
lines changed
src/apps/profiles/src/member-profile/work-expirence Expand file tree Collapse file tree 3 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414import { INDUSTRIES_OPTIONS } from '~/libs/shared'
1515
1616import { WorkExpirenceCard } from '../WorkExpirenceCard'
17+ import { getIndustryOptionLabels , getIndustryOptionValues } from '../WorkExperience.utils'
1718
1819import styles from './ModifyWorkExpirenceModal.module.scss'
1920
@@ -58,8 +59,8 @@ const ModifyWorkExpirenceModal: FC<ModifyWorkExpirenceModalProps> = (props: Modi
5859
5960 const industryOptions : any = sortBy ( INDUSTRIES_OPTIONS )
6061 . map ( v => ( {
61- label : v ,
62- value : v ,
62+ label : getIndustryOptionLabels ( v ) ,
63+ value : getIndustryOptionValues ( v ) ,
6364 } ) )
6465
6566 function handleModifyWorkExpirenceSave ( ) : void {
Original file line number Diff line number Diff line change 1+ export const IndustryEnumToLabel : {
2+ [ key : string ] : string
3+ } = {
4+ 'ConsumerGoods' : 'Consumer goods' ,
5+ 'PublicSector' : 'Public sector' ,
6+ 'TechAndTechnologyService' : 'Tech & technology services' ,
7+ 'TravelAndHospitality' : 'Travel & hospitality' ,
8+ }
9+
10+ export const IndustryLabelToEnum : {
11+ [ key : string ] : string
12+ } = {
13+ 'Consumer goods' : 'ConsumerGoods' ,
14+ 'Public sector' : 'PublicSector' ,
15+ 'Tech & technology services' : 'TechAndTechnologyService' ,
16+ 'Travel & hospitality' : 'TravelAndHospitality' ,
17+ }
18+
19+
20+ export const getIndustryOptionValues = ( v : string ) => {
21+ const values = Object . values ( IndustryEnumToLabel )
22+ const keys = Object . keys ( IndustryEnumToLabel )
23+ if ( values . includes ( v ) ) {
24+ return IndustryLabelToEnum [ v ]
25+ }
26+
27+ if ( keys . includes ( v ) ) {
28+ return IndustryEnumToLabel [ v ]
29+ }
30+
31+ return v
32+ }
33+
34+ export const getIndustryOptionLabels = ( v : string ) => {
35+ const keys = Object . keys ( IndustryEnumToLabel )
36+ if ( keys . includes ( v ) ) {
37+ return IndustryEnumToLabel [ v ]
38+ }
39+
40+ return v
41+ }
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ import moment from 'moment'
44
55import { UserTrait } from '~/libs/core'
66
7+ import { getIndustryOptionLabels } from '../WorkExperience.utils'
8+
79import styles from './WorkExpirenceCard.module.scss'
810
11+
912interface WorkExpirenceCardProps {
1013 work : UserTrait
1114 isModalView ?: boolean
@@ -17,7 +20,7 @@ const WorkExpirenceCard: FC<WorkExpirenceCardProps> = (props: WorkExpirenceCardP
1720 < div className = { styles . workExpirenceCardHeaderLeft } >
1821 < p className = 'body-main-bold' >
1922 { props . work . position }
20- { props . work . industry ? `, ${ props . work . industry } ` : undefined }
23+ { props . work . industry ? `, ${ getIndustryOptionLabels ( props . work . industry ) } ` : undefined }
2124 </ p >
2225 < p >
2326 { props . work . company }
You can’t perform that action at this time.
0 commit comments