-
Notifications
You must be signed in to change notification settings - Fork 2
Con2 246 add a user to an org functionality frontend #333
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
Con2 246 add a user to an org functionality frontend #333
Conversation
…-add-a-user-to-an-org-functionality-frontend
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There’s a mismatch with the "one role per org" logic. Things to discuss together: |
Now we are checking whether a searched user already has any role in the currently selected organization (in frontend). Those users are rendered disabled/unselectable and visually marked with "Member" label. |
I've updated the frontend with a Load More button. I've also update the user.service because the endpoint called getPaginationMeta(data.length, page, limit). Because the Supabase query did not ask for an exact count, [data.length] was just the rows returned for the current page, so [totalPages] was computed as 1 (or otherwise wrong). |
This pull request introduces a new "Add User" flow to the admin panel, allowing tenant_admins to search for users by name or email and assign them roles within their organization. It adds backend API integration for lightweight user search, updates state management in the users slice, and enhances the UI with a modal for searching and assigning users. The translations are also updated to support the new UI elements.
Add User Flow and UI Enhancements:
UsersList.tsx
for admins to search for users by name/email, select a user, choose a role, and assign them to the organization. The modal includes search, role selection, assign, and close actions. [1] [2]Backend Integration and State Management:
getAllOrderedUsersList
API method inusersApi
for lightweight user search (returns only id, full_name, email) and added the corresponding thunkfetchAllOrderedUsersList
in the users slice. [1] [2]UserState
type and users slice to store and manage the lightweight users list, including actions and selectors for clearing and accessing search results. [1] [2] [3] [4] [5]Role Assignment Logic:
Note:
This most likely needs to be changed into a separate page instead of a modal, based on the customer feedback wanting a "Request a role in an Org". Once done, it would make sense to add these requests to notifications which would lead to this page (instead of the modal). This is just a basic version of adding a user to an org created before the customer feedback.