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:
closedchatreport: existing UI of an archived chat roomclosedexpensereport with expenses: existing UI of a completed expense report with no action requiredclosedexpensereport 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
- Go to OldDot and open the settings for the Collect/Control policy (create one first if needed)
- In the JS console with the policy open, run:
p = Policy.getCurrent();
p.policy.isPolicyExpenseChatEnabled = "true";
p.save();
- Create an open expense report (but do not add expenses to it)
- Comment on it
- In NewDot, open the report and grab its reportID from the URL
- 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:
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)
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.
Hi, @mallenexpensify it is still under discussion https://github.com/Expensify/App/pull/36767#discussion_r1504572340
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 π