-
-
Notifications
You must be signed in to change notification settings - Fork 185
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(organizations): add functions for managing members TASK-985 #5281
Conversation
…e-endpoints-to-handle-org-members
… query for user mfa details
…hook more customizable and then use it in `MembersRoute`
…hook more customizable and then use it in `MembersRoute`
…x/kpi into leszek/task-980-members-table
…eszek/task-980-members-table
…omprehensive tests
…omprehensive tests
…eszek/task-980-members-table
…x/kpi into leszek/task-980-members-table
…eszek/task-980-members-table
…x/kpi into leszek/task-980-members-table
…ber-mutation-api # Conflicts: # jsapp/js/account/organization/membersQuery.ts
# Conflicts: # jsapp/js/account/organization/MembersRoute.tsx # jsapp/js/account/organization/membersQuery.ts # jsapp/js/api.endpoints.ts # kobo/apps/organizations/serializers.py # kobo/apps/organizations/views.py
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.
LGTM, not tested. I like how simple getMemberEndpoint
approach is, for now let's stick to that.
Once we get to API schema auto-generation and auto-generated types, preferrably with auto-generated helpers, then let's worry later about what concerns and restrictions that will bring.
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.
LGTM! 👌🏻
Just left a non blocking comment.
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.
LGTM! Nice!!! 👏🏻
* Mutation hook for updating organization member. It ensures that all related | ||
* queries refetch data (are invalidated). | ||
*/ | ||
export function usePatchOrganizationMember(username: string) { |
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.
In the hypothetical situation where we could need to call multiple usePatch...
in the same view we might want to have the username as a parameter of the mutationFn
itself instead of the hook.
But that's only to stay in our minds for the future. We can change this is needed.
… members TASK-987 TASK-990 (#5309) ### 📣 Summary In Members Table (from Account → Team/Organization → Members) add actions dropdown with one action. The action allows removing a member or leaving the organization. ### 📖 Description The availability of "Remove" action is based on the role of the logged in user. When trying to remove user (or leave organization) a confirmation prompt is being shown. ### 👀 Preview steps 1. ℹ️ have multiple different users 2. for one of the users (e.g. "joe"), use http://kf.kobo.local/admin/organizations/organization/ to add multiple users into joe's organization 3. For one of the users (e.g. "sue") set the role to "admin" 4. enable "Multi-members override" for joe's organization 5. enable feature flag `mmosEnabled` 6. navigate to `#/account/organization/members` 7. 🟢 notice that a table of organization members displays a list of users added in step 2 8. 🟢 notice that in the table "joe" (as owner) has an ability to remove all organization members (excluding themselves) including "sue" who's an admin As continuation for above steps: 1. log in as "sue" 2. navigate to `#/account/organization/members` 3. 🟢 notice that in the table "joe" (the owner) has no actions available 4. 🟢 notice that any "member" user in the table has actions available, and if you click "Remove" a confirmation prompt will appear 5. 🟢 notice that for "sue" the action available is "Leave team"/"Leave organization", and if you click it, a confirmation prompt will appear - and it will have different content than confirmation prompt for removing a member As continuation for above steps: 1. pick a "member" user and use "Remove" action 2. confirm prompt 3. 🟢 verify that user was removed successfuly ### 💭 Notes Build atop #5281
💭 Notes
Not testable per se until further PR is built atop this one and uses it :)