-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[HOLD for payment 2024-10-25] [$250] Migrate IOURequestStepDistanceRate to useOnyx #50334
Comments
Job added to Upwork: https://www.upwork.com/jobs/~021843307064145973750 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane ( |
Triggered auto assignment to @abekkala ( |
Can I work on it ? |
I'd love to work on this issue. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Migrate IOURequestStepDistanceRate to useOnyx What is the root cause of that problem?This is a migration What changes do you think we should make in order to solve the problem?Remove
App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx Lines 136 to 150 in 78e484f
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Migrate What is the root cause of that problem?N/A feature request What changes do you think we should make in order to solve the problem?
const IOURequestStepDistanceRateWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepDistanceRate); Then remove the And then finally get the values of --- a/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
+++ b/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import type {OnyxEntry} from 'react-native-onyx';
-import {useOnyx, withOnyx} from 'react-native-onyx';
+import {useOnyx} from 'react-native-onyx';
@@ -23,38 +23,27 @@ import withFullTransactionOrNotFound from './withFullTransactionOrNotFound';
import type {WithWritableReportOrNotFoundProps} from './withWritableReportOrNotFound';
import withWritableReportOrNotFound from './withWritableReportOrNotFound';
-type IOURequestStepDistanceRateOnyxProps = {
- /** Policy details */
- policy: OnyxEntry<OnyxTypes.Policy>;
- /** Collection of categories attached to the policy */
- policyCategories: OnyxEntry<OnyxTypes.PolicyCategories>;
-
- /** Collection of tags attached to the policy */
- policyTags: OnyxEntry<OnyxTypes.PolicyTagLists>;
-};
-
-type IOURequestStepDistanceRateProps = IOURequestStepDistanceRateOnyxProps &
- WithWritableReportOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.STEP_DISTANCE_RATE> & {
+type IOURequestStepDistanceRateProps = WithWritableReportOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.STEP_DISTANCE_RATE> & {
function IOURequestStepDistanceRate({
- policy: policyReal,
report,
reportDraft,
route: {
params: {action, reportID, backTo, transactionID},
},
transaction,
- policyTags,
- policyCategories,
}: IOURequestStepDistanceRateProps) {
const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${IOU.getIOURequestPolicyID(transaction, reportDraft) ?? '-1'}`);
-
+ const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report?.policyID ?? '0'}`)
+ const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${report?.policyID ?? '0'}`)
+ const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID ?? '-1'}`)
const policy = policyReal ?? policyDraft;
+
@@ -133,20 +122,9 @@ function IOURequestStepDistanceRate({
IOURequestStepDistanceRate.displayName = 'IOURequestStepDistanceRate';
-const IOURequestStepDistanceRateWithOnyx = withOnyx<IOURequestStepDistanceRateProps, IOURequestStepDistanceRateOnyxProps>({
- policy: {
- key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '-1'}`,
- },
- policyCategories: {
- key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report ? report.policyID : '0'}`,
- },
- policyTags: {
- key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_TAGS}${report ? report.policyID : '0'}`,
- },
-})(IOURequestStepDistanceRate);
// eslint-disable-next-line rulesdir/no-negated-variables
-const IOURequestStepDistanceRateWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepDistanceRateWithOnyx);
+const IOURequestStepDistanceRateWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepDistanceRate);
What alternative solutions did you explore? (Optional) |
Looks like @mkzie2 posted the first sufficient proposal, so I'm hiring him to get this moving. Thanks! |
📣 @mkzie2 You have been assigned to this job! |
@mkzie2 feel free to raise a PR |
Triggered auto assignment to @isabelastisser ( |
@isabelastisser I'll be ooo until Mon Oct 21 STATUS: PR created but not deployed to prod yetPayment Summary [date, TBD]:
|
@abekkala, @neil-marcellini, @rushatgabhane, @isabelastisser, @mkzie2 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-10-25. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
I'm back from ooo - unassigning @isabelastisser |
Payment Summary OCT 25
|
Not a bug. Checklist not needed. Migration was planned as part of PR - #50001 (comment) |
@mkzie2 payment sent and contract ended - thank you! 🎉 |
$250 approved for @rushatgabhane |
Problem
Coming from this PR, there's a warning that withOnyx is deprecated and we should migrate this component to useOnyx
Solution
Do the migration
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @abekkala / @isabelastisserThe text was updated successfully, but these errors were encountered: