Page MenuHomePhabricator

[web] introduce useAddMembersListUserInfos
ClosedPublic

Authored by ginsu on Feb 5 2024, 6:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 11:56 AM
Unknown Object (File)
Tue, May 7, 1:46 PM
Unknown Object (File)
Mon, Apr 29, 6:18 PM
Unknown Object (File)
Apr 8 2024, 1:05 PM
Unknown Object (File)
Apr 8 2024, 1:05 PM
Unknown Object (File)
Apr 8 2024, 1:05 PM
Unknown Object (File)
Apr 8 2024, 1:05 PM
Unknown Object (File)
Apr 8 2024, 1:04 PM
Subscribers

Details

Summary

PLEASE NOTE THAT THIS DIFF AND SUBSEQUENT DIFFS IN THIS STACK WILL NOT BE LANDED UNTIL MORE OF THE REDESIGN IS READY SINCE THIS WILL CAUSE REGRESSIONS IN PROD

There is a a lot business logic for searching + selecting the users for the add members logic. To keep things better organized + have the add members modal follow a similar pattern to the add friends modal, I created a new hook called useAddMembersListUserInfos to house all the business logic for searching + selecting the users

Depends on D10941

Test Plan

flow + confirmed I was getting the same results for the add members modal

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

web/modals/threads/members/add-members-modal.react.js
131–139 ↗(On Diff #36618)

useAddUsersListContext is used in useAddMembersListUserInfos so we need to also introduce AddUsersListProvider. To keep things easy to review I introduced this AddMembersModalWrapper component so that we can use useAddUsersListContext. Eventually in a subsequent diff I will further improve on this and eventually remove it once more of the code in the above component is cleaned up more

131–139 ↗(On Diff #36617)

useAddUsersListContext is used in useAddMembersListUserInfos so we need to also introduce AddUsersListProvider. To keep things easy to review I introduced this AddMembersModalWrapper component so that we can use useAddUsersListContext. Eventually in a subsequent diff I will further improve on this and eventually remove it once more of the code in the above component is cleaned up more

ginsu requested review of this revision.Feb 5 2024, 6:37 AM
atul added inline comments.
web/settings/relationship/add-users-utils.js
169 ↗(On Diff #36618)

Let's memoize this

This revision is now accepted and ready to land.Feb 5 2024, 12:12 PM

address comments + rebase before landing

This revision was automatically updated to reflect the committed changes.