-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[IOUDetailsModal] deprecate component and cleanup code #19199
[IOUDetailsModal] deprecate component and cleanup code #19199
Conversation
@luacmartins @0xmiroslav 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] |
@@ -153,7 +153,7 @@ const MoneyRequestHeader = (props) => { | |||
iouReport={props.report} | |||
onPress={(paymentType) => IOU.payMoneyRequest(paymentType, props.chatReport, props.report)} | |||
enablePaymentsRoute={ROUTES.BANK_ACCOUNT_NEW} | |||
addBankAccountRoute={ROUTES.IOU_DETAILS_ADD_BANK_ACCOUNT} |
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.
@0xmiroslav I'm not familiar with the KYC Wall flow but theoretically, this should be good as it is used in the below mentioned place as well but I'd still appreciate if you could confirm it.
addBankAccountRoute={ROUTES.IOU_SEND_ADD_BANK_ACCOUNT} |
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.
Can we use getBankAccountRoute
instead? We should pass the policyID if this is an Expense report
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.
@luacmartins why should we use getBankAccountRoute
instead? Isn't addBankAccountRoute
supposed to redirect to settings/payments/add-bank-account
page? Does bank-account/${stepToOpen}?policyID=${policyID}
automatically redirect to the add-bank-account page if none is linked?
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.
So we have two conditions here:
IOU report: redirect to settings/payments/add-bank-account
. Use SETTINGS_ADD_BANK_ACCOUNT
route
Expense report: redirect to bank-account/new?policyID=${policyID}
. Use this method
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
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.
Looking good. Left a couple comments
@@ -153,7 +153,7 @@ const MoneyRequestHeader = (props) => { | |||
iouReport={props.report} | |||
onPress={(paymentType) => IOU.payMoneyRequest(paymentType, props.chatReport, props.report)} | |||
enablePaymentsRoute={ROUTES.BANK_ACCOUNT_NEW} | |||
addBankAccountRoute={ROUTES.IOU_DETAILS_ADD_BANK_ACCOUNT} |
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.
Can we use getBankAccountRoute
instead? We should pass the policyID if this is an Expense report
@@ -142,7 +142,7 @@ const ReportPreview = (props) => { | |||
iouReport={props.iouReport} | |||
onPress={(paymentType) => IOU.payMoneyRequest(paymentType, props.chatReport, props.iouReport)} | |||
enablePaymentsRoute={ROUTES.BANK_ACCOUNT_NEW} | |||
addBankAccountRoute={ROUTES.IOU_DETAILS_ADD_BANK_ACCOUNT} | |||
addBankAccountRoute={ROUTES.IOU_SEND_ADD_BANK_ACCOUNT} |
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.
Same here, let's use getBankAccountRoute
and pass the policyID if this is a policyExpenseChat
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
@Prince-Mendiratta please fix conflict |
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
@0xmiroslav done! |
This comment was marked as resolved.
This comment was marked as resolved.
@Prince-Mendiratta let's do suggested changes and then all good. |
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
@Prince-Mendiratta bump ^ |
woops, I commited but it somehow wasn't pushed. Updated @0xmiroslav |
@@ -153,7 +153,7 @@ const MoneyRequestHeader = (props) => { | |||
iouReport={props.report} | |||
onPress={(paymentType) => IOU.payMoneyRequest(paymentType, props.chatReport, props.report)} | |||
enablePaymentsRoute={ROUTES.BANK_ACCOUNT_NEW} | |||
addBankAccountRoute={ROUTES.IOU_DETAILS_ADD_BANK_ACCOUNT} |
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.
So we have two conditions here:
IOU report: redirect to settings/payments/add-bank-account
. Use SETTINGS_ADD_BANK_ACCOUNT
route
Expense report: redirect to bank-account/new?policyID=${policyID}
. Use this method
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
@0xmiroslav @luacmartins updated the code and tests accordingly, please check it out! Here is the expected results. |
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
Reviewer Checklist
Screenshots/VideosWebweb1.movweb2.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSweb-ios.movAndroidandroid.mov |
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.
LGTM!
@luacmartins all yours!
✋ 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: 1.3.18-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.18-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.18-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.3.18-2 🚀
|
Details
With this PR, we are cleaning up code to remove the IOUDetailsModal.
Fixed Issues
$ #19167
PROPOSAL: #19167 (comment)
Tests
To test this, we already know that IOUDetailsModal is not accessible directly. To do so, we need to navigate to the URL
/iou/details/reportID/iouID
.On Web/mWeb:
/iou/details/reportID/iouID
.For an example, check out the attached video for Web.
It is not possible to test this on native & Desktop.
Another main thing this PR changes is that wherever the settlement button is present, if the user clicks on the option to settle with Bank Account and if they have not added a bank account, they will be redirected to the add bank account page depending on the IOU type. Follow these steps to test this functionality:
Offline tests
N/A
QA Steps
Same as above.
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
2023-05-18.22-27-42.mp4
Mobile Web - Chrome
2023-05-18.22-30-39.mp4
Mobile Web - Safari
2023-05-18.22-33-41.mp4
Desktop
N/A
iOS
N/A
Android
N/A