-
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
chore: add onDismiss handler for TaxPicker #43521
Conversation
Signed-off-by: dominictb <tb-dominic@outlook.com> Signed-off-by: dominictb <tb-dominic@outlook.com>
Signed-off-by: dominictb <tb-dominic@outlook.com>
Signed-off-by: dominictb <tb-dominic@outlook.com>
@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] |
@@ -54,9 +54,11 @@ type TaxPickerProps = TaxPickerOnyxProps & { | |||
|
|||
/** The type of IOU */ | |||
iouType?: ValueOf<typeof CONST.IOU.TYPE>; | |||
|
|||
onDismiss: () => void; |
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 think goBack
or navigateBack
name will be more correct and meaningful 😄
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.
onDismiss
is fine. It matches with onSubmit
handler name
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.
@dominictb Yeah, but in this case, we execute the goBack
action not dismiss
action. As I understand about our codebase, dismiss
action only be triggered when we want to turn off the modal or keyboard.
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 don't think it makes sense. Inside the TaxPicker, onDismiss
is an generic event. It shouldn't be specific to any action like goBack
or closeModal
.
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.
My concern about the dismiss
word 😄. It doesn't match with the implementation of this function, this function executes goBack
action
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.
goBack
is too specific. What if the TaxPicker is inside a modal and you want to dismiss
it? I think, dismiss
is a generic word referencing a generic action/event in this case, i.e Do nothing
case.
@@ -38,6 +38,10 @@ function WorkspaceTaxesSettingsForeignCurrency({ | |||
Navigation.goBack(ROUTES.WORKSPACE_TAXES_SETTINGS.getRoute(policyID)); | |||
}; | |||
|
|||
const onDismiss = () => { |
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 above
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.
update to dismiss
@@ -113,6 +113,10 @@ function IOURequestStepTaxRatePage({ | |||
navigateBack(); | |||
}; | |||
|
|||
const dismiss = () => { |
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 above
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.
It matches with submit
handler name
This code should also be removed on this PR App/src/pages/iou/request/step/IOURequestStepTaxRatePage.tsx Lines 88 to 91 in 2144fc6
|
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-06-14.at.15.15.08.movAndroid: mWeb ChromeScreen.Recording.2024-06-14.at.15.13.16.moviOS: NativeScreen.Recording.2024-06-14.at.15.14.52.moviOS: mWeb SafariScreen.Recording.2024-06-14.at.15.14.01.movMacOS: Chrome / SafariScreen.Recording.2024-06-14.at.15.09.16.movMacOS: DesktopScreen.Recording.2024-06-14.at.15.12.15.mov |
@dominictb There are some minor comments. Please address it. Everything else is fine |
Signed-off-by: dominictb <tb-dominic@outlook.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.
LGTM!
✋ 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/blimpich in version: 1.4.85-0 🚀
|
2 similar comments
🚀 Deployed to staging by https://github.com/blimpich in version: 1.4.85-0 🚀
|
🚀 Deployed to staging by https://github.com/blimpich in version: 1.4.85-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.85-7 🚀
|
Details
Add onDismiss handler for TaxPicker
Fixed Issues
$ #42854
PROPOSAL: #42854 (comment)
Tests
App will not unselect the tax rate since Workspace currency default must have a tax rate. No error happens
Offline tests
QA Steps
App will not unselect the tax rate since Workspace currency default must have a tax rate. No error happens
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
android.webm
Android: mWeb Chrome
aweb.webm
iOS: Native
ios.mp4
iOS: mWeb Safari
iosweb.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
web.mov