Skip to content

fix: filter "add group member" by organization #14404

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

Merged
merged 3 commits into from
Aug 26, 2024
Merged

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Aug 22, 2024

This is accomplished by using the members endpoint instead of the users endpoint, and to that end the UserAutocomplete component has been reworked to support either endpoint as separate components with a shared base.

This only affects the group page under organizations, the original one (which shows when the multi-org experiment is disabled) remains unaffected. The org group page dropdown should now only show users belonging to the organization instead of all the users in the deployment.

Closes #13915

@code-asher code-asher force-pushed the asher/filter-member-add branch from 8b7185d to 49a709f Compare August 22, 2024 21:07
@code-asher code-asher changed the title fix: filter add group member by organization fix: filter "add group member" by organization Aug 22, 2024
@code-asher code-asher marked this pull request as ready for review August 22, 2024 21:19
@code-asher code-asher requested review from a team and BrunoQuaresma and removed request for a team August 22, 2024 21:19
This is accomplished by using the members endpoint instead of the users
endpoint, and to that end the UserAutocomplete component has been
reworked to support either endpoint as separate components with a shared
base.
@code-asher code-asher force-pushed the asher/filter-member-add branch from 49a709f to 60e165c Compare August 22, 2024 21:24
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

The code looks good to me and works as expected, but I’m missing an integration test to make this behavior more intentional and to prevent us from accidentally removing or replacing it in the future.

@code-asher
Copy link
Member Author

Fair, let me add one on the group page.

This ensures it is using the right endpoint for the add member dropdown.
@code-asher code-asher force-pushed the asher/filter-member-add branch from 824b581 to fd02c23 Compare August 23, 2024 23:06
@code-asher
Copy link
Member Author

code-asher commented Aug 23, 2024

@BrunoQuaresma I added a Storybook testing the integration but do you know if there is a way to mock errors with react-query? I see we use setQueryData() to mock the data but it does not look like there is a way to mock errors. Right now I have it just actually making the query, which of course then fails with a 404, that way I can test the errors in Storybook, but it feels kinda bad to do it that way.

I could also split it off into a view and then test that instead.

@code-asher
Copy link
Member Author

I figured out a way to do it, but let me know if there is a better way

@code-asher code-asher force-pushed the asher/filter-member-add branch from 0bfabe0 to fe2f523 Compare August 23, 2024 23:36
@code-asher code-asher force-pushed the asher/filter-member-add branch from fe2f523 to a043653 Compare August 23, 2024 23:41
@BrunoQuaresma
Copy link
Collaborator

@code-asher it looks good enough for me 🚢 it

@code-asher code-asher merged commit 88d7181 into main Aug 26, 2024
28 checks passed
@code-asher code-asher deleted the asher/filter-member-add branch August 26, 2024 19:13
@github-actions github-actions bot locked and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Solidify permissions and licensing checks in the UI for Org feature set
2 participants