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 |
thienlnam
left a comment
There was a problem hiding this comment.
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.
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 ✔️ |
|
✋ 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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