Conversation
| [myChallengeResources], | ||
| ) | ||
|
|
||
| const canEditScorecard = useMemo(() => { |
There was a problem hiding this comment.
[❗❗ correctness]
The removal of hasChallengeCopilotRole from the dependencies of canEditScorecard could lead to incorrect behavior if the copilot role is intended to influence the ability to edit the scorecard. Ensure that the copilot role is not required for this logic, or consider adding it back if it was removed unintentionally.
| }> | ||
| } | ||
|
|
||
| export type MarathonMatchSkillActivity = { |
There was a problem hiding this comment.
[correctness]
Consider adding validation or type-checking for the createdAt field to ensure it is a valid date string. This can prevent potential runtime errors if the data source provides an unexpected format.
| ): | ||
| </div> | ||
| {skillDetails.activity['marathon match'].sources?.map(s => ( | ||
| <a |
There was a problem hiding this comment.
[💡 readability]
Consider adding a descriptive name for each Marathon Match link instead of using the generic text 'Marathon Match'. This will improve the clarity for users who are navigating the links.
| target='_blank' | ||
| rel='noopener noreferrer' | ||
| > | ||
| {s.name || 'Marathon Match'} |
There was a problem hiding this comment.
[correctness]
Using s.name || 'Marathon Match' assumes that s.name is always a string. If s.name can be null or undefined, this is fine, but if it can be other falsy values like an empty string, this logic might unintentionally fall back to 'Marathon Match'. Consider explicitly checking for null or undefined if those are the only cases you want to handle.
kkartunov
left a comment
There was a problem hiding this comment.
@himaniraghav3 fix the build as it failing...
| <li> | ||
| <div className={styles.tooltipRow}> | ||
| Marathon Matches ( | ||
| {skillDetails.activity['marathon match'].lastSources?.length ?? 0} |
There was a problem hiding this comment.
🟡 Marathon match count displays lastSources.length instead of .count, inconsistent with all other activity types
The marathon match section uses skillDetails.activity['marathon match'].lastSources?.length ?? 0 to display the count, while every other activity type (challenges, courses, certifications, engagements) uses the .count property from UserSkillActivity. The count field represents the total number of activities, whereas lastSources is a subset containing only the most recent entries (as implied by the name). This means the displayed count for marathon matches could be lower than the actual total when there are more activities than are returned in lastSources.
| {skillDetails.activity['marathon match'].lastSources?.length ?? 0} | |
| {skillDetails.activity['marathon match'].count} |
Was this helpful? React with 👍 or 👎 to provide feedback.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-4482
What's in this PR?
MM skills response has a different structure