Use policy achAccount instead of reimbursementAccount in WorkspaceWorkflow#38395
Use policy achAccount instead of reimbursementAccount in WorkspaceWorkflow#38395luacmartins merged 6 commits intomainfrom
Conversation
af00aed to
65fe96b
Compare
|
Main is currently broken, so I tested this with this fix. |
luacmartins
left a comment
There was a problem hiding this comment.
Looking good and tests well. Just one small comment
|
We also got conflicts now. |
|
updated |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-27.at.2.33.51.in.the.afternoon.movAndroid: mWeb ChromeScreen.Recording.2024-03-27.at.1.16.16.in.the.afternoon.moviOS: NativeScreen.Recording.2024-03-27.at.1.57.54.in.the.afternoon.moviOS: mWeb SafariScreen.Recording.2024-03-27.at.1.39.22.in.the.afternoon.movMacOS: Chrome / SafariScreen.Recording.2024-03-27.at.1.07.42.in.the.afternoon.movMacOS: DesktopScreen.Recording.2024-03-27.at.3.01.54.in.the.afternoon.mov |
|
This is the offline behavior; is there there is anything we can do? @luacmartins @nkuoch
Screen.Recording.2024-03-27.at.3.05.49.in.the.afternoon.movScreen.Recording.2024-03-27.at.3.09.33.in.the.afternoon.movAfter returning online after disabling it offline Screen.Recording.2024-03-27.at.3.12.38.in.the.afternoon.mov |
|
@nkuoch lint is failing |
getusha
left a comment
There was a problem hiding this comment.
LGTM & tests well. just one minor comment.
| onPress={() => { | ||
| if (isOffline || !isPolicyAdmin) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
| onPress={() => { | |
| if (isOffline || !isPolicyAdmin) { | |
| return; | |
| } | |
| disabled={isOffline || !isPolicyAdmin} | |
| onPress={() => { |
|
updated |
|
✋ 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/luacmartins in version: 1.4.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.58-8 🚀
|
| const hasVBA = state === BankAccount.STATE.OPEN; | ||
| const bankDisplayName = bankName ? `${bankName} ${accountNumber ? `${accountNumber.slice(-5)}` : ''}` : ''; | ||
| const {accountNumber, addressName, bankName} = policy?.achAccount ?? {}; | ||
| const hasVBA = !!policy?.achAccount; |
There was a problem hiding this comment.
Hey, this PR caused a bug: Disconnected bank account is still displayed on bank account preview on Workflows page.
It has been handled but just FYI,
Whether the bank name shows up in the bank account preview on the workspace workflows page depends on the policy's achAccount. But when we disconnect the bank account, we forget to set achAccount to null in optimistic data. So, even after disconnecting, the bank account preview still appears until we get response from backend.
More details here - #39439 (comment)
| const hasVBA = state === BankAccount.STATE.OPEN; | ||
| const bankDisplayName = bankName ? `${bankName} ${accountNumber ? `${accountNumber.slice(-5)}` : ''}` : ''; | ||
| const {accountNumber, addressName, bankName} = policy?.achAccount ?? {}; | ||
| const hasVBA = !!policy?.achAccount; |
There was a problem hiding this comment.
This change also caused issue #39947 where we don't yet have a bank account added and because the achAccount: {reimburser: reimburserEmail} is set everytime we toggle "Make or track payments", the UI ends up looking like we have a bank account added because of this check, when we don't actually have a bank account added yet.
Details
Fixed Issues
$ #38200
Tests
From oldDot:
From newDot, you should see it in your workspace workflows settings:

Toggle off "Make or Track Payments".

Settings should stick
Toggle it on again and click on Connect

Try to readd the same bank account. You shouldn't have to redo all steps, as the bank account was still attached to your personal bank account, so we automatically retreived all the info.


Click on Disconnect. Workflow should show back "Connect Bank Account"

Offline tests
N/A
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop