Skip to content

Commit 58f55e8

Browse files
committed
Initial talent search implementation
1 parent 4d67342 commit 58f55e8

38 files changed

+1248
-71
lines changed

craco.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = {
3434
'@learn': resolve('src/apps/learn/src'),
3535
'@devCenter': resolve('src/apps/dev-center/src'),
3636
'@gamificationAdmin': resolve('src/apps/gamification-admin/src'),
37+
'@talentSearch': resolve('src/apps/talent-search/src'),
3738

3839
'@platform': resolve('src/apps/platform/src'),
3940
// aliases used in SCSS files

src/apps/platform/src/platform.routes.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { devCenterRoutes } from '~/apps/dev-center'
44
import { gamificationAdminRoutes } from '~/apps/gamification-admin'
55
import { earnRoutes } from '~/apps/earn'
66
import { selfServiceRoutes } from '~/apps/self-service'
7+
import { talentSearchRoutes } from '~/apps/talent-search'
78

89
const Home: LazyLoadedComponent = lazyLoad(() => import('./routes/home'), 'HomePage')
910

@@ -24,5 +25,6 @@ export const platformRoutes: Array<PlatformRoute> = [
2425
...earnRoutes,
2526
...learnRoutes,
2627
...gamificationAdminRoutes,
27-
...homeRoutes,
28+
...talentSearchRoutes,
29+
...homeRoutes
2830
]

src/apps/talent-search/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### Talent search
2+
3+
This is an internal for finding members based on skills and other search facets. The main APIs used include:
4+
5+
* Member API
6+
* Match Engine API

src/apps/talent-search/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { FC, useContext } from 'react'
2+
import { Outlet, Routes } from 'react-router-dom'
3+
4+
import { routerContext, RouterContextData } from '~/libs/core'
5+
6+
import { toolTitle } from './talent-search.routes'
7+
8+
const TalentSearchApp: FC<{}> = () => {
9+
10+
const { getChildRoutes }: RouterContextData = useContext(routerContext)
11+
12+
return (
13+
<>
14+
<Outlet />
15+
<Routes>
16+
{getChildRoutes(toolTitle)}
17+
</Routes>
18+
</>
19+
)
20+
}
21+
22+
export default TalentSearchApp
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './talent-search.routes'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import SkillScore from './SkillScore'
2+
3+
export default interface Member {
4+
userId: number;
5+
handle: string;
6+
firstName: string;
7+
lastName: string;
8+
country: string;
9+
accountAge: number;
10+
numberOfChallengesWon: number;
11+
numberOfChallengesPlaced: number;
12+
skills: Array<SkillScore>;
13+
searchedSkills: Array<SkillScore>;
14+
roles: Array<string>;
15+
domains: Array<string>;
16+
totalSkillScore: number;
17+
searchedSkillScore: number;
18+
}
19+
20+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default interface Skill {
2+
id: string;
3+
skillName: string;
4+
description: string;
5+
}
6+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
export default interface SkillScore {
3+
skill: string;
4+
score: number;
5+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { EnvironmentConfig } from '~/config'
2+
import { xhrGetAsync } from '~/libs/core'
3+
4+
import Skill from '@talentSearch/lib/models/Skill'
5+
import Member from '@talentSearch/lib/models/Member'
6+
7+
export async function getAllSkills(): Promise<Array<Skill>>{
8+
return xhrGetAsync(`${EnvironmentConfig.API.V1}/match-engine/skills`)
9+
}
10+
11+
export async function retrieveMatchesForSkills(skills:ReadonlyArray<Skill>): Promise<Array<Member>>{
12+
const params = new URLSearchParams()
13+
console.log("Search skills: " + JSON.stringify(skills))
14+
skills.forEach(value => params.append('skill', value.skillName))
15+
params.append('sortBy', 'numberOfChallengesWon')
16+
params.append('sortOrder', 'desc')
17+
18+
const url = `${EnvironmentConfig.API.V1}/match-engine/members?${params.toString()}`
19+
20+
return xhrGetAsync(url)
21+
}
22+
23+
const MatcherService = {
24+
getAllSkills,
25+
retrieveMatchesForSkills,
26+
};
27+
28+
export default MatcherService;

0 commit comments

Comments
 (0)