FEATURE: Added Group-chooser to filter user's by group in /u route (PR #11095)

This PR was in the pr-welcome tag in meta. https://meta.discourse.org/t/can-we-filter-people-in-user-by-group-name/44656

GitHub

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/can-we-filter-people-in-user-by-group-name/44656/9

@Ahmedgagan Sorry about the lack of review here. Nov and Dec was a pretty quiet time in the company. Can you rebase this and tag me for a review? Thank you.

@Ahmedgagan Sorry about the lack of review here. Nov and Dec was a pretty quiet time in the company. Can you rebase this and tag me for a review? Thank you.

Sure Its cool, I’ll do it and tag you here😀

Hi, @tgxworld I made the PR stable. But there’s one test failing that is not at all related to this PR. It’s of Export_user_archive_spec.

Thank you for making the changes :+1: I do see we’re missing some tests for both the client and server side so it’ll be great if you can add them as well.

Thank you for making the changes :+1: I do see we’re missing some tests for both the client and server side so it’ll be great if you can add them as well.

@tgxworld Both tests are available in the core for this functionality. I added one test for the front-end.

tests are available in these files: Front End: discourse/users-test.js at 65a0d5bd76d07b40ccdb7833ad8623ade6e80826 · discourse/discourse · GitHub Back End: discourse/directory_items_controller_spec.rb at 65a0d5bd76d07b40ccdb7833ad8623ade6e80826 · discourse/discourse · GitHub

I don’t think this is right because it returns all visible groups but we need to check for groups where the members are visible as well. If the members are not visible to the user, we should not show the group.

-1 is abit magically here. What does the number represent?

Is there a reason we use the group name instead of just the id here? That way, we get to avoid the finding in selectedGroupId all together.

There are some alignment issues on desktop.

Screenshot from 2021-02-16 11-08-39

Some minor overlapping happening on mobile as well.

Screenshot from 2021-02-16 11-10-41

Hi @tgxworld Added a new commit with the suggested fix here’s the screenshot of the latest working commit Desktop View: Screenshot 2021-02-16 at 7 45 39 PM

Mobile View:

The backend accepts group name as a parameter so we can’t use id

you can use findBy

also what does get accomplishes here ?

can you try to use flexbox on parent instead of all these manual fixes? you are not supposed to change internat alignment of select-kit too, why is it needed here ? is some other css interfering?

Nothing special, ill remove it and go with the normal variable call