Skip to content

Commit 6ca8886

Browse files
committed
TCA-1223 EMSI switch behind feature flag
1 parent 7016f07 commit 6ca8886

File tree

12 files changed

+43
-16
lines changed

12 files changed

+43
-16
lines changed

src-ts/config/environments/environment.default.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const EnvironmentConfigDefault: EnvironmentConfigModel = {
2626
},
2727
MEMBER_VERIFY_LOOKER: 3322,
2828
REACT_APP_ENABLE_TCA_CERT_MONETIZATION: process.env.REACT_APP_ENABLE_TCA_CERT_MONETIZATION as unknown as boolean || false,
29+
REACT_APP_ENABLE_EMSI_SKILLS: process.env.REACT_APP_ENABLE_EMSI_SKILLS as unknown as boolean || false,
2930
REAUTH_OFFSET: 55,
3031
SPRIG: {
3132
ENVIRONMENT_ID: 'bUcousVQ0-yF',

src-ts/lib/global-config.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ export interface GlobalConfig {
4646
}
4747
MEMBER_VERIFY_LOOKER: number,
4848
REACT_APP_ENABLE_TCA_CERT_MONETIZATION: boolean
49+
REACT_APP_ENABLE_EMSI_SKILLS: boolean
4950
}

src-ts/tools/learn/certification-details/certification-details-sidebar/CertificationDetailsSidebar.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
CompletionTimeRange,
77
LearnLevelIcon,
88
ProvidersLogoList,
9+
SkillTags,
910
StickySidebar,
1011
TCACertificatePreview,
1112
TCACertification,
@@ -139,11 +140,13 @@ const CertificationDetailsSidebar: FC<CertificationDetailsSidebarProps> = (props
139140
<div className={classNames('body-small-medium', styles['section-header'])}>
140141
Skills Covered
141142
</div>
142-
<ul className={styles['certification-skills-list']}>
143-
{props.certification.skills.map(skill => (
144-
<li key={skill}>{skill}</li>
145-
))}
146-
</ul>
143+
<SkillTags
144+
emsiSkills={props.certification.emsiSkills}
145+
skills={props.certification.skills}
146+
courseKey={props.certification.dashedName}
147+
theme={'gray'}
148+
expandCount={9}
149+
/>
147150

148151
<ProvidersLogoList
149152
label='Content from'

src-ts/tools/learn/learn-lib/data-providers/courses-provider/learn-course.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { LearnModelBase } from '../../functions'
22
import { CertificationLearnLevel, LearnCertification } from '../all-certifications-provider'
33
import { LearnModule } from '../lesson-provider'
44
import { ResourceProvider } from '../resource-provider-provider'
5+
import { TCAEMSISkillType } from '../tca-certifications-provider/tca-emsi-skill-type'
56

67
export interface LearnCourse extends LearnModelBase {
78
certificationId: string
89
completionSuggestions: Array<string>
10+
emsiSkills: Array<TCAEMSISkillType>
911
estimatedCompletionTimeValue: number
1012
estimatedCompletionTimeUnits: string
1113
fccCourseUuid: string

src-ts/tools/learn/learn-lib/data-providers/tca-certifications-provider/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ export * from './tca-certification-progress'
1717
export * from './tca-certification-enrollment-base.model'
1818
export * from './tca-certification-validation'
1919
export * from './tca-certification-enrollment'
20+
export * from './tca-emsi-skill-type';

src-ts/tools/learn/learn-lib/data-providers/tca-certifications-provider/tca-certification.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TCACertificationCompletionTimeRange } from './tca-certification-complet
55
import { TCACertificationProvider } from './tca-certification-provider.model'
66
import { TCACertificationProviderBase } from './tca-certification-provider.model-base'
77
import { TCACertificationResource } from './tca-certification-resource.model'
8+
import { TCAEMSISkillType } from './tca-emsi-skill-type'
89

910
export interface TCACertification {
1011
certificationCategory: TCACertificationCategory
@@ -15,6 +16,7 @@ export interface TCACertification {
1516
createdAt: Date
1617
dashedName: string
1718
description: string
19+
emsiSkills: Array<TCAEMSISkillType>
1820
id: number
1921
introText: string
2022
learnerLevel: TCACertificationLearnLevel
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export type TCAEMSISkillType = {
2+
assessed: boolean
3+
confidence: number
4+
emsiId: string
5+
learned: boolean
6+
name: string
7+
}

src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ const HiringManagerView: FC<HiringManagerViewProps> = (props: HiringManagerViewP
295295

296296
<SkillTags
297297
skills={props.certification?.skills ?? []}
298+
emsiSkills={props.certification?.emsiSkills ?? []}
298299
theme='gray'
299300
label=''
300301
expandCount={props.certification?.skills?.length ?? 0}

src-ts/tools/learn/learn-lib/skill-tags/SkillTags.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,39 @@ import { FC } from 'react'
22
import classNames from 'classnames'
33

44
import { Tooltip } from '../../../../lib'
5-
import { SkillLabel } from '..'
5+
import { SkillLabel, TCAEMSISkillType } from '..'
66

77
import styles from './SkillTags.module.scss'
8+
import { EnvironmentConfig } from '../../../../config'
89

910
interface SkillTagsProps {
1011
courseKey?: string
1112
expandCount?: number
1213
label?: string
1314
theme?: 'white' | 'gray' | undefined
14-
skills: Array<string> | null | undefined
15+
skills?: Array<string> | null | undefined
16+
emsiSkills?: TCAEMSISkillType[]
1517
}
1618

1719
const SkillTags: FC<SkillTagsProps> = (props: SkillTagsProps) => {
1820
const expandCount: number = props.expandCount || 3
1921
const theme: 'white' | 'gray' = props.theme || 'white'
2022
const label: string = props.label ?? 'skills taught'
23+
const tcaEMSIEnabled: boolean = EnvironmentConfig.REACT_APP_ENABLE_EMSI_SKILLS || false
24+
25+
const skills = tcaEMSIEnabled ? (props.emsiSkills || []) : (props.skills || []);
2126

2227
return (
2328
<div className={styles.skills}>
2429
{label && (
2530
<span className={classNames('body-small', styles.infoText)}>{label}</span>
2631
)}
27-
{props.skills?.slice(0, expandCount)
28-
.map((skill: string) => <SkillLabel skill={skill} theme={theme} key={`${props.courseKey}:${skill}`} />)}
29-
{props.skills?.length > expandCount && (
32+
{skills?.slice(0, expandCount)
33+
.map((skill: string | TCAEMSISkillType) => <SkillLabel skill={skill} theme={theme} key={`${props.courseKey}:${typeof skill === 'string' ? skill : skill.name}`} />)}
34+
{skills.length > expandCount && (
3035
<Tooltip
31-
content={props.skills?.slice(expandCount)
32-
.join(', ')}
33-
trigger={<SkillLabel skill={`+ ${props.skills?.slice(expandCount).length}`} theme={theme} />}
36+
content={skills.slice(expandCount).map(skill => typeof skill === 'string' ? skill : skill.name).join(', ')}
37+
trigger={<SkillLabel skill={`+ ${skills.slice(expandCount).length}`} theme={theme} />}
3438
/>
3539
)}
3640
</div>

src-ts/tools/learn/learn-lib/skill/SkillLabel.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { FC } from 'react'
2+
import { TCAEMSISkillType } from '../data-providers'
23

34
import styles from './SkillLabel.module.scss'
45

56
interface SkillLabelProps {
6-
skill: string
7+
skill: string | TCAEMSISkillType
78
theme: 'white' | 'gray' | undefined
89
}
910

1011
const SkillLabel: FC<SkillLabelProps> = (props: SkillLabelProps) => (
1112
<div className={(props.theme === 'white' || props.theme === undefined) ? styles.wrap : styles.wrapGray}>
12-
<span className='body-small'>{props.skill}</span>
13+
<span className='body-small'>{typeof props.skill === 'string' ? props.skill : props.skill.name }</span>
1314
</div>
1415
)
1516

0 commit comments

Comments
 (0)