perf: move report brick road statuses to a derived value#60827
Merged
mjasikowski merged 43 commits intoExpensify:mainfrom May 7, 2025
Merged
perf: move report brick road statuses to a derived value#60827mjasikowski merged 43 commits intoExpensify:mainfrom
mjasikowski merged 43 commits intoExpensify:mainfrom
Conversation
…tus-derived-value
TMisiukiewicz
commented
Apr 24, 2025
Comment on lines
+10472
to
+10502
| function generateReportAttributes({ | ||
| report, | ||
| reportActions, | ||
| transactionViolations, | ||
| }: { | ||
| report: OnyxEntry<Report>; | ||
| reportActions?: ReportActions; | ||
| transactionViolations: OnyxCollection<TransactionViolation[]>; | ||
| }) { | ||
| const isReportSettled = isSettled(report); | ||
| const isCurrentUserReportOwner = isReportOwner(report); | ||
| const doesReportHasViolations = hasReportViolations(report?.reportID); | ||
| const hasViolationsToDisplayInLHN = shouldDisplayViolationsRBRInLHN(report, transactionViolations); | ||
| const hasAnyViolations = hasViolationsToDisplayInLHN || (!isReportSettled && isCurrentUserReportOwner && doesReportHasViolations); | ||
| const reportErrors = getAllReportErrors(report, reportActions); | ||
| const hasErrors = Object.entries(reportErrors ?? {}).length > 0; | ||
| const oneTransactionThreadReportID = getOneTransactionThreadReportID(report?.reportID, reportActions); | ||
| const parentReportAction = report?.parentReportActionID ? reportActions?.[report.parentReportActionID] : undefined; | ||
| const requiresAttention = requiresAttentionFromCurrentUser(report, parentReportAction); | ||
|
|
||
| return { | ||
| doesReportHasViolations, | ||
| hasViolationsToDisplayInLHN, | ||
| hasAnyViolations, | ||
| reportErrors, | ||
| hasErrors, | ||
| oneTransactionThreadReportID, | ||
| parentReportAction, | ||
| requiresAttention, | ||
| }; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I created this function to:
- Keep
reportAttributes.tsas clean as possible - Those values can be later exposed by a derived value and it'll be possible to use them instead of calling those functions multiple times
…tus-derived-value
…tus-derived-value
…tus-derived-value
ca6de99 to
de7c06c
Compare
hoangzinh
approved these changes
May 7, 2025
mjasikowski
approved these changes
May 7, 2025
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Contributor
Performance Comparison Report 📊 (1/14)Significant Changes To Duration
Show details
|
Contributor
Performance Comparison Report 📊 (10/14)Meaningless Changes To Duration (9/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (11/14)Meaningless Changes To Duration (10/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (12/14)Meaningless Changes To Duration (11/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (13/14)Meaningless Changes To Duration (12/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (14/14)Meaningless Changes To Duration (13/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (2/14)Meaningless Changes To Duration (1/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (3/14)Meaningless Changes To Duration (2/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (4/14)Meaningless Changes To Duration (3/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (5/14)Meaningless Changes To Duration (4/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (6/14)Meaningless Changes To Duration (5/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (7/14)Meaningless Changes To Duration (6/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (8/14)Meaningless Changes To Duration (7/13)Show entries
Show details
|
Contributor
Performance Comparison Report 📊 (9/14)Meaningless Changes To Duration (8/13)Show entries
Show details
|
Contributor
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
Contributor
Author
90 tasks
Contributor
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.1.42-0 🚀
|
8 tasks
Contributor
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.1.43-5 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.1.44-8 🚀
|
8 tasks
8 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Fixed Issues
$ #59350
PROPOSAL:
Tests
Test case 1:
Test case 2:
OpenReportOffline tests
n/a
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.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 and/or tagged@Expensify/designso 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: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov