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

Configure Confirm step for IOU #2120

Merged
merged 20 commits into from
Apr 14, 2021
Merged

Conversation

barun1997
Copy link
Contributor

@barun1997 barun1997 commented Mar 27, 2021

<If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit.>

Details

Fixed Issues

#1988

Fixes #1988

Tests

FOR IOU Request:

  1. Go to /iou/request and enter the amount.
  2. Select a participant
  3. Write an optional comment
  4. Click the Request button. Verify it has the amount you entered
  5. Verify it is loading initially, then the loading stops

Since IOURequest has a bug, the modal doesn't pop after completion.

For IOU Split:

  1. Go to /iou/split and enter the amount.
  2. Select the participants
  3. Write an optional comment
  4. Click the Split button

QA Steps

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screenshot 2021-04-12 at 01 08 01

Screenshot 2021-04-12 at 01 08 20

Mobile Web

Screenshot 2021-04-12 at 01 08 51

Screenshot 2021-04-12 at 01 09 03

iOS

Screen.Recording.2021-04-12.at.01.04.01.mov
Screen.Recording.2021-04-12.at.01.04.47.mov

Simulator Screen Shot - iPhone 11 - 2021-04-12 at 01 00 58
Simulator Screen Shot - iPhone 11 - 2021-04-12 at 01 02 01

Android

Screenshot 2021-04-12 at 01 22 46

Screenshot 2021-04-12 at 01 23 55

@barun1997 barun1997 requested a review from a team as a code owner March 27, 2021 01:11
@barun1997 barun1997 marked this pull request as draft March 27, 2021 01:11
@botify botify requested review from timszot and removed request for a team March 27, 2021 01:11
@barun1997
Copy link
Contributor Author

@iwiznia I've mentioned the steps to check the flow for Split!

@Julesssss
Copy link
Contributor

Julesssss commented Mar 29, 2021

Hi @barun1997

Since IOURequest has a bug, the modal doesn't pop after completion.

Is this where the background is grey and you can't close the Modal? If so there's a workaround for testing as this doesn't occur if you launch the modal from the menu. Make these changes locally to see the IOU options in the menus -- but please don't commit them :)

@barun1997
Copy link
Contributor Author

@Julesssss Yup just tested it. Works like a charm! :) The modal closes successfully as required

@Julesssss Julesssss changed the title [Draft]: IOU Confirmation Page WIP: How to enable IOU menu options Mar 30, 2021
@barun1997 barun1997 changed the title WIP: How to enable IOU menu options WIP: Configure Confirm step for IOU Mar 30, 2021
@barun1997
Copy link
Contributor Author

@Julesssss Sorry about the title change. I didn't figure you'd changed the name. I was confused why it was named that, for a second! Haha

return Navigation.dismissModal();
}

// Object.keys(this.props.iousReport)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Julesssss This didn't work with Onyx.mergeCollection() so I instead opted to use state.isTransactionComplete to figure out when to close the modal. What do you suggest I should do?

The logic works perfectly well in the case of Request, when I merge just a single report key, but when I merge the entire object, it doesn't get called. I'm thinking it's mutability issue, and I need to look more into it. But just wanted to know if it was okay to instead use state to know when to close the modal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so you didn't get notified about the report when mergeCollection was called? Odd.

We want to avoid returning from an Actions (Promises or callbacks) so I'd suggest looking into the reason that mergeCollection doesn't work first before we look for alternatives. I'll take a look at this issue tomorrow and let you know if I find anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, yep makes sense! Will look deeper into it then :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find any time for this today unfortunately. Will try again tomorrow. Any luck on your side?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Julesssss I faced the same issue when I looked at it briefly today morning. Will take a deeper look now!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug in Onyx, which has just been fixed. We've just bumped the Onyx version in Expensify.cash, so you should be able to resolve your issue after merging master.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Julesssss Got it, thank you!

Copy link
Contributor Author

@barun1997 barun1997 Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Julesssss, just to give you an update, I have merged with the master but the issue still seems to persist on my end. However, I will look into it more to see if the bug is with how I've used mergeCollection. Please feel free to add suggestions if you have any.

It seems to work with IOURequest, like before where just merge is used. I used _.isEqual for now -- just to make sure the componentDidUpdate implementation wasn't the problem.

I've attached a video for the two instances below:

Screen.Recording.2021-04-02.at.11.09.01.mov

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @barun1997, we're now tracking this here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Julesssss Thank you Jules, I will take a look.

src/pages/iou/IOUModal.js Outdated Show resolved Hide resolved
src/libs/actions/IOU.js Outdated Show resolved Hide resolved
@Jag96
Copy link
Contributor

Jag96 commented Apr 6, 2021

@barun1997 any updates on this?

@barun1997
Copy link
Contributor Author

@barun1997 any updates on this?

I should be ready to go as soon as this PR is up!

Expensify/react-native-onyx#61 (comment)

Comment on lines 163 to 166
* Returns selected options with all participant logins
* @returns {Array}
*/
getAllOptionsAsSelected() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by this.

Returns selected options with all participant logins

What exactly does 'selectedOptions' mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get options. Selected meaning the IOU participants?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that it selects all IOUParticipants for the display in IOUConfirm’s split flow. I will revise the comment to explain it better :)

src/libs/actions/IOU.js Outdated Show resolved Hide resolved
@barun1997
Copy link
Contributor Author

Hi @Julesssss Thank you for the review! I will revise the PR with updated commit first thing tomorrow morning! :)

src/libs/actions/IOU.js Outdated Show resolved Hide resolved
@Julesssss
Copy link
Contributor

Bumping @AndrewGable @timszot for reviews

@barun1997
Copy link
Contributor Author

@Julesssss Made the final change as well :)

Copy link
Contributor

@timszot timszot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave this a read through. Looks good! Been a good learning review as well.

@AndrewGable AndrewGable merged commit 464aff8 into Expensify:master Apr 14, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@marcaaron
Copy link
Contributor

Heads up this PR has caused a regression that prevents the LHN from scrolling.

@marcaaron
Copy link
Contributor

Offending commit ee4d245

@barun1997
Copy link
Contributor Author

hi, @marcaaron I’ll take a look. I had to do that that because the List wasn’t displaying in iOS/Android. I will revert the change in OptionList and work it out in ConfirmationPage itself.

@OSBotify
Copy link
Contributor

🚀 [Deployed](https://github.com/Expensify/Expensify.cash
/actions/runs/765130740) 🚀 to
staging on Mon Apr 19 2021 at 22:41:56 GMT+0000 (Coordinated Universal Time)

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@luacmartins
Copy link
Contributor

luacmartins commented Jan 20, 2023

This PR is pretty old, but it seems that this bug has been there all along which allowed users to send empty comments in IOU requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Chat] [IOU] Create IOUConfirm step
10 participants