-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Feature: Bulk Add Members to Pools in UI
Is your feature request related to a problem? Please describe.
Currently, pool managers can only add members one by one through the "Member Management" tab in the UI. This becomes a tedious and time-consuming process when a large number of members need to be added to a pool. The underlying smart contracts (DirectPaymentsPool.sol and UBIPool.sol) already support bulk addition via the addMembers function, but this functionality is not exposed in the user interface.
Describe the solution you'd like
We need to implement a feature in the "Member Management" section of the ManageCollectivePage.tsx that allows pool managers to add multiple members simultaneously. This could involve:
- A text area where users can paste a list of wallet addresses (e.g., comma-separated, or one per line).
- Optionally, a file upload mechanism for a CSV file containing a list of addresses.
Upon submission, the UI should call the addMembers function on the relevant pool contract (DirectPaymentsPool or UBIPool) with the provided list of addresses.
Describe alternatives you've considered
The current alternative is to manually add each member, which is inefficient for large-scale operations. Direct interaction with the smart contract (e.g., via Etherscan or a custom script) is also possible but is not user-friendly for non-technical managers.
Acceptance Criteria
- A new UI component (e.g., a dedicated section or a button triggering a modal) is added to the "Member Management" tab on
ManageCollectivePage.tsx. - The component provides an input method for multiple wallet addresses (e.g., a multi-line text area).
- The input addresses are validated (e.g., basic address format check).
- Upon submission, the UI calls the
addMembersfunction on theDirectPaymentsPoolorUBIPoolcontract, passing the array of member addresses. For theextraDataparameter, an empty array of bytes ([]) should be passed for all members in the initial implementation, as the current contract logic allows for this. - The UI provides clear feedback to the user during the transaction (e.g., "Adding members...", "Transaction confirmed", "Error: ...").
- Successfully added members should appear in the "Current Members" list after the transaction is confirmed and the data is refreshed.
- The feature should be accessible only to users with the
MANAGER_ROLE.
Relevant Files:
/Users/hadarro/workspace/GoodDollar/SegmentedUBI/packages/app/src/pages/ManageCollectivePage.tsx/Users/hadarro/workspace/GoodDollar/SegmentedUBI/packages/contracts/contracts/DirectPayments/DirectPaymentsPool.sol(specifically theaddMembersfunction)/Users/hadarro/workspace/GoodDollar/SegmentedUBI/packages/contracts/contracts/UBI/UBIPool.sol(specifically theaddMembersfunction)- The
useMemberManagementhook (likely located inpackages/app/src/hooks/managePool/useMemberManagement.tsor similar) will need to be updated to support this new functionality.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status