Skip to content

Commit 37cdfea

Browse files
authored
Merge pull request #1516 from topcoder-platform/PM-4198_customer-portal-completed-profiles-report-updates
PM-4198 display all skills
2 parents 03b795a + 74aeb63 commit 37cdfea

2 files changed

Lines changed: 46 additions & 9 deletions

File tree

src/apps/customer-portal/src/pages/profile-completion/ProfileCompletionPage/ProfileCompletionPage.module.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,26 @@
169169
color: $black-80;
170170
white-space: nowrap;
171171
}
172+
173+
.moreIndicator {
174+
display: inline-block;
175+
background: $black-5;
176+
border: 1px solid $black-20;
177+
border-radius: $sp-1;
178+
padding: $sp-1 $sp-2;
179+
font-size: 12px;
180+
line-height: 16px;
181+
color: $black-80;
182+
font-weight: 700;
183+
min-width: 24px;
184+
text-align: center;
185+
cursor: help;
186+
}
187+
188+
.link {
189+
display: flex;
190+
gap: $sp-1;
191+
text-decoration: underline;
192+
color: $link-blue;
193+
cursor: pointer;
194+
}

src/apps/customer-portal/src/pages/profile-completion/ProfileCompletionPage/ProfileCompletionPage.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,23 @@ export const ProfileCompletionPage: FC = () => {
116116
const displayedRows = useMemo(() => profiles
117117
.map(profile => {
118118
const userSkills = profile.userId ? (memberSkills.get(profile.userId) || []) : []
119-
const principalSkills = userSkills
120-
.filter(skill => skill.displayMode?.name === UserSkillDisplayModes.principal)
121-
.slice(0, 5)
119+
120+
// Prioritize principal skills, then add additional skills
121+
const allSkillsByPriority = [
122+
...userSkills.filter(skill => skill.displayMode?.name === UserSkillDisplayModes.principal),
123+
...userSkills.filter(skill => skill.displayMode?.name !== UserSkillDisplayModes.principal),
124+
]
125+
126+
const displayedSkills = allSkillsByPriority.slice(0, 5)
127+
const additionalSkillsCount = Math.max(0, allSkillsByPriority.length - 5)
122128

123129
return {
124130
...profile,
131+
additionalSkillsCount,
125132
countryLabel: profile.countryCode
126133
? countryMap.get(profile.countryCode) || profile.countryName || profile.countryCode
127134
: profile.countryName || '-',
135+
displayedSkills,
128136
fullName: [profile.firstName, profile.lastName].filter(Boolean)
129137
.join(' ')
130138
.trim(),
@@ -133,7 +141,6 @@ export const ProfileCompletionPage: FC = () => {
133141
: profile.countryName]
134142
.filter(Boolean)
135143
.join(', '),
136-
principalSkills,
137144
}
138145
})
139146
.sort((a, b) => a.handle.localeCompare(b.handle)), [profiles, countryMap, memberSkills])
@@ -195,8 +202,7 @@ export const ProfileCompletionPage: FC = () => {
195202
<th>Handle</th>
196203
<th>Location</th>
197204
<th>Skills</th>
198-
<th>Principal Skills</th>
199-
<th>Go to profile</th>
205+
<th>{' '}</th>
200206
</tr>
201207
</thead>
202208
<tbody>
@@ -224,22 +230,30 @@ export const ProfileCompletionPage: FC = () => {
224230
</a>
225231
</td>
226232
<td>{profile.locationLabel || profile.countryLabel}</td>
227-
<td>{profile.skillCount ?? '-'}</td>
228233
<td>
229-
{profile.principalSkills && profile.principalSkills.length > 0 ? (
234+
{profile.displayedSkills && profile.displayedSkills.length > 0 ? (
230235
<div className={styles.skillsList}>
231-
{profile.principalSkills.map(skill => (
236+
{profile.displayedSkills.map(skill => (
232237
<span key={skill.id} className={styles.skillTag}>
233238
{skill.name}
234239
</span>
235240
))}
241+
{profile.additionalSkillsCount > 0 && (
242+
<span className={styles.moreIndicator}>
243+
+
244+
{profile.additionalSkillsCount}
245+
{' '}
246+
skills
247+
</span>
248+
)}
236249
</div>
237250
) : (
238251
'-'
239252
)}
240253
</td>
241254
<td>
242255
<a
256+
className={styles.link}
243257
href={`${EnvironmentConfig.USER_PROFILE_URL}/${profile.handle}`}
244258
target='_blank'
245259
rel='noreferrer noopener'

0 commit comments

Comments
 (0)