Skip to content

PM-4198 add pagination & member details to custmer portal results#1514

Merged
vas3a merged 2 commits intodevfrom
PM-4198_customer-portal-completed-profiles-report-updates
Mar 5, 2026
Merged

PM-4198 add pagination & member details to custmer portal results#1514
vas3a merged 2 commits intodevfrom
PM-4198_customer-portal-completed-profiles-report-updates

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented Mar 5, 2026

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-4198

What's in this PR?

@vas3a vas3a requested review from jmgasper and kkartunov as code owners March 5, 2026 12:17
}

function normalizeCompletedProfilesResponse(
raw: any,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Consider using a more specific type than any for the raw parameter to improve type safety and maintainability.

queryParams.set('countryCode', countryCode)
}

const response = await xhrGetAsync<any>(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Consider adding error handling for the xhrGetAsync call to handle potential network or API errors gracefully.

}

export async function fetchMemberSkillsData(userId: string | number | undefined): Promise<UserSkill[]> {
if (!userId) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 correctness]
The check for !userId could be more explicit by using userId == null to handle both null and undefined cases.

width: 100%;
border-collapse: collapse;
min-width: 420px;
min-width: 1120px;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ design]
Increasing the min-width of the table from 420px to 1120px could affect the layout on smaller screens. Ensure that this change has been tested across different screen sizes to maintain responsiveness.

@@ -1,65 +1,72 @@
/* eslint-disable react/jsx-no-bind */
import { ChangeEvent, FC, useMemo, useState } from 'react'
/* eslint-disable no-await-in-loop */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
Disabling no-await-in-loop can lead to performance issues if the loop contains many iterations or if the awaited operations are slow. Consider refactoring to use Promise.all to fetch data concurrently.

/* eslint-disable react/jsx-no-bind */
import { ChangeEvent, FC, useMemo, useState } from 'react'
/* eslint-disable no-await-in-loop */
/* eslint-disable complexity */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Disabling complexity suggests that the function may be too complex. Consider breaking it down into smaller, more manageable functions to improve readability and maintainability.

const skillsMap = new Map<string | number, UserSkill[]>()

for (const profile of data.data) {
if (profile.userId && !memberSkills.has(profile.userId)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
The check !memberSkills.has(profile.userId) may lead to redundant API calls if the memberSkills map is not updated correctly. Ensure that memberSkills is updated after fetching to avoid unnecessary network requests.

@@ -126,13 +156,14 @@ export const ProfileCompletionPage: FC = () => {
value={selectedCountry}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
setSelectedCountry(event.target.value || 'all')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 design]
Resetting the page to 1 on country change is correct, but ensure that this behavior is communicated to the user, as it might be unexpected.

</a>
</td>
<td>{profile.locationLabel || profile.countryLabel}</td>
<td>{profile.skillCount ?? '-'}</td>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The profile.skillCount is used but not defined in the diff. Ensure that this property is correctly populated in the profile object to avoid displaying incorrect data.

@vas3a vas3a merged commit 03b795a into dev Mar 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant