-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2024-03-19] [$500] [CRITICAL] [Backwards Compatibility] Update UI for closed expense reports with no expenses #36190
Comments
Triggered auto assignment to @alexpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~0105da3eb4f9af3f30 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Update UI for closed expense reports with no expenses. What is the root cause of that problem?This is a new feature. What changes do you think we should make in order to solve the problem?First, we should add an isDeletedReport function in https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts function isDeletedReport(report: OnyxEntry<Report>): boolean {
return report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED && report?.stateNum === CONST.REPORT.STATE_NUM.OPEN;
} To make the report preview in the workspace chat render [Deleted report] we should add the below condition here. if (ReportUtils.isDeletedReport(ReportUtils.getReport(ReportActionsUtils.getIOUReportIDFromReportActionPreview(props.action) ?? ''))){
children = (
<ReportPreview
...
/>
);
}else{
children = (
<RenderHTML html={`<comment>${translate('parentReportAction.deletedReport')}</comment>`} />
);
} To make the option row in the LHN render [Deleted report] we should add the below code here if (isDeletedReport(report)) {
return translate('parentReportAction.deletedReport');
} We should add translations for To make the expense report render according to the mock:
we should add here the below condition: <View style={[StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth, true)]}>
{!isDeletedReport(report) &&
<>
//content
</>
}
</View>
const shouldShowNextStep = !ReportUtils.isDeletedReport(moneyRequestReport) && isFromPaidPolicy && !!nextStep?.message?.length;
if(isDeletedReport(report)){
return [workspaceIcon];
} and add here this: if(isDeletedReport(report)){
return [workspaceIcon];
} and add here this: if(isDeletedReport(report)){
return [managerIcon];
} and we should adjust the condition here to: const displayAllActors = useMemo(() => action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && iouReport && !ReportUtils.isDeletedReport(iouReport), [action.actionName, iouReport]); Result: delete.reportRecording.2024-02-10.015537.mp4deleted.report.Recording.2024-02-10.020230.mp4What alternative solutions did you explore? (Optional)N/A |
@abdulrahuman5196 could you review the above proposal please? |
bump @abdulrahuman5196 |
Hi, @greg-schroeder sorry I haven't looked into this yet. Will work on review today. |
Reviewing now |
Meanwhile questions on the usecase I have?
Does this mean settled expenses? I am unable to delete a approved report in oldDot also currently. Only able to delete expense report in processing state Is this usecase only for transition of oldDot to newDot? Could you kindly provide information on how this |
Anyways I don't want to block the proposal review phase on the above questions. Since the proposal is to do a straightforward implementation after the The proposal by @rayane-djouah here looks good #36190 (comment) and has good amount of information/cases to implement the feature. We can do through testing in PR phase. 🎀 👀 🎀 cc: @amyevans |
Current assignee @amyevans is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
No, not settled expenses, literally no expenses (an empty report).
Being unable to delete an approved report in OldDot is expected. You shouldn't be able to delete a report in the processing state either though (you need to retract it first), so I am confused about how you are seeing that. Maybe share a recording and the email(s) you're testing with? Currently when deleting an Open report, this is what happens: delete-report.mov
I will be updating the backend so that point 2 only happens in the future if the report has no comments, and if the report does have comments, then it will instead become new-behavior.movBut that backend work is not live yet and may not be for several weeks because it's held up on some other in-progress work. We shouldn't let that block progress here though.
Yes, since you can't delete a report from NewDot, this only applies to someone taking the action in OldDot.
Yep, all correct.
useEffect(() => {
window.Onyx.merge(`report_547026414937073`, {
statusNum: 2,
});
}); Hope that helps but definitely happy to clarify further if not! |
Ready for review @abdulrahuman5196! |
Catching up from being OOO, it looks like the PR is waiting for @abdulrahuman5196's feedback. |
Bump @abdulrahuman5196, this is a Critical item so it would be great to get that review started! |
Sorry for the delay. Will work on review today Edit: Provided review and comments |
Let us know your progress on this @rayane-djouah! |
I updated the PR |
Update: Making progress in the PR |
Heads up, I will be offline until Tuesday, March 5, 2024. I will not be actively watching over this GitHub during that period. @mallenexpensify is stepping in as the BZ member here and will keep an eye that we get the design feedback needed to keep this one moving forward. |
@abdulrahuman5196 , can you please provide an update, this in the PR is from 3 days ago.
|
Hi, @mallenexpensify it is still under discussion #36767 (comment) |
@mallenexpensify -- thanks for your help here, I'm taking this one back as the BZ member at this party. |
Ok, I'm caught up here. The PR is now waiting for @amyevans's final review. Let's keep pushing forward here. |
Awesome, this PR is ready to go to staging. |
Looks like we are still waiting for this one to go to staging. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.50-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-03-19. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Here is the payment summary:
Upwork Job: https://www.upwork.com/jobs/~0105da3eb4f9af3f30 Extra Notes regarding payment: Everyone has been paid in Upwork. |
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
to2
(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:
closed
chat
report: existing UI of an archived chat roomclosed
expense
report with expenses: existing UI of a completed expense report with no action requiredclosed
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
(or put this in a
useEffect
hook in a component)Feature implementation requirements
[Deleted report]
[Deleted report]
as appropriateUpwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: