-
Notifications
You must be signed in to change notification settings - Fork 20
PM-4198 display all skills #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,15 +116,23 @@ export const ProfileCompletionPage: FC = () => { | |
| const displayedRows = useMemo(() => profiles | ||
| .map(profile => { | ||
| const userSkills = profile.userId ? (memberSkills.get(profile.userId) || []) : [] | ||
| const principalSkills = userSkills | ||
| .filter(skill => skill.displayMode?.name === UserSkillDisplayModes.principal) | ||
| .slice(0, 5) | ||
|
|
||
| // Prioritize principal skills, then add additional skills | ||
| const allSkillsByPriority = [ | ||
| ...userSkills.filter(skill => skill.displayMode?.name === UserSkillDisplayModes.principal), | ||
| ...userSkills.filter(skill => skill.displayMode?.name !== UserSkillDisplayModes.principal), | ||
| ] | ||
|
|
||
| const displayedSkills = allSkillsByPriority.slice(0, 5) | ||
| const additionalSkillsCount = Math.max(0, allSkillsByPriority.length - 5) | ||
|
|
||
| return { | ||
| ...profile, | ||
| additionalSkillsCount, | ||
| countryLabel: profile.countryCode | ||
| ? countryMap.get(profile.countryCode) || profile.countryName || profile.countryCode | ||
| : profile.countryName || '-', | ||
| displayedSkills, | ||
| fullName: [profile.firstName, profile.lastName].filter(Boolean) | ||
| .join(' ') | ||
| .trim(), | ||
|
|
@@ -133,7 +141,6 @@ export const ProfileCompletionPage: FC = () => { | |
| : profile.countryName] | ||
| .filter(Boolean) | ||
| .join(', '), | ||
| principalSkills, | ||
| } | ||
| }) | ||
| .sort((a, b) => a.handle.localeCompare(b.handle)), [profiles, countryMap, memberSkills]) | ||
|
|
@@ -195,8 +202,7 @@ export const ProfileCompletionPage: FC = () => { | |
| <th>Handle</th> | ||
| <th>Location</th> | ||
| <th>Skills</th> | ||
| <th>Principal Skills</th> | ||
| <th>Go to profile</th> | ||
| <th>{' '}</th> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
|
|
@@ -224,22 +230,27 @@ export const ProfileCompletionPage: FC = () => { | |
| </a> | ||
| </td> | ||
| <td>{profile.locationLabel || profile.countryLabel}</td> | ||
| <td>{profile.skillCount ?? '-'}</td> | ||
| <td> | ||
| {profile.principalSkills && profile.principalSkills.length > 0 ? ( | ||
| {profile.displayedSkills && profile.displayedSkills.length > 0 ? ( | ||
| <div className={styles.skillsList}> | ||
| {profile.principalSkills.map(skill => ( | ||
| {profile.displayedSkills.map(skill => ( | ||
| <span key={skill.id} className={styles.skillTag}> | ||
| {skill.name} | ||
| </span> | ||
| ))} | ||
| {profile.additionalSkillsCount > 0 && ( | ||
| <span className={styles.moreIndicator}> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| + {profile.additionalSkillsCount} skills | ||
| </span> | ||
| )} | ||
| </div> | ||
| ) : ( | ||
| '-' | ||
| )} | ||
| </td> | ||
| <td> | ||
| <a | ||
| className={styles.link} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
| href={`${EnvironmentConfig.USER_PROFILE_URL}/${profile.handle}`} | ||
| target='_blank' | ||
| rel='noreferrer noopener' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[⚠️
maintainability]The use of
slice(0, 5)to limit the number of displayed skills is hardcoded. Consider making this a configurable constant or prop to improve maintainability and flexibility.