Page MenuHomePhabricator

[web] introduce useAddMembersListUserInfos
ClosedPublic

Authored by ginsu on Feb 5 2024, 6:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 10:09 PM
Unknown Object (File)
Fri, Nov 1, 5:35 PM
Unknown Object (File)
Thu, Oct 31, 8:36 AM
Unknown Object (File)
Thu, Oct 24, 9:36 PM
Unknown Object (File)
Fri, Oct 18, 8:18 PM
Unknown Object (File)
Oct 14 2024, 1:07 AM
Unknown Object (File)
Oct 10 2024, 11:47 AM
Unknown Object (File)
Oct 3 2024, 5:17 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.