-
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
fix: Inbox showing GBR when there’s a report with RBR #51643
Merged
Merged
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
87f6644
fix: Inbox showing GBR when there’s a report with RBR
truph01 850f5ab
merge main
truph01 6d00a65
fix: optimize code
truph01 bba3e08
merge main
truph01 bbbe5aa
fix: refactor code
truph01 462c52f
fix: lint
truph01 c45ade8
merge main
truph01 f20b84f
fix: add test
truph01 a708691
fix: lint
truph01 85d684f
fix: unit test
truph01 0f9e3df
fix: lint
truph01 976c78f
fix: lint
truph01 e156dca
fix: add comment to test and create json file
truph01 e82e777
fix: prettier
truph01 8d0da00
fix: remove unused data in json
truph01 d42e264
fix: add 2nd test case
truph01 ef77bb9
fix: lint
truph01 bd9c7ac
fix: update comment
truph01 16b9d4e
fix: add detailed comments in test
truph01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -63,7 +63,16 @@ const getBrickRoadForPolicy = (report: Report, altReportActions?: OnyxCollection | |||||||||||||||||||||||||||||||||||||
const oneTransactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(report.reportID, reportActions); | ||||||||||||||||||||||||||||||||||||||
let doesReportContainErrors = Object.keys(reportErrors ?? {}).length !== 0 ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined; | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
if (oneTransactionThreadReportID) { | ||||||||||||||||||||||||||||||||||||||
const parentReportActions = (altReportActions ?? allReportActions)?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.parentReportID}`]; | ||||||||||||||||||||||||||||||||||||||
const parentReportAction = parentReportActions?.[report?.parentReportActionID ?? '-1']; | ||||||||||||||||||||||||||||||||||||||
const shouldDisplayViolations = ReportUtils.shouldDisplayTransactionThreadViolations(report, allTransactionViolations, parentReportAction); | ||||||||||||||||||||||||||||||||||||||
const shouldDisplayReportViolations = ReportUtils.isReportOwner(report) && ReportUtils.hasReportViolations(report.reportID); | ||||||||||||||||||||||||||||||||||||||
const hasViolations = shouldDisplayViolations || shouldDisplayReportViolations; | ||||||||||||||||||||||||||||||||||||||
if (hasViolations && !doesReportContainErrors) { | ||||||||||||||||||||||||||||||||||||||
doesReportContainErrors = CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
if (oneTransactionThreadReportID && !doesReportContainErrors) { | ||||||||||||||||||||||||||||||||||||||
const oneTransactionThreadReport = ReportUtils.getReport(oneTransactionThreadReportID); | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
if ( | ||||||||||||||||||||||||||||||||||||||
|
Oops, something went wrong.
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.
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.
add line break