-
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
Update logic to display pay button in paid policies #35347
Conversation
Hi @c3024, the PR is on hold for a backend change, but meanwhile, can you provide me a few emails to add you as a member, approver, and admin for the testing policy? |
@c3024 added to the testing collect workspace: The backend changes were deployed to production, so this PR is ready for review |
@@ -60,9 +60,10 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money | |||
const isAutoReimbursable = ReportUtils.canBeAutoReimbursed(moneyRequestReport, policy); | |||
const isPaidGroupPolicy = ReportUtils.isPaidGroupPolicy(moneyRequestReport); | |||
const isManager = ReportUtils.isMoneyRequestReport(moneyRequestReport) && session?.accountID === moneyRequestReport.managerID; | |||
const isReimburser = session?.email === policy?.reimburserEmail; |
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.
Might it be better to send the reimburser's accountID and compare it with session.accountID?
I think we standardised all to compare accountIDs. With comparing accountIDs, even if the reimburser changes their primary email, this check works fine. Reimbursers's email address can also remain hidden if we send only reimburser's accountID (though I don't think this is of much use.)
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.
Oh good point, the problem is that we're setting the reimburser email in the backend from OldDot. I agree we should compare accountIDs but that means we'd need to refactor also OldDot to save the accountID when the reimburser is selected.
Said that, let's go for now with this change and we can refactor later to send the accountID when it becomes a problem or when the dashboard for policy settings is migrated to NewDot.
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.
If the reimburser changes their primary email, then we might check to see if any of the reimbursers' validated email ids match with policy reimburser email. This is a rare and unlikely case and I am not sure if extra verbosity added is worth it. @marcochavezf
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.
@marcochavezf should we just update BE now to send the accountID? Or do we assume that all policy users should have access to this email info
Reviewer Checklist
Screenshots/VideosAndroid: NativepayButtonAndroid.mp4Android: mWeb ChromepayButtonAndroidChrome.mp4iOS: NativepayButtoniOS.mp4iOS: mWeb SafaripayButtoniOSSafari.mp4MacOS: Chrome / SafaripayButtonChrome.mp4MacOS: DesktoppayButtonDesktop.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.
LGTM
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, I kind of agree on the accountID argument- but I can let you decide if you want to merge now
I will merge for now, since we're saving the reimburser email in the policy object, and in order to use the accountID in a standardized way (as we do it in other cases for App) we'd also need to change how we're saving it in the backend |
✋ 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/marcochavezf in version: 1.4.40-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.40-5 🚀
|
On hold for https://github.com/Expensify/Web-Expensify/pull/40709Details
We don't want to display the Pay button in paid policies for all admins, only for the policy reimburser. This PR checks if the logged-in user is a reimburser; if so, we display the Pay button for group policies.
Fixed Issues
$ #34951
Tests
Screen.Recording.2024-01-29.at.8.03.21.p.m.mov
Offline tests
N/A
QA Steps
Same as test steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop