Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.79k forks source link

[$75] Migrate withReportOrNotFound from withOnyx to useOnyx #49108

Open roryabraham opened 2 weeks ago

roryabraham commented 2 weeks ago

Coming from https://expensify.slack.com/archives/C01GTK53T8Q/p1725973460005309?thread_ts=1725905735.105989&cid=C01GTK53T8Q

Migrate src/pages/home/report/withReportOrNotFound.tsx to use useOnyx instead of withOnyx.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834284536815669432
  • Upwork Job ID: 1834284536815669432
  • Last Price Increase: 2024-09-12
  • Automatic offers:
    • shubham1206agra | Reviewer | 103949135
    • Tony-MK | Contributor | 103949136
Issue OwnerCurrent Issue Owner: @shubham1206agra
melvin-bot[bot] commented 2 weeks ago

Triggered auto assignment to @JmillsExpensify (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.

melvin-bot[bot] commented 2 weeks ago

Job added to Upwork: https://www.upwork.com/jobs/~021834284536815669432

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

Upwork job price has been updated to $75

abhinaybathina commented 2 weeks ago

Proposal

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

Migrate from withOnyx HOC to useOnyx hook

What is the root cause of that problem?

withOnyx HOC is deprecated

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

Whatever props are coming from withOnyx HOC should be replaced with useOnyx hook

What alternative solutions did you explore? (Optional)

mkzie2 commented 2 weeks ago

Proposal

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

Migrate withReportOrNotFound from withOnyx to useOnyx

What is the root cause of that problem?

A new feature

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

We need to migrate the withOnyx here to use useOnyx. We also need to make sure the key we pass to useOnyx will be the collection member key to prevent the app crashes.

After using useOnyx, we can remove the type here

https://github.com/Expensify/App/blob/7748eff72fc43ecaf3db6159928d8d581a63ab99/src/pages/home/report/withReportOrNotFound.tsx#L107

What alternative solutions did you explore? (Optional)

Tony-MK commented 2 weeks ago

Proposal

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

Migrate withReportOrNotFound from withOnyx to useOnyx

What is the root cause of that problem?

Migration

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

We should replace the withOnyx HOC, shown below, with useOnyx while cleaning up withReportOrNotFound.

https://github.com/Expensify/App/blob/587698f1f4c703bab45d10056551ede97a67abe0/src/pages/home/report/withReportOrNotFound.tsx#L107-L122

roryabraham commented 2 weeks ago

Going to assign to @Tony-MK since @abhinaybathina and @mkzie2 are assigned to migrate other components. Trying to assign these out first-come-first-serve while spreading them out to as many people as I can

melvin-bot[bot] commented 2 weeks ago

📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 2 weeks ago

📣 @Tony-MK 🎉 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 📖

melvin-bot[bot] commented 2 weeks ago

@JmillsExpensify, @Tony-MK, @roryabraham, @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!

roryabraham commented 1 week ago

awaiting PR from @Tony-MK

shubham1206agra commented 1 week ago

Still waiting for PR

shubham1206agra commented 1 week ago

@Tony-MK Bump here

shubham1206agra commented 1 week ago

We are going to hold this on https://github.com/Expensify/App/pull/49238 as lint will complain about this.