-
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
Adds new ReportUtils for Violations #31448
Adds new ReportUtils for Violations #31448
Conversation
@cead22 I've had some issues testing out the functionality of this PR. Even with setting a policy up that has violations for amount, tags, and categories, and then creating requests that violate those policies, I've not had any violations be provided through the Onyx connection. Is there something I'm missing? Once I get that tested I can finish the testing instructions and this PR should be good to go! |
What's missing is that we haven't yet added the backend code to send the violations data down to onyx. Can you set it manually to test? |
@cead22 I'll look into it! I can set the function to return true (that's how I generated the screenshots) but I'll see if I can set the onyx state locally for testing |
…ards/violations/transaction-thread-violations
…ions/transaction-thread-violations
…ards/violations/transaction-thread-violations
Looks like this needs to be reworked with the |
…ards/violations/transaction-thread-violations
…ards/violations/transaction-thread-violations
@cead22 Got the TS conversion working and fixed that test bug! Retesting on all the platforms but this should be up today. |
@cead22 another thought when looking at the testing instructions. This is another PR that won't be able to be tested by QA until Violations are coming through from the back end. Should I specify how to manually set the violations functions as being true for review and then worry about QA later? |
…ards/violations/transaction-thread-violations
Hi! It's been determined that this PR is blocking #33029, which is a pretty important one. Can you give an ETA for when this will be finished? Thanks! |
Almost close. Hopefully merged tomorrow |
@trevor-coleman please fix last conflict |
…s/transaction-thread-violations # Conflicts: # src/libs/SidebarUtils.ts
Conflicts resolved! |
…s/transaction-thread-violations # Conflicts: # src/pages/home/sidebar/SidebarLinksData.js
Resolved new merge conflict |
Checklist complete |
✋ 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/cead22 in version: 1.4.28-0 🚀
|
@@ -231,5 +268,9 @@ export default compose( | |||
selector: policySelector, | |||
initialValue: {}, | |||
}, | |||
transactionViolations: { | |||
key: ONYXKEYS.TRANSACTION_VIOLATIONS, |
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.
Too bad this file is still .js
and not .tsx
or this mistake would've been caught earlier. The correct key is ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS
, not ONYXKEYS.TRANSACTION_VIOLATIONS
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.
Thanks for catching it. That might break this logic in LHN:
Lines 3656 to 3659 in 68e997d
// Always show IOU reports with violations | |
if (isExpenseRequest(report) && doesReportHaveViolations) { | |
return true; | |
} |
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.28-0 🚀
|
const participantPersonalDetailList: PersonalDetails[] = Object.values(OptionsListUtils.getPersonalDetailsForAccountIDs(report.participantAccountIDs ?? [], personalDetails)); | ||
const personalDetail = participantPersonalDetailList[0] ?? {}; | ||
const hasErrors = Object.keys(result.allReportErrors ?? {}).length !== 0; |
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.
Defining hasErrors
before result.allReportErrors
on line 320 resulted in the following regression, which should've ideally been caught before deploy by having more robust offline testing
Details
Fixed Issues
$ #31095
PROPOSAL:
This PR is the next installment to implement the Violations project in New Expensify. This PR adds logic that will display a Red Brick Indicator in the LHN for the parent of a report in violation. It also will add a Red Brick Indicator to the Report Preview of the report in violation.
Tests
Setup
canUseViolations
to true.Testing Steps for Workspace User and Admin
Offline tests
Same as Tests
QA Steps
Same as tests
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(themeColors.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop