Hold and Reject Role based Modal updates#74505
Conversation
…old-modal-refactor
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
src/components/MoneyReportHeader.tsx
Outdated
| const [isDownloadErrorModalVisible, setIsDownloadErrorModalVisible] = useState(false); | ||
| const [isRejectEducationalModalVisible, setIsRejectEducationalModalVisible] = useState(false); | ||
| const [isHoldEducationalModalVisible, setIsHoldEducationalModalVisible] = useState(false); | ||
| const [rejectModalAction, setRejectModalAction] = useState<'hold' | 'reject' | null>(null); |
There was a problem hiding this comment.
I think we should use CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD|CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT here instead of 'hold' | 'reject'
There was a problem hiding this comment.
I did try to use the CONST but I was getting type errors. I tried ValueOf and a few other things but those were giving lint errors.
There was a problem hiding this comment.
I think you can do something like
const [rejectModalAction, setRejectModalAction] = useState<ValueOf<typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD | typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT> | null>(null);
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #63363 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
src/components/MoneyReportHeader.tsx
Outdated
| const [isDownloadErrorModalVisible, setIsDownloadErrorModalVisible] = useState(false); | ||
| const [isRejectEducationalModalVisible, setIsRejectEducationalModalVisible] = useState(false); | ||
| const [isHoldEducationalModalVisible, setIsHoldEducationalModalVisible] = useState(false); | ||
| const [rejectModalAction, setRejectModalAction] = useState<'hold' | 'reject' | null>(null); |
There was a problem hiding this comment.
I think you can do something like
const [rejectModalAction, setRejectModalAction] = useState<ValueOf<typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD | typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT> | null>(null);
|
@mananjadhav can you please address the comment above? |
|
@luacmartins updated. |
|
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🤔 checks were passing when I merged |
|
✋ 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/luacmartins in version: 9.2.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.58-3 🚀
|
| {!!isHoldEducationalModalVisible && ( | ||
| <HoldSubmitterEducationalModal | ||
| onClose={dismissModalAndUpdateUseHold} | ||
| onConfirm={dismissModalAndUpdateUseHold} |
There was a problem hiding this comment.
This PR added the HoldOrRejectEducationalModal and dismissedRejectUseExplanation check to MoneyReportHeader.tsx and MoneyRequestHeader.tsx but missed adding the same logic to MoneyRequestReportActionsList.tsx, which handles the reject flow on narrow screens. It caused this issue and was fixed in this PR.
There was a problem hiding this comment.
Thanks for highlighting.
Explanation of Change
Fixed Issues
$ #63363
PROPOSAL: N/A
Tests
1. Submitter View
Precondition:
nvp_dismissedHoldUseExplanationis not set in the account.Test:
nvp_dismissedHoldUseExplanationset to true.2. Approver View: Hold
Precondition:
nvp_dismissedRejectUseExplanationis not set in the account.Test:
nvp_dismissedRejectUseExplanationset to true.3. Approver View: Reject
Precondition:
nvp_dismissedRejectUseExplanationis not set in the account.Test:
nvp_dismissedRejectUseExplanationset to true.Offline tests
Same as Test Steps
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as Test Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Submitter: Hold Modal
android-hold.mov
Approver: Hold vs Reject Modal
android-hold-vs-reject.mov
Android: mWeb Chrome
Submitter: Hold Modal
Approver: Hold vs Reject Modal
iOS: Native
iOS: mWeb Safari
Submitter: Hold Modal
Approver: Hold vs Reject Modal
MacOS: Chrome / Safari
Submitter: Hold Modal
web-hold-modal.mov
Approver: Hold vs Reject Modal
web-hold-vs-reject-modal.mov
**Note: ** For my test I added some dummy code to reset the NVP on View Details, so that I can show the modal twice in the same video.
MacOS: Desktop
Submitter: Hold Modal
desktop-hold.mov
Approver: Hold vs Reject Modal
desktop-hold-vs-reject.mov