Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2021-11-04] Don't allow attendee deselection from the bill-split confirmation page #5295

Closed
Julesssss opened this issue Sep 16, 2021 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Weekly KSv2

Comments

@Julesssss
Copy link
Contributor

Julesssss commented Sep 16, 2021

CC @trjExpensify

Action Performed:

  1. Launch the app and login
  2. Click + > Split bill
  3. Enter amount and click next
  4. Select two attendees and click next
  5. Land at the confirmation page

Expected Result:

You should not be able to deselect attendees from this flow. But this should be possible if you split from within a group chat!

Actual Result:

You are able to deselect attendees from this flow.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.0.98-0

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Bug5231690_Recording__1041.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause
Slack conversation:

View all open jobs on GitHub

view this job

@Julesssss Julesssss self-assigned this Sep 16, 2021
@Julesssss Julesssss added the Improvement Item broken or needs improvement. label Sep 16, 2021
@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label Sep 16, 2021
@MelvinBot
Copy link

Triggered auto assignment to @jboniface (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@PrashantMangukiya
Copy link
Contributor

PrashantMangukiya commented Sep 16, 2021

Proposed Solution

We have to pass one prop that indicates that it is group split or not. So based on that we can disable interactivity on IOUConfirmationList.js screen. I will suggest to update code as shown below.

/src/pages/iou/IOUModal.js add below code

<IOUConfirmPage
   ...
    isGroupSplit={this.steps.length === 2}     // ***  Add this code
/>

src/pages/iou/steps/IOUConfirmPage.js add below code

const propTypes = {
    ...
    /** Amount split belongs to group or not */
    isGroupSplit: PropTypes.bool.isRequired,         // *** Add this prop type 
};

<IOUConfirmationList
    ... 
    isGroupSplit={props.isGroupSplit}          // *** Add this code
/>

Within src/components/IOUConfirmationList.js add below code

const propTypes = {
    ... 
    /** Amount split belongs to group or not */
    isGroupSplit: PropTypes.bool.isRequired,         // *** Add this prop type 
    ... 
};

<OptionsList
    ...
    disableRowInteractivity={!this.props.isGroupSplit}         // Update this line
    ...
/>

Here is Screen Record - how it works after updates.

Screen.Recording.2021-09-16.at.9.44.36.PM.mov

@jboniface
Copy link

@Julesssss should this be on n6-hold?

@MelvinBot MelvinBot added Weekly KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors and removed Daily KSv2 labels Sep 16, 2021
@Julesssss
Copy link
Contributor Author

Added.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Sep 16, 2021

Proposal

It's clear we don't want to allow deselection in the confirmation list. So here

onSelectRow={toggleOption}
disableRowInteractivity={!this.props.hasMultipleParticipants}

We can straight away just pass disableRowInteractivity prop alone,
by removing this unnecessary ={!this.props.hasMultipleParticipants}

This should be enough.

Note:
Other things
onSelectRow prop can be removed & toggleOption method which is unused code, so it can be removed

@Julesssss
Copy link
Contributor Author

Thanks for the proposals. I think @Santhosh-Sellavel's is a simpler solution as we're reusing the this.props.hasMultipleParticipants prop.

onSelectRow prop can be removed & toggleOption method which is unused code, so it can be removed

However, I'm not sure about this part. Wouldn't this still be necessary for the 'launch bill split from group chat' flow?

@PrashantMangukiya
Copy link
Contributor

We need expected result as under:

You should not be able to deselect attendees from this flow. But this should be possible if you split from within a group chat!

Flow1: When flow initiated via
Click + > Split bill,
Enter amount and click next,
Select two attendees and click next,
Land at confirmation page. So in this case it should Not Allow to deselect attendees.

Flow2: Flow init from Group Chat
i.e. Click + button at left of text box in group chat,
Select Split Bill (when Group chat) (Otherwise Request Money)
Enter amount and click next,
It will directly Land at confirmation page So in this case it should Allow to deselect attendees.

My solution cover both flow. We need one props that indicates that current flow initiated via Group Chat > Split Bill OR FAB + > Split Bill, So thereafter we can control allow or not allow deselect for each flow as per need. In my screen record both flow works as expected.

@jboniface
Copy link

@Julesssss looks like we lost site of this since it's on n6-hold, do you have a response to the proposal?

@MelvinBot MelvinBot removed the Overdue label Sep 27, 2021
@Julesssss
Copy link
Contributor Author

Julesssss commented Sep 28, 2021

@PrashantMangukiya your solution seems to work well, but my issue with it is that we don't need to set up a new isGroupSplit prop on IOUModal. Instead, we can use the preexisting this.props.hasMultipleParticipantsprop. Shown here. Could you update your original proposal to include this, please.

@PrashantMangukiya
Copy link
Contributor

@Julesssss let me figure out if this.props.hasMultipleParticipants works or not. I will submit updated proposal soon.

@Santhosh-Sellavel
Copy link
Collaborator

@Julesssss Ideally either we should allow/restrict in both cases it causes a inconsistency in the flow. I find it confusing

@Julesssss
Copy link
Contributor Author

I disagree about allowing both cases, the current flows are confusing as users can remove users on multiple steps. The only reason we added removal deselection in the first place is that there is no way to deselect if splitting a bill from within a group chat.

@parasharrajat
Copy link
Member

I agree this change in this issue is necessary and well planned.

@PrashantMangukiya
Copy link
Contributor

@Julesssss I did research again on this solution and I understood below things:

It looks like that we can not use hasMultipleParticipants prop from IOUModal.js to implement this solution, because hasMultipleParticipants prop comes true in both case i.e. Case1: When clicked FAB Button > Split Bill from Chats list. Other use Case2: Open Group Chat and Click + icon at left of chat text box, it shows Split Bill to initiate Split bill within a group.

Below are screenshot for Case1 and Case2

Screenshot 2021-09-28 at 7 20 59 PM

Screenshot 2021-09-28 at 7 22 38 PM

We need below expected result for this issue

You should not be able to deselect attendees from this flow. But this should be possible if you split from within a group chat!

So we need to take decision that Split Bill flow initiated via FAB button or from Group Chat. Based on that decision we can implement logic to Disable deselect attendees from FAB button Split Bill flow (case1), and allow to deselect if Split started from Group Chat (Case2).

So we can not take this decision based on hasMultipleParticipants prop from IOUModal.js because its coming true in both case. So we need some prop (e.g. isGroupSplit) that indicates from where this flow initiated.

So based on that props we have to take decision on src/components/IOUConfirmationList.js component and disable or enable deselection.

Based on my research at present I can not see other way to implement this solution. So the solution I suggested will work as expected and I can not see any other way to solve this problem. I will keep thinking and provide solution if found any other way.

@Julesssss please guide me if I missed something, I will appreciate it.

Thank you.

@Julesssss
Copy link
Contributor Author

Oh right. Thanks for explaining that, I forgot that the prop was used to distinguish between Send Money/Split Bills!

In that case, I think we can move forward with your proposal once The N6 hold is cleared.

@PrashantMangukiya
Copy link
Contributor

Thanks @Julesssss, please message me once N6 hold cleared. So thereafter I will proceed to submit pr.

@jboniface
Copy link

still on hold

@MelvinBot MelvinBot removed the Overdue label Oct 6, 2021
@kadiealexander
Copy link
Contributor

Please refer to this post for updated information on the n6 hold, we've raised the bonus to $250 for all issues where a PR is created before the N6 hold is lifted.

@mallenexpensify mallenexpensify self-assigned this Oct 8, 2021
@jboniface
Copy link

still on hold

@MelvinBot MelvinBot removed the Overdue label Oct 15, 2021
@PrashantMangukiya
Copy link
Contributor

@jboniface thank you. I accepted Upwork offer. I will prepare and submit pr asap.

@parasharrajat
Copy link
Member

I will be reviewing the PR and I will let you know @Julesssss when this is ready for final review and possibly for merge. See More

@mallenexpensify mallenexpensify removed their assignment Oct 20, 2021
@mallenexpensify
Copy link
Contributor

n6-hold label removed!

@MelvinBot MelvinBot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 26, 2021
@jboniface
Copy link

On staging, not on production yet

@MelvinBot MelvinBot removed the Overdue label Oct 26, 2021
@mountiny mountiny changed the title Don't allow attendee deselection from the bill-split confirmation page [HOLD for payment 2021-11-04] Don't allow attendee deselection from the bill-split confirmation page Oct 30, 2021
@mountiny mountiny added the Awaiting Payment Auto-added when associated PR is deployed to production label Oct 30, 2021
@jboniface
Copy link

payment scheduled for tomorrow, not overdue

@MelvinBot MelvinBot removed the Overdue label Nov 3, 2021
@jboniface
Copy link

paid with n6-hold bonus

@PrashantMangukiya
Copy link
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants