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

'Settled' and 'cancelled' events should display in IOUDetails Modal #3028

Merged
merged 8 commits into from
May 25, 2021

Conversation

Julesssss
Copy link
Contributor

@Julesssss Julesssss commented May 20, 2021

Details

As of the latest IOU Details issue, only IOU transaction events are displayed in the Modal, but not 'Settled' and 'Cancelled' events. This PR refactors the previous logic, enabling all reportComments of type IOU to be shown in the IOUDetails Modal.

Screenshot 2021-05-20 at 15 37 53

This also fixes a bug caused by incorrect Number to String Javascript conversion.

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/164703
Fixes https://github.com/Expensify/Expensify/issues/164704

Tests

NOTE: If you see the This action was taken on old code and is not supported anymore message, the IOU was created from out-of-date Auth code. Please ensure Auth is pulled and rebuilt, then create a new IOU to perform the test.

  1. As userA, create an IOU via 'Request Money' to userB
  2. Within the chatReport with userB, you should see the following message:
    Screenshot 2021-05-20 at 16 10 45
  3. Note that the full Preview Component might not display, due to this bug
  4. Repeat step two, creating a second IOU transaction against the same user
    Screenshot 2021-05-20 at 16 18 49
  5. Now, we need to cancel one of the transactions (QA should skip this step)
    5b. To find the **reportID**, click View Details and note the second route param
    Screenshot 2021-05-20 at 16 24 28
    5c. To locate the **transactionID**, open the Chrome dev tools Application/Local Storage tab, and search the reportID from 5b. Locate reportIOUs_XYZ where XYZ is the reportID.
    5d. Use one of the transactionID values in the API request in 5e
    Screenshot 2021-05-20 at 16 25 48
    5e. Make the following API call, replacing authToken, email, accountId, reportID, & transactionID
curl --request POST \
  --url 'https://expensify-jules.ngrok.io/api?command=RejectTransaction' \
  --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
  --cookie 'email=user8%2540expensify.com; accountID=162; authToken=BCFB...04FAB' \
  --form reportID=1182 \
  --form transactionID=2212712

5f. You should see a new 'Declined/Cancelled the $12.34 request' message, depending on which used rejected the transaction
Screenshot 2021-05-20 at 16 41 02
6. Now, log out and log back in as userB
7. Once logged in, refresh the page to avoid this bug
8. Navigate to the chatReport with userA
Screenshot 2021-05-20 at 16 37 45

  1. Click 'View Details'', or 'Pay'
  2. Settle the IOU by tapping the 'I'll settle up elsewhere' button
    Screenshot 2021-05-20 at 16 54 36
  3. You should see an event for each IOU action that we performed:
    • Requested $100.00
    • Requested $1.00
    • Declined the $1.00 request
    • Settled up elsewhere

QA Steps

Run above tests, but SKIP STEP 5!, as this is not yet possible.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screenshot 2021-05-25 at 16 06 06

Mobile Web

Screenshot 2021-05-25 at 16 27 14

Desktop

Screenshot 2021-05-25 at 16 28 47

iOS

Simulator Screen Shot - iPhone 11 - 2021-05-25 at 16 15 37

Android

Screenshot_1621955303

@Julesssss Julesssss self-assigned this May 20, 2021
@Julesssss Julesssss requested a review from a team as a code owner May 20, 2021 15:01
@MelvinBot MelvinBot requested review from MonilBhavsar and removed request for a team May 20, 2021 15:01
@Julesssss Julesssss requested a review from a team May 20, 2021 15:02
@MelvinBot MelvinBot requested review from sketchydroide and removed request for a team May 20, 2021 15:02
@Julesssss Julesssss removed the request for review from sketchydroide May 20, 2021 15:46
@Julesssss
Copy link
Contributor Author

Hi @MonilBhavsar, I've noticed that sometimes duplicate transactions are displayed in the Details page. Once I've resolved this issue I'll remove the WIP marker.

@Julesssss Julesssss changed the title 'Settled' and 'cancelled' events should display in IOUDetails Modal [WIP] 'Settled' and 'cancelled' events should display in IOUDetails Modal May 20, 2021
@Julesssss Julesssss changed the title [WIP] 'Settled' and 'cancelled' events should display in IOUDetails Modal 'Settled' and 'cancelled' events should display in IOUDetails Modal May 21, 2021
@Julesssss
Copy link
Contributor Author

Julesssss commented May 21, 2021

Alright @MonilBhavsar -- this is good to review on Monday. I fixed the duplicates issue.

@Julesssss
Copy link
Contributor Author

CC @iwiznia you may be interested in reviewing, but no pressure

MonilBhavsar
MonilBhavsar previously approved these changes May 24, 2021
@Julesssss
Copy link
Contributor Author

Ready for another review @MonilBhavsar @iwiznia:

  • Merged main
  • Switched the list item key to sequenceNumber

Copy link
Contributor

@MonilBhavsar MonilBhavsar left a comment

Choose a reason for hiding this comment

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

Screenshots left to be added.

@Julesssss
Copy link
Contributor Author

Added the screenshots

@iwiznia iwiznia merged commit 46ee540 into main May 25, 2021
@iwiznia iwiznia deleted the jules-iouDisplayAllEvents branch May 25, 2021 19:40
@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.

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.

4 participants