-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Approve button not visible on first time expense page load #61355
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: Approve button not visible on first time expense page load #61355
Conversation
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari61355-web-chrome-001.mp4MacOS: Desktop61355-desktop-001.mp4Android: Native61355-android-hybrid-001.mp4Android: mWeb Chrome61355-mweb-chrome-001.mp4iOS: Native61355-ios-hybrid-001.mp4iOS: mWeb Safari61355-mweb-safari-001.mp4 |
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.
Thanks @linhvovan29546 for the PR.
@youssef-lr Changes LGTM and works well.
All yours for review. Thanks.
✋ 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/youssef-lr in version: 9.1.42-0 🚀
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.1.43-5 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.1.44-8 🚀
|
Explanation of Change
The
canApproveIOU
function usesgetReportTransactions
to retrieve thetransactions
for an IOU report, which relies onOnyx
data. On first access to the page, thisOnyx
data is empty. Although the data becomes available after theopenReport
command returns, some parts of the code wrapcanApproveIOU
inside auseMemo
without includingtransactions
in thedependency
array. As a result, the memoized value does not update, and the function incorrectly returnsfalse
.This PR updates
canApproveIOU
to accepttransactions
as a third parameter, allowing it to re-evaluate properly when thetransactios
changes.Fixed Issues
$ #60030
PROPOSAL: #60030 (comment)
Tests
Preconditions:
User A is an approver.
User B is a member.
The workspace has both Manual Delay Submission and Approver workflows enabled.
Note: Please ensure testing with both
expensifail
accounts andnormal
accounts as wellSteps:
Offline tests
This issue requires fetching data from the server, so in offline tests, the Approve button does not appear.
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectioncanBeMissing
param foruseOnyx
toggleReport
and notonIconClick
)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
Screen.Recording.2025-05-03.at.09.49.32.mov
Android: mWeb Chrome
Screen.Recording.2025-05-03.at.09.52.44.mov
iOS: Native
Screen.Recording.2025-05-03.at.09.44.28.mov
iOS: mWeb Safari
Screen.Recording.2025-05-03.at.09.46.23.mov
MacOS: Chrome / Safari
Screen.Recording.2025-05-03.at.09.33.24.mov
Screen.Recording.2025-05-03.at.09.36.18.mov
MacOS: Desktop
Screen.Recording.2025-05-03.at.09.43.14.mov