Expense Report header should not show violation info#56753
Conversation
|
@ZhenjaHorbach 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] |
Reviewer Checklist
Screenshots/Videos |
|
LGTM ! |
| !!transactionThreadReportID && | ||
| (hasAllPendingRTERViolations || (shouldShowBrokenConnectionViolation && (!isPolicyAdmin(policy) || isCurrentUserSubmitter(moneyRequestReport?.reportID)))); |
There was a problem hiding this comment.
Can you add some comments please explaining what these do and why they are necessary?
There was a problem hiding this comment.
hey @rafecolton ! all these checks were initially there - i just add !!transactionThreadReportID - do you want me to add explanation for each of them?
There was a problem hiding this comment.
Yes please, it would be helpful for the next person who views this code
There was a problem hiding this comment.
@rafecolton add notes for hasAllPendingRTERViolations and shouldShowBrokenConnectionViolation
rest of them are using a lot in the code
| const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs); | ||
| const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationTransactionUtils(transactionIDs, moneyRequestReport, policy); | ||
| // Check if user should see broken connection violation warning. | ||
| const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationTransactionUtils(transactionIDs, moneyRequestReport, policy) && !!transactionThreadReportID; |
There was a problem hiding this comment.
I see you include !!transactionThreadReportID, then it is included again below in the shouldShowMarkAsCashButton assignment. Can any of that logic be simplified?
There was a problem hiding this comment.
hmm not really - there are some different flows which can be happened.
For example why we need both checks here and below
If we open expense page - !!transactionThreadReportID - will be true,
hasAllPendingRTERViolations - maybe false (because for example one transaction is already submitted and one is still pending)
shouldShowBrokenConnectionViolation - is checking if we have any violation errors - based on && condition right side !!transactionThreadReportID - will be true and left side maybe false (because no violation) - and in that case we do not need to show markAsCash button.
Generally markAsCash button should be shown in 2 cases:
- When expense page + all transaction pending violations
- When expense page - any of transaction has violation + not policy admin or current submitter
Also shouldShowBrokenConnectionViolation check a lot more in the below code - which is not related to shouldShowMarkAsCashButton
There was a problem hiding this comment.
Sounds good, thanks for explaining!
|
✋ 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/rafecolton in version: 9.0.99-0 🚀
|
|
Hi @narefyev91 We can create card expenses only using this steps, how can we receive violation problems ? |
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.99-2 🚀
|






Explanation of Change
Mark as cash button and "next steps" (Violation flow) should not appear in the expense report, should appear only in the expense page
Fixed Issues
$ #55821
PROPOSAL: #55821 (comment)
Tests
Mark as Cashbutton is not presentingOffline tests
No changes
QA Steps
Mark as Cashbutton is not presentingPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop