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

Fix the IOU badge on newly created reports #2543

Merged
merged 10 commits into from
Apr 29, 2021
Merged

Fix the IOU badge on newly created reports #2543

merged 10 commits into from
Apr 29, 2021

Conversation

tgolen
Copy link
Contributor

@tgolen tgolen commented Apr 22, 2021

Held on:

Details

Fixes the IOU badge when an IOU report is created for the first time

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/161189

Tests

  1. Go to http://localhost:8080/iou/request
  2. Request money from someone that has an account, but you've never chatted with before
  3. Verify that once the request is done, there is a new row in the left-hand-navigation and it has a badge with the correct dollar amount
  4. Go to http://localhost:8080/iou/split
  5. Create a split from someone that has an account, but you've never chatted with before
  6. Verify that once the split is created, there is a new row in the left-hand-navigation and it has a badge with the correct dollar amount
  7. Repeat both tests with people you HAVE chatted with before (just to check for regressions)

QA (on web only)

  1. Go to http://staging.expensify.cash/iou/request
  2. Request money from someone that has an account, but you've never chatted with before
  3. Verify that once the request is done, there is a new row in the left-hand-navigation and it has a badge with the correct dollar amount
  4. Go to http://staging.expensify.cash/iou/split
  5. Create a split from someone that has an account, but you've never chatted with before
  6. Verify that once the split is created, there is a new row in the left-hand-navigation and it has a badge with the correct dollar amount
  7. Repeat both tests with people you HAVE chatted with before (just to check for regressions)

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

image

Mobile Web

Desktop

iOS

Android

@tgolen tgolen changed the title Tgolen iou badge [HOLD Auth#5505] [HOLD react-native-onyx#66]Tgolen iou badge Apr 22, 2021
@tgolen tgolen requested review from Julesssss and a team April 22, 2021 22:03
@tgolen tgolen self-assigned this Apr 22, 2021
@MelvinBot MelvinBot requested review from sketchydroide and removed request for a team April 22, 2021 22:03
@tgolen tgolen changed the title [HOLD Auth#5505] [HOLD react-native-onyx#66]Tgolen iou badge [HOLD Auth#5505] [HOLD react-native-onyx#66] Fix the IOU badge on newly created reports Apr 22, 2021
@tgolen tgolen marked this pull request as ready for review April 22, 2021 22:09
@tgolen tgolen requested a review from a team as a code owner April 22, 2021 22:09
@MelvinBot MelvinBot requested review from deetergp and removed request for a team April 22, 2021 22:09
@tgolen tgolen removed the request for review from deetergp April 22, 2021 22:11
@tgolen
Copy link
Contributor Author

tgolen commented Apr 22, 2021

Sorry, puller bear got a little happy. You can still review if you want @deetergp, but I've removed the review request for you.

@tgolen
Copy link
Contributor Author

tgolen commented Apr 22, 2021

I ran out of time today to finish the cross-platform testing, so I've only verified it on web for now. I'll try to get to the others tomorrow. Come to think of it though... is this testable on the other platforms @Julesssss (since you can't modify the URL in any other platform other than web).

@Julesssss
Copy link
Contributor

Julesssss commented Apr 23, 2021

Come to think of it though... is this testable on the other platforms @Julesssss (since you can't modify the URL in any other platform other than web).

Good point. All platforms are (internally) testable with the following diff. This adds 'Request Money' and 'Split Bill' options to the global CreateMenu:

diff --git a/src/pages/home/sidebar/SidebarScreen.js b/src/pages/home/sidebar/SidebarScreen.js
index b1af36bba..f94eac8ec 100644
--- a/src/pages/home/sidebar/SidebarScreen.js
+++ b/src/pages/home/sidebar/SidebarScreen.js
@@ -103,6 +103,16 @@ class SidebarScreen extends Component {
                                     text: 'New Group',
                                     onSelected: () => Navigation.navigate(ROUTES.NEW_GROUP),
                                 },
+                                {
+                                    icon: ChatBubble,
+                                    text: 'Request Money',
+                                    onSelected: () => Navigation.navigate(ROUTES.IOU_REQUEST),
+                                },
+                                {
+                                    icon: Users,
+                                    text: 'Split Bill',
+                                    onSelected: () => Navigation.navigate(ROUTES.IOU_BILL),
+                                },
                             ]}
 
                         /**

getSimplifiedIOUReport(iouReportObjects[0]));
}
_.each(reportsData, (reportData) => {
// First, the existing chat report needs updated with the details about the new IOU
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB:

// First, the existing chat report needs updated with the details about the new IOU

// First, the existing chat report needs to be updated with the details about the new IOU

Comment on lines +98 to +103
// This data needs to go from this:
// {reportIDList: [1, 2], chatReportIDList: [3, 4]}
// to this:
// [{reportID: 1, chatReportID: 3}, {reportID: 2, chatReportID: 4}]
// in order for getIOUReportsForNewTransaction to know which IOU reports are associated with which
// chat reports
Copy link
Contributor

Choose a reason for hiding this comment

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

I still like the idea of providing a better data structure in Auth, but let's not block the issue. We can create this as a non-blocking IOU task here.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

The fix tested well for me on Web/Desktop/Android, but I think there's a regression: Opening a new chat/group chat report triggers the following error:

Screenshot 2021-04-23 at 15 48 03

@Julesssss
Copy link
Contributor

Ignore the last comment, I've seen the same issue on other PRs. I think it is fixed on the latest main commit.

@Julesssss Julesssss self-requested a review April 23, 2021 15:00
@tgolen tgolen changed the title [HOLD Auth#5505] [HOLD react-native-onyx#66] Fix the IOU badge on newly created reports [HOLD Auth#5504] [HOLD react-native-onyx#66] Fix the IOU badge on newly created reports Apr 23, 2021
@tgolen tgolen changed the title [HOLD Auth#5504] [HOLD react-native-onyx#66] Fix the IOU badge on newly created reports [HOLD react-native-onyx#66] Fix the IOU badge on newly created reports Apr 23, 2021
@tgolen
Copy link
Contributor Author

tgolen commented Apr 26, 2021

Looks like this is working well now after a few things in Onyx have been changed. I've tested the changes locally and I'm just waiting for the Onyx PR to get merged before releasing the hold on this.

@tgolen tgolen changed the title [HOLD react-native-onyx#66] Fix the IOU badge on newly created reports Fix the IOU badge on newly created reports Apr 26, 2021
@tgolen
Copy link
Contributor Author

tgolen commented Apr 26, 2021

Updated and I have removed the HOLD

@Julesssss
Copy link
Contributor

Would you mind merging main, as this issue is still occurring when I try to verify the issue with a regular chat report (IOU Reports work as expected).

While I'm sure that these changes will work with chat reports, I would like to confirm just to be sure.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Tests well with IOU Reports. Nice improvements, too 👍

@tgolen
Copy link
Contributor Author

tgolen commented Apr 27, 2021

Yep, looks like merging in main makes that error go away. Updated!

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Thanks for merging main, I can confirm that the issue is also resolved for the chat report flow.

@sketchydroide leaving the merge to you 👍

@Julesssss
Copy link
Contributor

Bumping @sketchydroide :)

Copy link
Contributor

@sketchydroide sketchydroide left a comment

Choose a reason for hiding this comment

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

LGTM

@Julesssss Julesssss merged commit 7d0987a into main Apr 29, 2021
@Julesssss Julesssss deleted the tgolen-iou-badge branch April 29, 2021 14:46
@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.33-2🚀

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

@isagoico
Copy link

@tgolen @Julesssss I don't think we're able to test this PR, can you confirm?

@tgolen
Copy link
Contributor Author

tgolen commented Apr 29, 2021

This should be able to be tested on web only by using those links. (eg. https://staging.expensify.cash/iou/request and https://staging.expensify.cash/iou/split). Sorry I wasn't more clear in the description! I'll update it.

@isagoico
Copy link

@tgolen We were unable to access the iOU page, when navigating to the links provided on the steps, we're just being redirected to staging.expensify.cash/.
We tried with Expensifail accounts and we are being redirected to a blank page.

@trjExpensify
Copy link
Contributor

Hey @isagoico! You should be able to do it like this:

  1. go to an existing chat report on staging e.g https://staging.expensify.cash/r/123456
  2. switch out the r/ for either /iou/request/ or /iou/split/ e.g https://staging.expensify.cash/iou/request/123456

@isagoico
Copy link

isagoico commented Apr 29, 2021

Same issue as before! Here's the screenshot scratch that, seems like I typed something wrong.
image

@OSBotify
Copy link
Contributor

OSBotify commented May 8, 2021

🚀 Deployed to production in version: 1.0.39-5🚀

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

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.

6 participants