Add remove organisation member modal#511
Conversation
PR Review: Add remove organisation member modalThis PR adds the ability for organisation owners to remove members, consisting of a new API function, a confirmation modal, and integration into the Organisation page. The implementation is clean and follows existing conventions well. 1. Code Quality and Best Practices🟡 Missing test coverage Every other modal in
Similarly, 🔵 Semantically misleading In <RemoveMember
modalState={[true, () => setRemovingMember(null)]}
...
/>The prop type is The existing const [showRemoveMemberModal, setShowRemoveMemberModal] = useState(false)
const [removingMember, setRemovingMember] = useState<User | null>(null)
// to open:
setRemovingMember(member)
setShowRemoveMemberModal(true)
// in JSX:
{removingMember && showRemoveMemberModal && (
<RemoveMember
modalState={[showRemoveMemberModal, setShowRemoveMemberModal]}
member={removingMember}
...
/>
)}2. Potential Bugs or IssuesNo issues found. The success path correctly closes the modal before any further state updates, so there is no risk of a state update on an unmounted component. The optimistic mutate with 3. Performance ConsiderationsNo issues found.
4. Security ConcernsNo issues found. Only organisation owners can see or trigger the Remove button ( SummaryThe implementation is solid and follows project conventions. The two items worth addressing before merge are the missing test coverage (especially for a destructive action) and the misleading |
76ecd11 to
7d9c31d
Compare
No description provided.