Open neil-marcellini opened 2 weeks ago
Triggered auto assignment to @abekkala (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Job added to Upwork: https://www.upwork.com/jobs/~021844152421070937252
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External
)
We are trying to migrate the MoneyRequestConfirmationList component from using the withOnyx HOC to the useOnyx hook.
The current implementation uses withOnyx, which is an older pattern for connecting components to Onyx data.
Migrate MoneyRequestConfirmationList to useOnyx
N/A
Change from withOnyx here: https://github.com/Expensify/App/blob/bfdd19ba851376b012fbcee112637414736a0fbd/src/components/MoneyRequestConfirmationList.tsx#L978-L1008 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 MoneyRequestConfirmationListOnyxProps
type
https://github.com/Expensify/App/blob/bfdd19ba851376b012fbcee112637414736a0fbd/src/components/MoneyRequestConfirmationList.tsx#L82
https://github.com/Expensify/App/blob/bfdd19ba851376b012fbcee112637414736a0fbd/src/components/MoneyRequestConfirmationList.tsx#L53-L57
And the parameters from the function And also remove this https://github.com/Expensify/App/blob/bfdd19ba851376b012fbcee112637414736a0fbd/src/components/MoneyRequestConfirmationList.tsx#L1038-L1039 https://github.com/Expensify/App/blob/bfdd19ba851376b012fbcee112637414736a0fbd/src/components/MoneyRequestConfirmationList.tsx#L1041
Triggered auto assignment to @anmurali (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@anmurali I'll be ooo until Mon Oct 21; then I can take this back.
@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 Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
PR ready
cc: @shubham1206agra
I'm back from ooo - unassinging @anmurali
PR not yet deployed
Fix: @NJ-2020 PR Review: @shubham1206agra
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: @shubham1206agra