-
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
Add confirmation prompt when approving held request via report preview #42896
Conversation
@DylanDylann 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] |
} | ||
}; | ||
|
||
const confirmApproval = () => { |
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.
Should we create a utility function to avoid code repetition?
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.
In this these function, we also have logic to set state of the component so we shouldn't create a util for this.
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.
we also have logic to set state of the component so we shouldn't create a util for this.
Do you mean we shouldn't pass setIsHoldMenuVisible,... to the util function? Could you explain more why we shouldn't do that
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.
I mean we shouldn't create a util function for this case since this function also controls the state of a component.
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.
And Since we only use this logic for report preview and MoneyReportHeader
, the duplicate is acceptable.
src/CONST.ts
Outdated
@@ -1552,6 +1552,10 @@ const CONST = { | |||
CATEGORIZE: 'categorize', | |||
SHARE: 'share', | |||
}, | |||
ACTION_TYPE: { |
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.
@nkdengineer IMO, we don't need to create a new type here. Let's reuse REPORT_ACTION_TYPE and create a new type PreviewPaymentMethodType like this
type PreviewPaymentMethodType = DeepValueOf<typeof CONST.IOU.REPORT_ACTION_TYPE.PAY | typeof CONST.IOU.REPORT_ACTION_TYPE.APPROVE>;
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.
@DylanDylann I updated.
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-06-05.at.14.10.47.movAndroid: mWeb ChromeScreen.Recording.2024-06-05.at.14.09.25.moviOS: NativeScreen.Recording.2024-06-05.at.14.09.49.moviOS: mWeb SafariScreen.Recording.2024-06-05.at.14.08.46.movMacOS: Chrome / SafariScreen.Recording.2024-06-05.at.14.08.03.movMacOS: DesktopScreen.Recording.2024-06-05.at.14.07.07.mov |
@nkdengineer Please merge the latest main |
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.
Look good
@DylanDylann Merged the latest main. |
@bondydaa Please help to review the PR when you have a chance. Thanks. |
✋ 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/bondydaa in version: 1.4.82-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.82-4 🚀
|
Details
Add confirmation prompt when approving held request via report preview
Fixed Issues
$ #39335
PROPOSAL: #39335 (comment)
Tests
Precondition: Workspace enabled approval
Offline tests
Same as above
QA Steps
Precondition: Workspace enabled approval
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
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
Screen.Recording.2024-05-31.at.12.16.58.mov
Android: mWeb Chrome
Screen.Recording.2024-05-31.at.12.16.39.mov
iOS: Native
Screen.Recording.2024-05-31.at.12.19.29.mov
iOS: mWeb Safari
Screen.Recording.2024-05-31.at.12.18.28.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-31.at.12.10.35.mov
MacOS: Desktop
Screen.Recording.2024-05-31.at.12.20.51.mov