Skip to content

Remove ReportActionsUtils.getParentReportAction(), ReportUtils.getParentReport(), TransactionUtils.getLinkedTransaction(), ReportUtils.getPolicy(), and TransactionUtils.getTransaction() #27262

Closed

Description

@tgolen

Problem

These methods are anti-patterns because they are most always used for loading data into a component without using withOnyx(). This breaks the data flow of a react application. (data is coming from somewhere that is not props or state and cannot be debugged in react dev tools).

Solution

Switch all references to properly use withOnyx() for components and connect() for libs.

Components

Libs

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0156f7187832f56740
  • Upwork Job ID: 1762552955483959296
  • Last Price Increase: 2024-02-27

Activity

  1. self-assigned this
    on Sep 12, 2023
  2. changed the title [-]Remove ReportActionsUtils.getParentReportAction() and TransactionUtils.getLinkedTransaction()[/-] [+]Remove ReportActionsUtils.getParentReportAction(), TransactionUtils.getLinkedTransaction(), and TransactionUtils.getTransaction()[/+] on Sep 12, 2023
  3. techievivek commented on Sep 15, 2023

    @techievivek
    Contributor
  4. 58 remaining items

  5. tgolen commented on Mar 29, 2024

    @tgolen
    ContributorAuthor

    Weekly Update

    • I have been created contributor issues to handle the remaining items and they are moving forward

    Next Steps

    • Do a final cleanup of ReportUtils once all the current issues are done

    ETA

    • All done by April 9
  6. tgolen commented on Apr 12, 2024

    @tgolen
    ContributorAuthor

    Weekly Update

    • There were three PRs created last week for most of the remaining items

    Next Steps

    • Once all PRs are merged, @tgolen take one last look at ReportUtils and make sure it is not exporting anything "bad", then this issue can be closed

    ETA

    • This is bleeding into next week due to slow PR reviews, so updated ETA is Wednesday, April 17.
  7. tgolen commented on May 3, 2024

    @tgolen
    ContributorAuthor

    Weekly Update

    • There is one final PR that is waiting to close out, then this can be closed.
    • I haven't found any more bad instances

    Next Steps

    • Wait for this PR to be merged and then close this out

    ETA

    • It looks like it might be merged next week sometime.
  8. tgolen commented on May 10, 2024

    @tgolen
    ContributorAuthor

    Weekly Update

    • Same as last week
  9. tgolen commented on May 17, 2024

    @tgolen
    ContributorAuthor

    Weekly Update

    • I bumped the PR that is holding this up. The contributor hasn't updated it in a couple of weeks now.
  10. melvin-bot commented on Jun 10, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @tgolen eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  11. tgolen commented on Jul 26, 2024

    @tgolen
    ContributorAuthor

    ReportUtils is the only remaining item, but I took a look at it and I think it's mostly fine for now so I am going to close this out.

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

Metadata

Metadata

Assignees

Labels

InternalRequires API changes or must be handled by Expensify staffMonthlyKSv2Task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions