App icon indicating copy to clipboard operation
App copied to clipboard

[Chat] [IOU] Create IOU Participant selection step

Open MitchExpensify opened this issue 5 years ago • 9 comments

If you haven’t already, check out our contributing guidelines for onboarding!


This issue builds on top of the existing IOU Modal, which was implemented in this PR. The IOUParticipant step component has already been created (original PR) and functions as a controlled component (IOUModal manages its state).

The page allows users to select a single participant to request money from, or a group of users to split a bill with. To open the Modal, you can navigate to localhost:8080/#/iou/request AND localhost:8080/#/iou/split.

Upwork job posting - https://www.upwork.com/jobs/~019cecae028c47f8d1

Mobile Select single participant image

Select multiple participants image

Deliverables:

  1. Use the existing ROUTES.IOU_BILL_SPLIT & ROUTES.IOU_REQUEST_MONEY routes logic to distinguish between the Bill split (select multiple participants) and Request money (select single participant) flows.
  2. The step title should be set within IOUModal. Again using the route logic to determine the current flow.
  3. The search and list Components should work in the same way that it does for the current 'New Group' and 'New Chat' modals.
  4. For the bill split flow, we should display a user list similar to the new group modal created here (issue / PR. The next button should display when at least one user has been selected. The existing onStepComplete prop function should be invoked when the button is pressed, passing back an array of user emails to IOUModal -- which should be persisted in state.
  5. For the request money flow, we should display a user list similar to the new chat modal created here ([issue](Expensify/Expensify.cash#1337 PR)
  6. When a single participant has been selected, the existing onStepComplete prop function , passing back an array containing the single selected user email to IOUModal -- which should be persisted in state. When the onStepComplete callback is invoked, then IOUModal should navigate to the next step.

MitchExpensify avatar Mar 10 '21 02:03 MitchExpensify

Hey, I would love to work on this PR!

I have sent the Upwork proposal by my name: Barun Pandey.

Proposal

  • Use the hasMultipleParticipants and render either BillSplit (on true) or RequestMoney (on false) flow accordingly.

  • 
Use the hasMultipleParticipants bool to determine the step title as well.

  • Persist participants state in IOUModal

  • Use OptionsSelector and the logic same as in the NewGroup Page (for toggling option), and only show the Next button when one of the options is selected. Use the same search logic as well.

  • Use a similar logic to the NewChat Page to implement the RequestMoney logic. Use the same search logic as well.

  • Send user Emails back to IOUModal from BillSplit or RequestMoney when the onStepComplete prop function is invoked. onStepComplete will use participants state to do so.

barun1997 avatar Mar 10 '21 05:03 barun1997

Hey @barun1997, thanks again for the proposal!

I've assigned the issue to you. Please feel free to reach out if you have any questions or concerns regarding the specification.

Julesssss avatar Mar 10 '21 15:03 Julesssss

Hey @Julesssss , thanks for the assignment! I will get onto it first thing tomorrow. I will reach out to you if anything comes up.

barun1997 avatar Mar 10 '21 16:03 barun1997

Hey, @Julesssss, so I have completed the logical implementation of our issue. This is how I have structured the solution. If you are fine with this or want to move this conversation over to the PR side, I can open it with all the necessary tests and follow all the guidelines.

image

image

barun1997 avatar Mar 11 '21 20:03 barun1997

Hey @barun1997! Yes, can you move this to a PR please, so the team can review the code and tests there. Thanks! 👍

trjExpensify avatar Mar 11 '21 21:03 trjExpensify

Agreed, @Julesssss and myself can help you with these type of questions in a PR @barun1997 as it will be easier for us to see all your code and pull it down to test ourselves. Let us know if you have any issues getting the PR up.

AndrewGable avatar Mar 11 '21 23:03 AndrewGable

Thank you for your replies - @trjExpensify, @AndrewGable! I will move it to a PR!

barun1997 avatar Mar 12 '21 01:03 barun1997

Related PR: https://github.com/Expensify/Expensify.cash/pull/1738

trjExpensify avatar Mar 12 '21 19:03 trjExpensify

Some additional changes are being worked on by the contributor, they said they would work on this first thing tomorrow 🤞

Julesssss avatar Mar 16 '21 18:03 Julesssss