-
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
Use error prop for violations for consistent styling #34303
Use error prop for violations for consistent styling #34303
Conversation
…s into errors prop of inputs
…and update brickRoadIndicatorProps
…o 32594-update-style-for-violations
…for-violations # Conflicts: # src/components/ReportActionItem/MoneyRequestView.js # src/libs/ReportUtils.ts # src/libs/SidebarUtils.ts # src/pages/home/sidebar/SidebarLinksData.js
…for-violations # Conflicts: # src/libs/ReportUtils.ts # src/libs/SidebarUtils.ts
@dubielzyk-expensify @cubuspl42 One of you needs to 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] |
@cead22 -- This is ready to go! |
Merged in latest main and it seems to have fixed the failing performance test. |
I'm not sure what is going on, tbh. I've not been able to reproduce anything like this here and I had a teammember run through the instructions and it worked fine as well so we're kind of stuck without some more data to go on, as I don't have access to the back-end. Can you log some of the data and post it here so we can take a look to try and identify what is going wrong? The value of the Also look at the report/transaction etc in the onyx DB and see if they appear to be well-formed. Maybe there is something weird there. It might also be worth trying from the start with a fresh policy, now that your accounts have been authorized. And delete/clear out your local onyx db in case something has gotten corrupted in there. |
I think it's possible everything is working correctly, but if you can share the workspace IDs you're using, and maybe more specifically what you think it's not working, I can confirm. For the things that look strange there
|
I don't want to block this PR. I'll go through all the tests and let you decide whether the videos' results are correct. |
Feel free to ask any questions and I'll be happy to add clarity where I can, I know there's a lot of moving parts and some non-obvious things like implicit categorization that makes things confusing |
Awesome! Glad we got all that sorted. Let me look into the scanning one. |
Yes, when users input the data being scanned manually, the request looks like it's not scanning, but I believe we continue the scan in the background. Is the violation showing now?
Can you share more details about this, are you pointing to a specific error or problem with the PR? Sorry if I'm missing something obvious, I'm just trying to figure out if things are working correctly, and so far it seems like they are |
I think I've figured it out -- the That I've removed section D from the test instructions, and I think we are now passing all tests. Just need to merge in main to fix the lint error and we are good. |
Awesome sauce! |
Main is merged, and now comes the time of anxious waiting for the CI checks to complete. |
Am I crazy or is the check for the reviewer checklist missing? |
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.
(just for testing checks)
Is reviewer checklist missing
Reviewer Checklist
Screenshots/VideosAndroid: Nativeviolations-android-compressed.mp4Android: mWeb Chromeviolations-android-web-compressed.mp4iOS: Nativeviolations-ios-compressed.mp4iOS: mWeb Safariviolations-ios-web-compressed.mp4MacOS: Chrome / SafariA. a-first-money-request.mp4B. b-changes-to-show-category-violations.mp4C. c-changes-to-clear-violations.mp4 |
…for-violations # Conflicts: # src/components/ReportActionItem/MoneyRequestView.tsx
Merged main and resovled conflict. |
So close! |
Yeah I just wanted to test dekstop becasue I didn't see screenshots/videos in the reviewer checklist. I added them now |
✋ 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 production by https://github.com/thienlnam in version: 1.4.41-12 🚀
|
Details
Initially error messages for violations were added as a component under the input. This resulted in odd spacing and behaviour inconsistent with other inputs in the application.
This PR moves the error messages into the
error
prop of the input where it is available.Because the logic for seelcting which error message to display was getting complicated, I gathered it into a
getErrorForField
function.I also included the fix for #34773 since it was small and related.
Important
Due to an issue outside the scope of this PR, violations will not appear immediately on some fields.
To get them to update you will need to browse away from the
MoneyRequestView
and back, as that will trigger the necessary update.This issue should be solved soon -- it may even be solved before you read this! So if all the expected violations appear immediately in your tests, you can to safely ignore the instructions to browse away and back.
Fixed Issues
$ #33527
$ #34773
Tests
Create a workspace and enable violations for the policy.
Important
All accounts used in this test need to have the Violations beta enabled in the back end in order to receive the correct violations. Ask @cead22 if you need to get accounts added to the beta.
Turn on the Violations beta (or set
canUseViolations
to true)Go to OldDot and open or create a Control policy
Enable violations for the workspace in Settings > [Workspace] > Expenses
Set up requirements that will a violation on every field:
Enable the policy’s expense chat:
Go to the policy page
In the JS console with the policy open do:
Invite an employee to the policy
Return to New Dot
Sign into the employee account you just added to the policy
A. First Money Request
As the employee go through the money request flow, create the following money request under that policy:
Request 1
Click another option in the LHN, then browse back to the
MoneyRequestView
and and check that the errors in the table below are shown.Note
A refresh alone will not be enough to get the violations to appear. You will need to browse to another chat and then back to the money request to get the violations to show. (Local processing for violations is being added in a separate PR).
(note: "0 days" is a backend bug, but an issue has been opened to address it)
B. Changes to show category violations
Update the money to:
Click another option in the LHN, then browse back to
MoneyRequestView
and check that the errors in the table below are shown.Note
Violations will not show until you browse away and come back.
Note
Errors from previous step will still be visible.
C. Changes to clear violations
Update the money to:
Click another option in the LHN, then browse back to the
MoneyRequestView
and check that violation messages are NOT shown onamount
,category
,description
, andtag
fields.Note
Violations will not be cleared until you browse away and come back.
Note
The receipt field will still show a violation.
Offline tests
This will not work offline yet, as we are waiting for local processing of violations to be added in a separate PR.
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectionproduction API to ensure there are no regressions (e.g. long loading states that impact usability).
toggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and usingthe translation method
Link to Slack message:
the localization methods
should be capitalized), and is approved by marketing by adding the
Waiting for Copy
label for a copy review on the original GH to get the correct copy.index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are workingas expected)
i.e.
StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)blocks, quotes, headings, bold, strikethrough, and italic.
like
Avatar
is modified, I verified thatAvatar
is working as expected in all cases)out account.
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
A. First Money Request
B. Changes to show category violations
C. Changes to clear violations
D. Check receipt violations
Android: mWeb Chrome
A. First Money Request
B. Changes to show category violations
C. Changes to clear violations
D. Check receipt violations
iOS: Native
A. First Money Request
B. Changes to show category violations
C. Changes to clear violations
D. Check receipt violations
iOS: mWeb Safari
A. First Money Request
B. Changes to show category violations
C. Changes to clear violations
D. Check receipt violations
MacOS: Chrome / Safari
A. First Money Request
B. Changes to show category violations
C. Changes to clear violations
D. Check receipt violations
MacOS: Desktop
A. First Money Request
B. Changes to show category violations
C. Changes to clear violations
D. Check receipt violations