-
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
cleanup: refactor TaxOptions to their own utils #52309
cleanup: refactor TaxOptions to their own utils #52309
Conversation
@justinpersaud 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] |
Adding @ahmedGaber93 from the linked issue too |
src/libs/OptionsListUtils.ts
Outdated
@@ -1747,7 +1606,6 @@ function getOptions( | |||
currentUserOption: null, | |||
categoryOptions, | |||
tagOptions: [], | |||
taxRatesOptions: [], |
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.
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.
ah thats a good catch thanks, will remove those as well!
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.
Great! I think you missed to removed categoryOptions: [],
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.
Ah, i wanted to remove those in the separate category PR, will do that over there!
Reviewer Checklist
Screenshots/VideosAndroid: Nativea.mp4Android: mWeb Chromeaw.mp4iOS: Nativei.mp4iOS: mWeb Safariiw.mp4MacOS: Chrome / Safariw.mp4MacOS: Desktopd.mp4 |
🎯 @ahmedGaber93, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #52695. |
✋ 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/justinpersaud in version: 9.0.64-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.0.64-4 🚀
|
Explanation of Change
While working on performance fixes for the search over at this PR I touched the
OptionListUtils
a lot, specifically thegetOptions
andfilterOptions
functions.It occurs to me that the
getOptions
function became a god-function that serves a lot of different use-cases, has a lot of responsibilities and is quite coupled with a lot of other places in the code. The wholeOptionListUtils
is over 2.5k lines long and hard to understand.Right in the beginning of the
getOptions
function there are a few early return statements for certain cases. My plan is to refactor all those use-cases out into their own functions, as there is no use in adding aincludeXYC
parameter togetOptions
just to do:In this PR we moves the Taxes to their own
TaxOptionsListUtils
.Related to:
Fixed Issues
$ #51954
PROPOSAL: #51954 (comment)
Tests
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
CleanShot.2024-11-11.at.13.59.34.mp4
Android: mWeb Chrome
CleanShot.2024-11-11.at.13.59.34.mp4
iOS: Native
CleanShot.2024-11-11.at.13.59.34.mp4
iOS: mWeb Safari
CleanShot.2024-11-11.at.13.59.34.mp4
MacOS: Chrome / Safari
CleanShot.2024-11-11.at.13.59.34.mp4
MacOS: Desktop
CleanShot.2024-11-11.at.13.59.34.mp4