-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat: Use formula for the optimistic expense report #37160
feat: Use formula for the optimistic expense report #37160
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] |
I was unwell past few days and I've requested for the report fields. The code changes look fine to me. Will work on the checklist as soon as I am added to the beta. |
❗ Please, do not use Github auto-linking keywords such as these: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved. For more details, see the Contributing Guidelines, specifically Submit your pull request for a final review 📖. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-report-fields.movAndroid: mWeb Chromemweb-chrome-report-fields.moviOS: Nativeios-report-fields.moviOS: mWeb Safarimweb-safari-report-fields.movMacOS: Chrome / Safariweb-report-fields.movMacOS: Desktopdesktop-report-fields.mov |
I could test other properties to the formula, except for the last case |
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.
Looking good, just a few comments
* Each formula field is either replaced with a value, or removed. | ||
* If after all replacements the formula is empty, the original formula is returned. | ||
*/ | ||
function populateOptimisticReportFormula(formula: string, report: OptimisticExpenseReport, policy: Policy | EmptyObject): string { |
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.
There's a couple more we can handle here optimistically
{report:created}
{report:created:yyyy-MM-dd}
{report:status}
{user:email}
{user:email|frontPart} would output bob assuming that is the currently logged in Expensify user’s email.
Thanks @thienlnam, addressed your comments ✔️ |
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.
Great, 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/thienlnam in version: 1.4.45-0 🚀
|
@kavimuru if I understand correctly, the |
Ok, I've updated the PR description: removed the cc: @mananjadhav |
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.45-6 🚀
|
Details
When creating an expense report in a Policy that supports report fields, build the expense report name using the formula.
Fixed Issues
for #36267
PROPOSAL: #36267 (comment)
Tests
Same as QA
Offline tests
Same as QA
QA Steps
Preconditions: be a member of a collect policy, have no active expense report with this policy, and have the "report fields" beta turned on.
{report:id}
{report:type}
{report:startdate}
{report:total}
{report:currency}
{report:policyname}
For instance, in my recordings, I used the formula with
{report:type}
and{report:startdate}
fields.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-compressed.mp4
Android: mWeb Chrome
chrome-compressed.mp4
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-02-23.at.23.42.32-compressed.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-02-23.at.23.41.26-compressed.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-02-23.at.22.52.16.mov
MacOS: Desktop
Screen.Recording.2024-02-23.at.23.22.57-compressed.mp4