App: [HOLD for payment 2024-03-19] [$500] [CRITICAL] [Backwards Compatibility] Update UI for closed expense reports with no expenses

Problem

When a report is deleted in OldDot, it is currently hard-deleted, along with any comments on the report. As we move to a chat-centric NewDot, it will be more common to have reports with a comment history, and losing that context upon report deletion would be confusing for participants.

Solution

For reports with comments, we will update the backend (internal ref: https://github.com/Expensify/Expensify/issues/350244) to instead soft-delete the report, putting its statusNum to 2 (CLOSED). Note that reports without comments will still be hard-deleted.

On the front end, we need to update the UI so that the report preview shows [Deleted report] (similar to how we show [Deleted request] or [Deleted message] in other scenarios) and the report can still be commented on.

So for reference, the three UI states for a closed report, depending on a combo of the report’s type and number of expenses, would be:

  1. closed chat report: existing UI of an archived chat room
  2. closed expense report with expenses: existing UI of a completed expense report with no action required
  3. closed expense report with no expenses: (what we’re building here) an archived expense report, which only exists to house comment history (and can still be commented on)

Setup/Reproduction steps

  1. Go to OldDot and open the settings for the Collect/Control policy (create one first if needed)
  2. In the JS console with the policy open, run:
p = Policy.getCurrent();
p.policy.isPolicyExpenseChatEnabled = "true";
p.save();
  1. Create an open expense report (but do not add expenses to it)
  2. Comment on it
  3. In NewDot, open the report and grab its reportID from the URL
  4. In the console, run:
window.Onyx.merge(`report_<myReportID>`, {
    statusNum: 2,
});

(or put this in a useEffect hook in a component)

Feature implementation requirements

  • Report preview in the workspace chat should render [Deleted report]
  • Option row in the LHN should render [Deleted report] as appropriate
  • The expense report should render according to this mock: deleted-report-mock
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0105da3eb4f9af3f30
  • Upwork Job ID: 1756061610101006336
  • Last Price Increase: 2024-02-09
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 0
    • rayane-djouah | Contributor | 0

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 34 (25 by maintainers)

Most upvoted comments

Awesome, this PR is ready to go to staging.

@mallenexpensify – thanks for your help here, I’m taking this one back as the BZ member at this party.

Thank you! Will raise a PR tomorrow.

πŸ“£ @rayane-djouah πŸŽ‰ 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 πŸ“–