-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: implemented filtering users by coding language #1048
feat: implemented filtering users by coding language #1048
Conversation
Good work. LGTM. |
const filterByCodingLanguage = (users: PersonType[], codingLanguages: CodingLanguage) => { | ||
const requiredLanguages = Object.keys(codingLanguages).filter( | ||
(key: string) => codingLanguages[key] | ||
); | ||
|
||
return users.filter((user: PersonType) => { | ||
const userCodingLanguages = (user.extras.coding_languages ?? []).map( | ||
(t: { [key: string]: string }) => t.value | ||
); | ||
return requiredLanguages?.every((requiredLanguage: string) => | ||
userCodingLanguages.includes(requiredLanguage) | ||
); | ||
}); | ||
}; |
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.
we should put this in a util and write a test for it
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.
Okay @kevkevinpal
This PR looks good to me we should just move that one function into a util and write a test for it and then we should be good to merge |
Hey @Ekep-Obasi it looks like prettier is failing. Can you resolve that? |
@ecurrencyhodler |
Hmmm @Ekep-Obasi something must've gotten wrong in staging. Can you take another look? Here's a screenshot. I don't see the filtering options for some reason on the top and the # of profiles displayed looks like they've been pre-filtered. |
@ecurrencyhodler, please check that the deployment is up to date |
Okay I will check. |
Let me take a look |
I'll ask talk with the team in our standup Monday. |
Hey @Ekep-Obasi sorry for the delay. I was unable to test due to the issue of not seeing a lot of profiles on the people page. We have since submitted a fix and I have tested it and it works! Great job. Paying you out now. |
Thanks, @ecurrencyhodler |
* feat: implemented filtering users by coding language * fix: fixed prettier warning * fix: fixed prettier warnings * test: created mock data and tests for filterByCodingLanguage * feat: helper function for filtering users by coding languages * chore: moved filterByCoding language logic * fix: fixed warnings * Delete frontend/app/src/people/utils/__tests__/__mockData__/users.ts * Delete frontend/app/src/people/utils/__tests__/filterValidation.spec.ts * fix: fixed prettier warnings
Describe your changes
Implemented filter for people by skills (coding language) on the people page
Issue ticket number and link #986
Preview
https://www.loom.com/share/abe53334cf43409e88213ecb188faaa5?sid=c1f9a146-83b9-46ee-a49f-c28ed59278b0
Type of change
Checklist before requesting a review