Sohail: HGN Questionnaire Dashboard: Community Members (Filtered Members View)#2143
Conversation
|
HemanthNidamanuru
left a comment
There was a problem hiding this comment.
Hi Sohail,
I tested this PR locally by following the steps above. Found a couple of issues:
- When no filters are applied, no members are showing at all. All members should be displayed by default.
- There is no sort option visible on the page anywhere. The sortOrder query param is mentioned in the test steps but there is no sorting control on the UI.
Could you please take a look at these?
|
@HemanthNidamanuru @Anusha-Gali
The backend already handles this correctly. When no |
|
Thank you all, merging! |
rajanidi1999
left a comment
There was a problem hiding this comment.
I’ve reviewed your PR, and it has been successfully executed. The implementation works as expected, and the overall structure is clean and well-organized. The feature integrates smoothly with the existing codebase, and the UI components appear consistent and responsive. I didn’t notice any major issues, though you might consider minor refinements for readability and consistency in naming. Overall, great job this is ready to be merged.















Description
Task: HGN Questionnaire Dashboard: Community Members (Filtered Members View)
Route: /hgnhelp/community
Related PR: PR 4214 -> 4503
Purpose: Displays community members with skill-based filtering.
Issue:
The
GET /api/hgnHelp/communityendpoint was returning an empty result set whenever skill-based filters were used. Two bugs incommunityController.jswere identified as the cause:FormResponse.find()was called without.lean(), returning Mongoose documents instead of plain JS objects.Object.entries()on Mongoose subdocuments does not enumerate actual data fields, soextractSkillsalways produced empty objects, meaning no member ever matched a skill filter.extractSkills, internal Mongoose/MongoDB fields (prefixed with$or_) could surface during enumeration and pollute the skill key list.Related PRs (if any):
This backend PR is related to the development frontend branch.
Main changes explained:
src/controllers/communityController.jsto add.lean()to theFormResponse.find()query so plain JS objects are returned, allowingObject.entries()to correctly enumerate skill fields.src/controllers/communityController.jsto add key guards inextractSkillsthat skip keys starting with$or_, preventing internal fields from appearing in skill results.extractSkillsoutside the.map()callback to avoid redefining the function on every iteration.How to test:
fix/community-members-skill-filternpm installthen start the server/hgnhelp/communityReact,MongoDB)searchandsortOrderquery params still work as expectedScreenshots or videos of changes:
Before:

After:
