Skip to content

Commit 12a46be

Browse files
committed
TAL-84 - use common data model for skills
1 parent 8f4aead commit 12a46be

File tree

4 files changed

+14
-25
lines changed

4 files changed

+14
-25
lines changed

src/libs/core/lib/profile/profile-functions/rating.functions.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { CSSProperties } from 'react'
22

3-
import { SkillSources } from '../user-skill.model'
4-
53
export const TC_RATING_COLORS: Array<{ color: string, limit: number }> = [{
64
color: '#555555' /* Grey */,
75
limit: 900,
@@ -32,7 +30,3 @@ export function ratingToCSScolor(rating: number): CSSProperties {
3230
color,
3331
}
3432
}
35-
36-
export function isVerifiedSkill(skillOriginSources: SkillSources[]): boolean {
37-
return skillOriginSources.includes('TCACertified') || skillOriginSources.includes('ChallengeWin')
38-
}

src/libs/core/lib/profile/user-profile.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UserEMSISkill } from './user-skill.model'
1+
import { UserSkill } from './user-skill.model'
22

33
export type TC_TRACKS = 'DEVELOP' | 'DESIGN' | 'DATA_SCIENCE'
44

@@ -15,7 +15,7 @@ export interface UserProfile {
1515
description: string
1616
diceEnabled: boolean
1717
email: string
18-
emsiSkills: Array<UserEMSISkill>
18+
emsiSkills: Array<UserSkill>
1919
firstName: string
2020
handle: string
2121
handleLower: string

src/libs/core/lib/profile/user-skill.model.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
export type SkillSources = 'TCACertified' | 'SelfPicked' | 'ChallengeWin'
1+
export enum SkillSources {
2+
selfPicked = 'SelfPicked',
3+
challengeWin = 'ChallengeWin',
4+
tcaCertified = 'TCACertified',
5+
}
26

3-
export type UserEMSISkill = {
7+
export type UserSkill = {
48
id: string
59
name: string
6-
skillCategory: {
10+
skillCategory?: {
711
name: string
812
id: number
913
}
10-
skillId: string
11-
skillSources: Array<SkillSources>
12-
skillSubcategory: {
14+
skillId?: string
15+
skillSources?: SkillSources[]
16+
skillSubcategory?: {
1317
name: string
1418
id: number
1519
}
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
1-
export enum SkillSources {
2-
selfPicked = 'SelfPicked',
3-
challengeWin = 'ChallengeWin',
4-
tcaCertified = 'TCACertified',
5-
}
6-
7-
export interface Skill {
8-
id: string;
9-
name: string;
10-
skillSources?: SkillSources[];
11-
}
1+
export { SkillSources } from '~/libs/core'
2+
export type { UserSkill as Skill } from '~/libs/core'

0 commit comments

Comments
 (0)