Skip to content

[Pay 4/29][$250] Remove NewDistanceRequestPage.js and copy any changes since Nov 27 into IOURequestStepDistance.js #34610

Closed

Description

@tgolen

Held on #34613

This is a part of #29107. You can look at that issue for more context behind the cleanup process.

Problem

The app has two redundant components:

Old Component: NewDistanceRequestPage
New Component IOURequestStepDistance

Solution

Following the examples (example 1, example 2), the Old Component needs to be completely removed from the codebase

  1. Look at the history of the Old Component
  2. If there are any changes since Nov 27, 2023 which have not been added to the New Component, copy those changes
  3. Replace all uses of the Old Component with the New Component
  4. Remove all traces of Old Component
  5. Be sure to update all routes and navigation to use the new :action param (instead of being hard-coded with "create")
  6. Update any logic like isEditing to use the new action param from the route
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f10eeacf3fc8d218
  • Upwork Job ID: 1747632624829898752
  • Last Price Increase: 2024-01-17
  • Automatic offers:
    • cubuspl42 | Reviewer | 28115391
    • DylanDylann | Contributor | 28115392

Activity

  1. added
    Help WantedApply this label when an issue is open to proposals by contributors
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 16, 2024
  2. melvin-bot commented on Jan 16, 2024

    @melvin-bot

    Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. KrAbhas commented on Jan 16, 2024

    @KrAbhas
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Remove NewDistanceRequestPage.js and copy any changes since Nov 27 into IOURequestStepDistance.js

    What is the root cause of that problem?

    Refactoring
 of navigation among screens for NewDistanceRequestPage

    What changes do you think we should make in order

    We will be deleting the component here:

    function NewDistanceRequestPage({iou, report, route}) {

    We will remove the screen from ModalStackNavigators.tsx

  4. njmulsqb commented on Jan 17, 2024

    @njmulsqb

    I would love to take this!

  5. DylanDylann commented on Jan 17, 2024

    @DylanDylann
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Remove NewDistanceRequestPage.js and copy any changes since Nov 27 into IOURequestStepDistance.js

    What is the root cause of that problem?

    Remove deprecated component

    What changes do you think we should make in order to solve the problem?

    1. Currently, we only use NewDistanceRequestPage in the MoneyRequestSelectorPage but MoneyRequestSelectorPage also be removed in this issue. So that we can remove NewDistanceRequestPage component and all traces like

    [SCREENS.MONEY_REQUEST.DISTANCE]: () => require('../../../pages/iou/NewDistanceRequestPage').default as React.ComponentType,

    [SCREENS.MONEY_REQUEST.DISTANCE]: ROUTES.MONEY_REQUEST_DISTANCE.route,

    App/src/ROUTES.ts

    Lines 293 to 296 in a2f5bd5

    MONEY_REQUEST_DISTANCE: {
    route: ':iouType/new/address/:reportID?',
    getRoute: (iouType: string, reportID = '') => `${iouType}/new/address/${reportID}` as const,
    },

    DISTANCE: 'Money_Request_Distance',

    [SCREENS.MONEY_REQUEST.DISTANCE]: {
    iouType: ValueOf<typeof CONST.IOU.TYPE>;
    reportID: string;
    };

    1. For new component IOURequestStepDistance.

    In here

    App/src/ROUTES.ts

    Lines 347 to 351 in a2f5bd5

    MONEY_REQUEST_STEP_DISTANCE: {
    route: 'create/:iouType/distance/:transactionID/:reportID',
    getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
    getUrlWithBackToParam(`create/${iouType}/distance/${transactionID}/${reportID}`, backTo),
    },

    We need to use the new :action param (instead of being hard-coded with "create") like we did here

    App/src/ROUTES.ts

    Lines 362 to 366 in a2f5bd5

    MONEY_REQUEST_STEP_SCAN: {
    route: ':action/:iouType/scan/:transactionID/:reportID',
    getRoute: (action: ValueOf<typeof CONST.IOU.ACTION>, iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
    getUrlWithBackToParam(`${action}/${iouType}/scan/${transactionID}/${reportID}`, backTo),
    },

    1. Copy changes since 27 Nov to new components based on list commit here: https://github.com/Expensify/App/commits/main/src/pages/iou/NewDistanceRequestPage.js

    What alternative solutions did you explore? (Optional)

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 17, 2024
  7. changed the title [-]Remove NewDistanceRequestPage.js and copy any changes since Nov 27 into IOURequestStepDistance.js[/-] [+][$500] Remove NewDistanceRequestPage.js and copy any changes since Nov 27 into IOURequestStepDistance.js[/+] on Jan 17, 2024
  8. melvin-bot commented on Jan 17, 2024

    @melvin-bot
  9. melvin-bot commented on Jan 17, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (External)

  10. MahmudjonToraqulov commented on Jan 17, 2024

    @MahmudjonToraqulov
    Contributor

    I would love to take this!

  11. 67 remaining items

  12. melvin-bot commented on Apr 24, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

  13. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 24, 2024
  14. mallenexpensify commented on Apr 24, 2024

    @mallenexpensify
    Contributor

    @eVoloshchak reassigning, please take over as C+. If you don't have bandwidth, unassign yourself. Thanks
    @DylanDylann can you please post an update on where we're at and what @eVoloshchak needs to help with?

  15. DylanDylann commented on Apr 24, 2024

    @DylanDylann
    Contributor

    @mallenexpensify Everything is done here, waiting for payment

  16. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Apr 25, 2024
  17. changed the title [-][$250] Remove NewDistanceRequestPage.js and copy any changes since Nov 27 into IOURequestStepDistance.js[/-] [+][Pay 4/29][$250] Remove NewDistanceRequestPage.js and copy any changes since Nov 27 into IOURequestStepDistance.js[/+] on Apr 25, 2024
  18. mallenexpensify commented on Apr 25, 2024

    @mallenexpensify
    Contributor

    Thanks @DylanDylann , removed Reviewing, added Awaiting Payment and updated the title to reflect payment date.

  19. added and removed on May 2, 2024
  20. mallenexpensify commented on May 3, 2024

    @mallenexpensify
    Contributor

    Contributor: @DylanDylann paid $250 via Upwork
    Contributor+: @cubuspl42 paid $250 via Upwork

    Doesn't look like this needs a regression test created, comment if anyone disagrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions