-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add Pay as Business option for invoices sent to an individual who is admin of their primary workspace #44970
Add Pay as Business option for invoices sent to an individual who is admin of their primary workspace #44970
Conversation
# Conflicts: # src/components/SettlementButton.tsx
ON HOLD till:
|
# Conflicts: # src/libs/ReportUtils.ts
During the testing, I've found the next problem:
Notes to the screenshot:
I don't think that adding re-renders to report related components when a policy is added is a good idea from the performance side. So I guess it should be possible to affect the order Onyx updates are applied. The App calls Lines 629 to 631 in f81addc
I saw there were some updates in Onyx related to this functionality, here is the PR. And I tested my PR over onyx version 2.0.57 and had the same result. @paultsimura Since you were working on the mentioned Onyx PR related to cc @cristipaval |
Hi @VickyStash, could you please log the |
@paultsimura pushJSON is the array:
Single operation with array passed. |
@paultsimura Do you have any thoughts? |
Hey @VickyStash, unfortunately, my PR didn't touch the order of the updates in this matter – it was aimed to fix only the race conditions of updates of the same collections. Seems like here you've found yet another Onyx issue. |
# Conflicts: # src/ROUTES.ts # src/libs/Navigation/types.ts # src/libs/ReportUtils.ts # src/libs/actions/Policy/Policy.ts # src/pages/ReportAvatar.tsx
# Conflicts: # src/ROUTES.ts # src/libs/Navigation/types.ts # src/pages/ReportAvatar.tsx
# Conflicts: # src/libs/ReportUtils.ts
I've investigated the issue above more, and overall when API provides updates to the app it calls Onyx.update with an array of updates. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-08-07_11.11.42.mp4Android: mWeb Chromeandroid-chrome-2024-08-07_11.13.45.mp4iOS: Nativeios-app-2024-08-06_12.14.37.mp4iOS: mWeb Safariios-safari-2024-08-06_12.18.58.mp4MacOS: Chrome / Safaridesktop-chrome-2024-08-02_15.32.01.mp4MacOS: Desktopdesktop-app-2024-08-02_15.53.00.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
@jjcoffee I've tested the scenario several times on ios+web and on the web+desktop, and there is no disappearing for me. Working_example12.mp4 |
@VickyStash Ah sorry, that was my fault - I didn't explain the pre-requisite fully! The first expense was created on a different session, so in your video you'd have to sign out of User B's account once the first expense is paid before signing back in and proceeding. (I'm assuming it was something to do with there being a fresh session for User B as it happened when I switched test platforms). So I think the reproduction steps should be:
|
@jjcoffee I've tried to logout/login on web, and then on ios and both times it was okay ex-web-desktop1.mp4ios_part2.mp4 |
# Conflicts: # src/libs/SidebarUtils.ts # src/libs/actions/IOU.ts
@jjcoffee Could you please check if you still can reproduce that issue? |
This comment was marked as resolved.
This comment was marked as resolved.
|
Great question! I'll discuss this internally |
# Conflicts: # src/libs/ReportUtils.ts # src/pages/home/HeaderView.tsx
@jjcoffee According to internal discussion now the invoice room should be visible under the selected workspace for the both - sender and payer |
Discussed here - https://expensify.slack.com/archives/CSL3XBCCR/p1722944405023039 |
All working well now from my testing! We've agreed the Onyx flicker should be handled as a follow-up, but I'm not sure about the avatar reverting to the default one when deleting all workspaces - should this be a blocker @cristipaval? |
I think this is also a NAB. Let's not block this PR on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks a lot for the rigorous testing @jjcoffee! 🙌 |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.0.18-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.18-10 🚀
|
@@ -129,7 +131,7 @@ function HeaderView({report, personalDetails, parentReport, parentReportAction, | |||
|
|||
const shouldShowSubscript = ReportUtils.shouldReportShowSubscript(report); | |||
const defaultSubscriptSize = ReportUtils.isExpenseRequest(report) ? CONST.AVATAR_SIZE.SMALL_NORMAL : CONST.AVATAR_SIZE.DEFAULT; | |||
const icons = ReportUtils.getIcons(reportHeaderData, personalDetails); | |||
const icons = ReportUtils.getIcons(reportHeaderData, personalDetails, null, '', -1, undefined, invoiceReceiverPolicy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we fetched icons (and also report name), we also had to pass policy
here. Not doing this caused issue #48710
|
||
let payerOrApproverName; | ||
if (isExpenseReport(report)) { | ||
payerOrApproverName = getPolicyName(report, false, policy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Policy name might come from parent report as well. Missing it caused #52388.
Details
This PR implements the Pay as business option in the App for the individuals who are admins of their primary workspace.
Previous PR with this functionality was reverted.
Fixed Issues
$ #40438
PROPOSAL: N/A
Tests
Pay as business
->Pay elsewhere
Offline tests
Repeat steps 5-7 from the Tests section.
QA Steps
Same as in the Tests section
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android_receiver.mp4
Android: mWeb Chrome
android_web_receiver.mp4
iOS: Native
ios_receiver.mp4
iOS: mWeb Safari
ios_web_receiver.mp4
MacOS: Chrome / Safari
web_receiver.mp4
MacOS: Desktop
desktop_receiver.mp4