Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/apps/learn/src/lib/components/skill-tags/SkillTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Tooltip } from '~/libs/ui'
import { EnvironmentConfig } from '~/config'

import { SkillLabel } from '..'
import { TCAEMSISkillType } from '../../data-providers'
import { TCASkillType } from '../../data-providers'

import styles from './SkillTags.module.scss'

Expand All @@ -15,7 +15,7 @@ interface SkillTagsProps {
label?: string
theme?: 'white' | 'gray' | undefined
skills?: Array<string> | null | undefined
emsiSkills?: TCAEMSISkillType[]
emsiSkills?: TCASkillType[]
}

const SkillTags: FC<SkillTagsProps> = (props: SkillTagsProps) => {
Expand All @@ -24,15 +24,15 @@ const SkillTags: FC<SkillTagsProps> = (props: SkillTagsProps) => {
const label: string = props.label ?? 'skills taught'
const tcaEMSIEnabled: boolean = EnvironmentConfig.ENABLE_EMSI_SKILLS || false

const skills: string[] | TCAEMSISkillType[] = tcaEMSIEnabled ? (props.emsiSkills || []) : (props.skills || [])
const skills: string[] | TCASkillType[] = tcaEMSIEnabled ? (props.emsiSkills || []) : (props.skills || [])

return (
<div className={styles.skills}>
{label && (
<span className={classNames('body-small', styles.infoText)}>{label}</span>
)}
{skills?.slice(0, expandCount)
.map((skill: string | TCAEMSISkillType) => (
.map((skill: string | TCASkillType) => (
<SkillLabel
skill={skill}
theme={theme}
Expand Down
4 changes: 2 additions & 2 deletions src/apps/learn/src/lib/components/skill/SkillLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { FC } from 'react'

import { TCAEMSISkillType } from '../../data-providers'
import { TCASkillType } from '../../data-providers'

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

interface SkillLabelProps {
skill: string | TCAEMSISkillType
skill: string | TCASkillType
theme: 'white' | 'gray' | undefined
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { LearnModelBase } from '../../functions'
import { CertificationLearnLevel, LearnCertification } from '../all-certifications-provider'
import { LearnModule } from '../lesson-provider'
import { ResourceProvider } from '../resource-provider-provider'
import { TCAEMSISkillType } from '../tca-certifications-provider/tca-emsi-skill-type'
import { TCASkillType } from '../tca-certifications-provider/tca-skill-type'

export interface LearnCourse extends LearnModelBase {
certificationId: string
completionSuggestions: Array<string>
emsiSkills: Array<TCAEMSISkillType>
emsiSkills: Array<TCASkillType>
estimatedCompletionTimeValue: number
estimatedCompletionTimeUnits: string
fccCourseUuid: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export * from './tca-certification-progress'
export * from './tca-certification-enrollment-base.model'
export * from './tca-certification-validation'
export * from './tca-certification-enrollment'
export * from './tca-emsi-skill-type'
export * from './tca-skill-type'
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TCACertificationCompletionTimeRange } from './tca-certification-complet
import { TCACertificationProvider } from './tca-certification-provider.model'
import { TCACertificationProviderBase } from './tca-certification-provider.model-base'
import { TCACertificationResource } from './tca-certification-resource.model'
import { TCAEMSISkillType } from './tca-emsi-skill-type'
import { TCASkillType } from './tca-skill-type'

export interface TCACertification {
certificationCategory: TCACertificationCategory
Expand All @@ -16,7 +16,7 @@ export interface TCACertification {
createdAt: Date
dashedName: string
description: string
emsiSkills: Array<TCAEMSISkillType>
emsiSkills: Array<TCASkillType>
id: number
introText: string
learnerLevel: TCACertificationLearnLevel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type TCAEMSISkillType = {
export type TCASkillType = {
assessed: boolean
confidence: number
emsiId: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TCACertification,
TCACertificationProgress,
TCACertificationProviderBase,
TCAEMSISkillType,
TCASkillType,
} from '../../../lib'

import styles from './TCCertCard.module.scss'
Expand All @@ -43,7 +43,7 @@ const TCCertCard: FC<TCCertCardProps> = (props: TCCertCardProps) => {
skills: string[],
providers: Array<TCACertificationProviderBase>,
dashedName: string
emsiSkills: TCAEMSISkillType[]
emsiSkills: TCASkillType[]
} = props.certification

const isEnrolled: boolean = props.progress?.status === 'enrolled'
Expand Down
5 changes: 3 additions & 2 deletions src/apps/onboarding/src/models/MemberInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { MemberEmsiSkill, MemberMaxRating } from '~/apps/talent-search/src/lib/models'
import { MemberMaxRating } from '~/apps/talent-search/src/lib/models'
import { MemberStats } from '~/libs/core'
import { Skill } from '~/libs/shared'

import MemberAddress from './MemberAddress'

Expand All @@ -13,7 +14,7 @@ export default interface MemberInfo {
email: string
accountAge: number
maxRating: MemberMaxRating
emsiSkills: Array<MemberEmsiSkill>
emsiSkills: Array<Skill>
stats: Array<MemberStats>
addresses?: MemberAddress[]
country: string
Expand Down
6 changes: 3 additions & 3 deletions src/apps/onboarding/src/pages/skills/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export const PageSkillsContent: FC<{
}> = props => {
const navigate: any = useNavigate()
const [loading, setLoading] = useState(false)
const { formInput: emsiFormInput, saveSkills: saveEmsiSkills }: MemberSkillEditor = useMemberSkillEditor()
const editor: MemberSkillEditor = useMemberSkillEditor()

async function saveSkills(): Promise<void> {
setLoading(true)
try {
await saveEmsiSkills()
await editor.saveSkills()
} catch (error) {
}

Expand All @@ -46,7 +46,7 @@ export const PageSkillsContent: FC<{
Understanding your skills will allow us to connect you to the right opportunities.
</span>
<div className='mt-16 full-width color-black-80'>
{emsiFormInput}
{editor.formInput}
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createContext, FC, ReactNode, useContext, useMemo } from 'react'

import { UserEMSISkill } from '~/libs/core'
import { Skill } from '~/libs/shared'

export interface MemberProfileContextValue {
isTalentSearch?: boolean
skillsRenderer?: (
skills: Pick<UserEMSISkill, 'name'|'skillId'|'skillSources'>[]
skills: Pick<Skill, 'name'|'id'|'skillSources'>[]
) => ReactNode
}

Expand Down
24 changes: 12 additions & 12 deletions src/apps/profiles/src/member-profile/skills/MemberSkillsInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Dispatch, FC, SetStateAction, useEffect, useMemo, useState } from 'reac
import { useSearchParams } from 'react-router-dom'
import { orderBy } from 'lodash'

import { UserEMSISkill, UserProfile } from '~/libs/core'
import { UserProfile } from '~/libs/core'
import { ExpandableList, HowSkillsWorkModal, isSkillVerified, Skill, SkillPill } from '~/libs/shared'
import { Button } from '~/libs/ui'

Expand All @@ -27,11 +27,11 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp

const { skillsRenderer, isTalentSearch }: MemberProfileContextValue = useMemberProfileContext()

const memberEMSISkills: UserEMSISkill[] = useMemo(() => orderBy(
const memberSkills: Skill[] = useMemo(() => orderBy(
props.profile.emsiSkills ?? [],
[isSkillVerified, 'name'],
['desc', 'asc'],
) as UserEMSISkill[], [props.profile.emsiSkills])
) as Skill[], [props.profile.emsiSkills])

const [isEditMode, setIsEditMode]: [boolean, Dispatch<SetStateAction<boolean>>]
= useState<boolean>(false)
Expand Down Expand Up @@ -76,7 +76,7 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
<div className={styles.headerWrap}>
<h3>Skills</h3>
{
canEdit && memberEMSISkills.length > 0 && (
canEdit && memberSkills.length > 0 && (
<EditMemberPropertyBtn
onClick={handleEditSkillsClick}
/>
Expand All @@ -92,22 +92,22 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
</div>

<div className={styles.skillsWrap}>
{skillsRenderer && memberEMSISkills.length > 0 && skillsRenderer(memberEMSISkills)}
{!skillsRenderer && memberEMSISkills.length > 0 && (
{skillsRenderer && memberSkills.length > 0 && skillsRenderer(memberSkills)}
{!skillsRenderer && memberSkills.length > 0 && (
<ExpandableList visible={10} itemLabel='skill'>
{
memberEMSISkills
.map(memberEMSISkill => (
memberSkills
.map(memberSkill => (
<SkillPill
skill={memberEMSISkill as unknown as Skill}
key={memberEMSISkill.id}
skill={memberSkill as unknown as Skill}
key={memberSkill.id}
theme='dark'
/>
))
}
</ExpandableList>
)}
{!memberEMSISkills.length && (
{!memberSkills.length && (
<EmptySection
title='Topcoder verifies and tracks skills as our members complete projects and challenges.'
wide
Expand All @@ -119,7 +119,7 @@ const MemberSkillsInfo: FC<MemberSkillsInfoProps> = (props: MemberSkillsInfoProp
</EmptySection>
)}
</div>
{canEdit && !memberEMSISkills.length && (
{canEdit && !memberSkills.length && (
<AddButton
label='Add skills'
onClick={handleEditSkillsClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const ModifySkillsModal: FC<ModifySkillsModalProps> = (props: ModifySkillsModalP
const [isSaving, setIsSaving]: [boolean, Dispatch<SetStateAction<boolean>>]
= useState<boolean>(false)

const { formInput: emsiFormInput, saveSkills: saveEmsiSkills }: MemberSkillEditor = useMemberSkillEditor()
const editor: MemberSkillEditor = useMemberSkillEditor()

function handleModifySkillsSave(): void {
setIsSaving(true)

saveEmsiSkills()
editor.saveSkills()
.then(() => {
toast.success('Skills updated successfully.', { position: toast.POSITION.BOTTOM_RIGHT })
props.onSave()
Expand Down Expand Up @@ -63,7 +63,7 @@ const ModifySkillsModal: FC<ModifySkillsModalProps> = (props: ModifySkillsModalP
Understanding your skills will allow us to connect you to the right opportunities.
</p>
<div className={styles.skillPicker}>
{emsiFormInput}
{editor.formInput}
</div>
</div>
</BaseModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ import styles from './PopularSkills.module.scss'
// TODO: Make this configurable, or read from a service. We need to discuss
// how we want to handle this.
const popularSkills: Skill[] = [
{ emsiId: 'KS120076FGP5WGWYMP0F', name: 'Java (Programming Language)' },
{ emsiId: 'KS126QY605N7YVHFYCTW', name: 'MySQL' },
{ emsiId: 'KS127296VDYS7ZFWVC46', name: 'Node.js' },
{ emsiId: 'KS121F45VPV8C9W3QFYH', name: 'Cascading Style Sheets (CSS)' },
{ emsiId: 'KS1200771D9CR9LB4MWW', name: 'JavaScript (Programming Language)' },
{ emsiId: 'KS1261Z68KSKR1X31KS3', name: 'Machine Learning' },
{ emsiId: 'KS120SX72T8B5VLXS1VN', name: 'Unit Testing' },
{ emsiId: 'KS120H6772VQ0MQ5RLVD', name: 'Angular (Web Framework)' },
{ emsiId: 'KS1200B62W5ZF38RJ7TD', name: '.NET Framework' },
{ emsiId: 'KS125LS6N7WP4S6SFTCK', name: 'Python (Programming Language)' },
{ emsiId: 'KS120GZ5YXC6YVM1NGPR', name: 'Android (Operating System)' },
{ emsiId: 'ES5269FD2583B0B9875C', name: 'Figma (Design Software)' },
{ emsiId: 'KS120V86MZWV9Z9LKQY3', name: 'Microsoft Azure' },
{ emsiId: 'KS1206V6K46N1SDVJGBD', name: 'Adobe Illustrator' },
{ emsiId: 'KSY4WFI1S164RQUBSPCC', name: 'Docker (Software)' },
{ emsiId: 'KSDJCA4E89LB98JAZ7LZ', name: 'React.js' },
{ id: 'f81d2a78-ff52-4c77-8cdb-8863601b87c7', name: 'Java (Programming Language)' },
{ id: '1aabc882-c28d-4b56-8546-5e961b53bf5d', name: 'MySQL' },
{ id: 'b3181231-af8f-4a44-aff2-97fe00c57d76', name: 'Node.js' },
{ id: '4328c534-ba51-4589-a3e7-7b5ba76d2b55', name: 'Cascading Style Sheets (CSS)' },
{ id: 'e3b2b1f1-6bbf-4989-b53d-d8531a10ea5d', name: 'JavaScript (Programming Language)' },
{ id: '41ffc4d5-2e43-45e1-af36-ae7a23b47c21', name: 'Machine Learning' },
{ id: '047203fc-8c85-4be0-be0b-0e2fe11c3a16', name: 'Unit Testing' },
{ id: '8c6703bd-63dd-4f6d-9cf0-5b411e531a9f', name: 'Angular (Web Framework)' },
{ id: '34ec4bf0-0b44-4d04-9f11-e3daa2c045ce', name: '.NET Framework' },
{ id: 'a9bb69aa-edc2-4d5f-8141-de33a139f119', name: 'Python (Programming Language)' },
{ id: '67c623db-09e4-499d-800b-24868b1eb85b', name: 'Android (Operating System)' },
{ id: '36292f61-c359-42a4-89b9-95245ee494ea', name: 'Figma (Design Software)' },
{ id: 'cf39f07c-0e7a-48a2-acec-21834900c437', name: 'Microsoft Azure' },
{ id: 'b33f8342-8015-4244-afea-5fd089bf52a6', name: 'Adobe Illustrator' },
{ id: 'f21aecd2-5c67-4783-97a4-a77c67cf4f67', name: 'Docker (Software)' },
{ id: '43baf79e-3632-4b04-889a-7202cbf62a6c', name: 'React.js' },
]

interface PopularSkillsProps {
Expand All @@ -41,7 +41,7 @@ const PopularSkills: FC<PopularSkillsProps> = props => {
// Either delete the value from the list, if we're toggling one that's already in the list
// Or add the new item to the list
props.selectedSkills.forEach(filterSkill => {
if (filterSkill.emsiId === skill.emsiId) {
if (filterSkill.id === skill.id) {
deleted = true
} else {
newFilter.push(filterSkill)
Expand All @@ -59,7 +59,7 @@ const PopularSkills: FC<PopularSkillsProps> = props => {
}, [props.onChange, props.selectedSkills])

function isSelected(skill: Skill): boolean {
return !!props.selectedSkills.find(s => s.emsiId === skill.emsiId)
return !!props.selectedSkills.find(s => s.id === skill.id)
}

return (
Expand All @@ -69,7 +69,7 @@ const PopularSkills: FC<PopularSkillsProps> = props => {
<div className={styles.pills}>
{popularSkills.map(skill => (
<SkillPill
key={skill.emsiId}
key={skill.id}
skill={skill}
selected={isSelected(skill)}
onClick={toggleSkill}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import { FC } from 'react'
import classNames from 'classnames'

import { UserEMSISkill } from '~/libs/core'
import { EmsiSkill, ExpandableList, isSkillVerified, Skill, SkillPill } from '~/libs/shared'
import { ExpandableList, isSkillVerified, Skill, SkillPill } from '~/libs/shared'

import { useIsMatchingSkill } from '../../lib/utils'

import styles from './ProfileSkillsMatch.module.scss'

interface ProfileSkillsMatchProps {
matchValue: number
profileSkills: Pick<UserEMSISkill, 'name'|'skillId'|'skillSources'>[]
profileSkills: Pick<Skill, 'name'|'id'|'skillSources'>[]
queriedSkills: Skill[]
}

const ProfileSkillsMatch: FC<ProfileSkillsMatchProps> = props => {
const isMatchingSkill = useIsMatchingSkill(props.queriedSkills)
const matchedSkills = (props.profileSkills as unknown as EmsiSkill[]).filter(isMatchingSkill)
const unMatchedSkills = (props.profileSkills as unknown as EmsiSkill[]).filter(s => !isMatchingSkill(s))
const matchedSkills = props.profileSkills.filter(isMatchingSkill)
const unMatchedSkills = props.profileSkills.filter(s => !isMatchingSkill(s))
const provenMatched = matchedSkills.filter(isSkillVerified)
const selfSkillmatched = matchedSkills.filter(s => !isSkillVerified(s))
const missingSkills = props.queriedSkills.filter(qs => !matchedSkills.find(ms => ms.skillId === qs.emsiId))
const missingSkills = props.queriedSkills.filter(qs => !matchedSkills.find(ms => ms.id === qs.id))

return (
<div className={styles.wrap}>
Expand All @@ -41,7 +40,7 @@ const ProfileSkillsMatch: FC<ProfileSkillsMatchProps> = props => {
</div>
<div className={styles.skillsList}>
{provenMatched.map(skill => (
<SkillPill skill={skill} theme='verified' key={skill.skillId} />
<SkillPill skill={skill} theme='verified' key={skill.id} />
))}
</div>
</>
Expand All @@ -54,7 +53,7 @@ const ProfileSkillsMatch: FC<ProfileSkillsMatchProps> = props => {
</div>
<div className={styles.skillsList}>
{selfSkillmatched.map(skill => (
<SkillPill skill={skill} theme='dark' key={skill.skillId} />
<SkillPill skill={skill} theme='dark' key={skill.id} />
))}
</div>
</>
Expand Down Expand Up @@ -82,7 +81,7 @@ const ProfileSkillsMatch: FC<ProfileSkillsMatchProps> = props => {
<div className={styles.skillsList}>
<ExpandableList visible={10} itemLabel='skill'>
{unMatchedSkills.map(skill => (
<SkillPill skill={skill} theme='dark' key={skill.skillId} />
<SkillPill skill={skill} theme='dark' key={skill.id} />
))}
</ExpandableList>
</div>
Expand Down
Loading