-
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
[QA failed: do not check this off] fix: Submit expense option is not disabled for users who are invited to expense report #47373
Conversation
@dukenv0307 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] |
src/libs/ReportUtils.ts
Outdated
@@ -6218,7 +6226,7 @@ function canRequestMoney(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>, o | |||
// which is tied to their workspace chat. | |||
if (isMoneyRequestReport(report)) { | |||
const canAddTransactions = canAddTransaction(report); | |||
return isReportInGroupPolicy(report) ? isOwnPolicyExpenseChat && canAddTransactions : canAddTransactions; | |||
return isReportInGroupPolicy(report) || isExpenseReport(report) ? isOwnPolicyExpenseChat && canAddTransactions : canAddTransactions; |
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.
Do we need that check? We already do that in canAddOrDeleteTransactions
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.
@dukenv0307 I updated
@nkdengineer Pls remove steps 7, 8 |
Reviewer Checklist
Screenshots/Videos |
LGTM |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
return false; | ||
} | ||
|
||
if (isExpenseReport(moneyRequestReport) && currentUserAccountID !== moneyRequestReport?.managerID) { |
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.
Wouldn't this break Instant Submit report where submitters create an expense and it gets added to a processing report?
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.
Yeah this breaks optimistic data for instant submit, we end up creating a new stale preview, but the backend adds the expense to the processing report
Screen.Recording.2024-08-16.at.22.24.26.mov
@nkdengineer in case this gets deployed to staging I've marked it as failed in QA. Can you please address the issue in my comment above? Let's make sure we disable the button in the component that controls displaying it, and only for users who they shouldn't see it. AFAIK only submitters can see that button, but I'll let @trjExpensify or @JmillsExpensify confirm. Who can add expenses to a submitted report, the submitter only, or submitter, manager, and admin? |
I think we need to do the check in this function Line 6272 in 0214b3f
|
@youssef-lr since this has not been deployed yet, what about just creating a revert PR and let @nkdengineer do a new PR that works well without needing to rush because of a deploy blocker. Sounds good? |
Yep, only the submitter can add expenses to the expense report. |
Sounds good @aldo-expensify |
I'll create follow PR soon |
@youssef-lr I don't know how to reproduce this bug |
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.0.22-0 🚀
|
@youssef-lr are we good to QA this PR? |
@kavimuru This PR was reverted so we don't need to QA this now. |
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.0.22-1 🚀
|
Thanks for handling the revert @youssef-lr |
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.0.22-9 🚀
|
Details
Fixed Issues
$ #46340
PROPOSAL: #46340 (comment)
Tests
Offline tests
QA Steps
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.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov