Skip to content
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

Merged
merged 10 commits into from
Dec 8, 2023
Merged

feat: implemented filtering users by coding language #1048

merged 10 commits into from
Dec 8, 2023

Conversation

Ekep-Obasi
Copy link
Contributor

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

  • New feature (non-breaking change which adds functionality)

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested on Chrome and Firefox
  • I have provided a screenshot or recording of changes in my PR if there were updates to the frontend

@ecurrencyhodler
Copy link
Contributor

Good work. LGTM.

Comment on lines 107 to 120
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)
);
});
};
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevkevinpal
Copy link
Contributor

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

@ecurrencyhodler
Copy link
Contributor

Hey @Ekep-Obasi it looks like prettier is failing. Can you resolve that?

@kevkevinpal kevkevinpal merged commit fb76cc1 into stakwork:master Dec 8, 2023
5 of 6 checks passed
@Ekep-Obasi
Copy link
Contributor Author

@ecurrencyhodler
I ran prettier:checks before pushing, i don't know why it kept failing

@ecurrencyhodler
Copy link
Contributor

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.

https://people-test.sphinx.chat/p
Screenshot 2023-12-08 at 10 23 55 PM

@Ekep-Obasi
Copy link
Contributor Author

@ecurrencyhodler, please check that the deployment is up to date
The changes show locally on the master branch it should be okay!

@ecurrencyhodler
Copy link
Contributor

Okay I will check.

@ecurrencyhodler
Copy link
Contributor

Alright I see the filter now but I still only see a few profiles. Do you know why that might be?
Screenshot 2023-12-09 at 8 24 23 AM

@Ekep-Obasi
Copy link
Contributor Author

Let me take a look

@ecurrencyhodler
Copy link
Contributor

I'll ask talk with the team in our standup Monday.

@ecurrencyhodler
Copy link
Contributor

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.

@Ekep-Obasi
Copy link
Contributor Author

Thanks, @ecurrencyhodler
I appreciated it

@ecurrencyhodler ecurrencyhodler mentioned this pull request Dec 12, 2023
3 tasks
elraphty pushed a commit that referenced this pull request Jan 26, 2024
* 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
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.

3 participants