-
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
[$250] Migrate MoneyRequestConfirmationList to useOnyx #50532
Comments
Triggered auto assignment to @abekkala ( |
Job added to Upwork: https://www.upwork.com/jobs/~021844152421070937252 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.We are trying to migrate the MoneyRequestConfirmationList component from using the withOnyx HOC to the useOnyx hook. What is the root cause of that problem?The current implementation uses withOnyx, which is an older pattern for connecting components to Onyx data. What changes do you think we should make in order to solve the problem?In this file:
App/src/components/MoneyRequestConfirmationList.tsx Lines 978 to 983 in bfdd19b
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Migrate MoneyRequestConfirmationList to useOnyx What is the root cause of that problem?N/A What changes do you think we should make in order to solve the problem?Change from withOnyx here: App/src/components/MoneyRequestConfirmationList.tsx Lines 978 to 1008 in bfdd19b
to useOnyx: const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID || '-1'}`);
const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${policyID || '-1'}`);
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID || '-1'}`);
const [defaultMileageRate] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID || '-1'}`, {
selector: DistanceRequestUtils.getDefaultMileageRate,
});
const [mileageRatesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID || '-1'}`, {
selector: (policy: OnyxEntry<OnyxTypes.Policy>) => DistanceRequestUtils.getMileageRates(policy),
});
const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID || '-1'}`);
const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID || '-1'}`);
const [lastSelectedDistanceRates] = useOnyx(ONYXKEYS.NVP_LAST_SELECTED_DISTANCE_RATES);
const [currencyList] = useOnyx(ONYXKEYS.CURRENCY_LIST); And remove the
App/src/components/MoneyRequestConfirmationList.tsx Lines 53 to 57 in bfdd19b
And the parameters from the function App/src/components/MoneyRequestConfirmationList.tsx Lines 1038 to 1039 in bfdd19b
What alternative solutions did you explore? (Optional) |
Triggered auto assignment to @anmurali ( |
@anmurali I'll be ooo until Mon Oct 21; then I can take this back. STATUS: proposals have been posted, waiting on one to be chosen |
@abekkala, @anmurali, @neil-marcellini, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
I like @NJ-2020's proposal best so far since it's sufficiently detailed while the one before it was not quite detailed enough. Hiring! @shubham1206agra please try to review proposals more promptly next time or re-assign. |
📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @NJ-2020 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR ready cc: @shubham1206agra |
I'm back from ooo - unassinging @anmurali |
PR not yet deployed Fix: @NJ-2020 |
Problem
In this PR I made some changes to MoneyRequestConfirmationList, which trigged the ESLint changed files check to error saying that we need to migrate withOnyx to useOnyx
Solution migrate to useOnyx
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @shubham1206agraThe text was updated successfully, but these errors were encountered: