Fix - Approve button not disappear after approving report offline if advanced approval set#49188
Conversation
|
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| const submitToAccountID = PolicyUtils.getSubmitToAccountID(policy, ownerAccountID); | ||
|
|
||
| if (approvalChain.length === 0) { | ||
| return submitToAccountID; |
There was a problem hiding this comment.
do we need any additional checks for submitAccountID?
There was a problem hiding this comment.
FYI this logic is taken from how we get the next approver display name to build next step here as what we are aiming to achieve is to set the managerID to the next approver. And getSubmitToAccountID always returns account number so we don't need any checks.
Line 7030 in 00bc167
Line 96 in 00bc167
Lines 63 to 74 in 00bc167
There was a problem hiding this comment.
If we got the logic from there can we refactor this so we don't need to maintain two very similar utils?
There was a problem hiding this comment.
Maybe the getNextApproverDisplayName() can get the nextApproverAccountID and use it to get the displayName?
| return submitToAccountID; | ||
| } | ||
|
|
||
| return PersonalDetailsUtils.getAccountIDsByLogins([nextApproverEmail])[0] ?? submitToAccountID; |
There was a problem hiding this comment.
do we need to add a length check here?
There was a problem hiding this comment.
We don't need; there is already a fallback provided in case of empty array 👍
mananjadhav
left a comment
There was a problem hiding this comment.
Overall code changes looks good, asked 2 questions.
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-approval.movAndroid: mWeb Chromemweb-chrome-approval.moviOS: Nativeios-approval.moviOS: mWeb Safarimweb-safari-approval.movMacOS: Chrome / Safariweb-approval.movMacOS: Desktopdesktop-approval.mov |
|
Is it possible to generate adhoc builds for this one? I am having issues with mobile app builds. |
|
@mananjadhav requested ad hoc build 👍 |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
Thanks @dylanexpensify testing this. |
| const submitToAccountID = PolicyUtils.getSubmitToAccountID(policy, ownerAccountID); | ||
|
|
||
| if (approvalChain.length === 0) { | ||
| return submitToAccountID; |
There was a problem hiding this comment.
If we got the logic from there can we refactor this so we don't need to maintain two very similar utils?
| const submitToAccountID = PolicyUtils.getSubmitToAccountID(policy, ownerAccountID); | ||
|
|
||
| if (approvalChain.length === 0) { | ||
| return submitToAccountID; |
There was a problem hiding this comment.
Maybe the getNextApproverDisplayName() can get the nextApproverAccountID and use it to get the displayName?
Correct @marcaaron I have implemented it and tests well. |
|
✋ 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/marcaaron in version: 9.0.41-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀
|
Details
Fixed Issues
$ #47264
PROPOSAL: #47264 (comment)
Tests
Precondition: create a control workspace, set "Manually approve all expenses" over to $10 and set advanced approval in OD:
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so 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
a.mp4
Android: mWeb Chrome
aw.mp4
iOS: Native
i.mp4
iOS: mWeb Safari
iw.mp4
MacOS: Chrome / Safari
w.mp4
MacOS: Desktop
d.mp4