-
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 "automatically approved" report action copy #49909
Conversation
FYI this is ready for review BUT i might also add a case for forwarded report actions here 👍 |
Ok nice i will update test steps then we're ready 🙏 |
The changes look good to me, I'm starting to test! @Beamanator Could you resolve the conflict? Thank you! |
ooh big conflicts!! will resolve soon 🙏 |
@Beamanator I'm having difficulty testing the second test case/auto-forwarding. After Employee A submitted the expense, it didn't get auto-approved on the Employee B. If Employee B manually approves the expense, it forwards the expense to Employee C. Here's my setting. Also, for the first test case where it automatically approves the expense, I'm only able to make it work if the schedule submit is set to manually. Should we add a step for that? |
Hmm that looks good, can you also show the auto-approval settings? |
Interesting, you mean it won't work if scheduled submit is set to something else like "Daily"? |
Here are the approval settings. So it should be auto-approved on Employee B?
I might be wrong, but the auto-approve won't work for auto-submit expenses. |
@Beamanator, I was able to make it auto-forwarding Screen.Recording.2024-10-03.at.10.57.19.mp4
It's working fine with schedule submission "Manually" using the staging server. |
Hmm ok your approval settings look correct 👍
Yes, basically Employee A submits, and since we have auto-approval on, Employee B should auto-approve (and forward) to Employee C. So the end should be the Employee C needs to approve
Agreed, which is why we want auto-submit (instant submit) NOT on. Are we understanding each other here? 😅 |
fyi I see that you crossed this out, but just to explain - turning off scheduled submit is actually how manual submission is set, not instant submit - for instant submit, you have to turn scheduled submit on & select "instantly" - which may not be so intuitive? 😅 Your video makes it looks like everything is working as i'd expect!! 👍 👍 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chrome49909.mWeb-Chrome.-.Auto.approving.mp449909.mWeb-Chrome.-.Auto.forwarding.mp4iOS: Native49909.iOS.-.Auto.approving.mov49909.iOS.-.Auto.forwarding.mp4iOS: mWeb Safari49909.mWeb-Safari.-.Auto.approving.mov49909.mWeb-Safari.-.Auto.forwarding.mp4MacOS: Chrome / Safari49909.Web.-.Auto.approving.mp449909.Web.-.Auto.forwarding.mp4MacOS: Desktop49909.Desktop.-.Auto.approving.mp449909.Desktop.-.Auto.forwarding.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 🚀
Sorry, I couldn't get the android build working. Not specifically in this PR, but on the latest main. I'm trying to fix it but still no luck.
@roryabraham 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] |
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.
strongly encouraged suggestion: Write some automated tests to cover this change. It's a very good candidate for unit tests, and they'd go a long way to make this code more robust and avoid it breaking in the future.
strongly encouraged Addendum to the strongly encouraged suggestion: Don't add the tests in a follow-up. Add them now 🙂
if (originalMessage?.amount) { | ||
formattedAmount = getFormattedAmount(reportAction); | ||
} else { | ||
formattedAmount = CurrencyUtils.convertToDisplayString(getMoneyRequestSpendBreakdown(expenseReport).totalDisplaySpend, expenseReport?.currency); |
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.
Suggestion: log when we execute this fallback such that, some time from now, we can search up the log and remove this code if it's no longer needed. Create a monthly issue to check back in.
@@ -270,6 +270,30 @@ describe('ReportUtils', () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
describe('ParentReportAction is', () => { |
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.
@roryabraham here's an example getReportName
test I am planning to add more of, for the other examples in this PR - I'll probably even add more tests but can you at least let me know if this is what you're thinking for tests / any feedback on this one?
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.
I was thinking more along the lines of UI tests rendering <ReportActionItem>
using @testing-library/react-native
. There are only limited examples in the repo today
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.
Hmm in that case since there's not much to go on right now, i'd prefer taking this as a follow-up for a contributor or C+ to write up b/c it's going to take me a bit to figure out how that works & that'll keep delaying this PR from getting merged
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.
it's going to take me a bit to figure out how that works & that'll keep delaying this PR from getting merged
Up to you. I'd encourage you to take the time to learn and write the tests, because I don't see this PR as so urgent that we can't wait for tests. Just my opinion though (informed by my observed experience that 90% of the time when we "follow up to add tests", that part just never happens) 🙂
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.
I feel confident that I can get unit tests written externally, so I created this follow-up #50351
I believe this will be more time efficient because I have more important issues to focus on this week
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 👍
✋ 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/bondydaa in version: 9.0.47-1 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.47-4 🚀
|
Details
We want the LHN & report action copy to reflect when a report gets manually approved vs auto approved (this PR)
Fixed Issues
$ #35091
Tests
Members
tab, set "Approval Mode" to "Submit & Approve"Manually approve all expenses over:
field, enter a number like$200.00
(something over $100)Randomly route reports for manual approval:
field, enter0%
$101.00
(something between $100 and $200)Next, do similar on a Control policy
submitsTo
Employee BforwardsTo
Employee CManually approve all expenses over:
to something like $1000Randomly route reports for manual approval:
to 0%Offline tests
N/A - you need to be online for auto-approval to happen (for now)
QA Steps
Same as above
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop