-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-05-14] [Better Expense Report View] [$250] Expense - No confirmation modal when deleting expense #60755
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
Comments
Triggered auto assignment to @lschurr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.There is no confirmation modal after clicking Delete. The expense is deleted directly. What is the root cause of that problem?We call
What changes do you think we should make in order to solve the problem?
App/src/components/MoneyReportHeader.tsx Line 197 in e1e89c9
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?New UI What alternative solutions did you explore? (Optional)We can introduce new prop in this hook like ResultScreen.Recording.2025-04-24.at.10.45.53.movReminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Job added to Upwork: https://www.upwork.com/jobs/~021915445077292325833 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.There is no confirmation modal after clicking Delete. The expense is deleted directly. What is the root cause of that problem?We don't have logic to show the modal before deleting modal.
What changes do you think we should make in order to solve the problem?
const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
const handleDeleteTransactions = useCallback(() => {
const iouActions = reportActions.filter((action) => isMoneyRequestAction(action));
const transactionsWithActions = selectedTransactionsID.map((transactionID) => ({
transactionID,
action: iouActions.find((action) => {
const IOUTransactionID = (getOriginalMessage(action) as OriginalMessageIOU)?.IOUTransactionID;
return transactionID === IOUTransactionID;
}),
}));
transactionsWithActions.forEach(({transactionID, action}) => action && deleteMoneyRequest(transactionID, action));
setSelectedTransactionsID([]);
setIsDeleteModalVisible(false);
}, [reportActions, selectedTransactionsID, setSelectedTransactionsID]);
const showDeleteModal = useCallback(() => {
setIsDeleteModalVisible(true);
}, []);
const hideDeleteModal = useCallback(() => {
setIsDeleteModalVisible(false);
}, []);
const options = useMemo(() => {
if (!selectedTransactionsID.length) {
return [];
}
// All existing options logic
onSelected: showDeleteModal,
return {
options,
handleDeleteTransactions,
isDeleteModalVisible,
showDeleteModal,
hideDeleteModal,
};
const {options: selectedTransactionsOptions, handleDeleteTransactions, isDeleteModalVisible: hookDeleteModalVisible, hideDeleteModal} = useSelectedTransactionsActions({report: moneyRequestReport, reportActions, session, onExportFailed: () => setIsDownloadErrorModalVisible(true)});
Note: We can create new Same change we can add for other places where this hook used. What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?UI changes What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Note:
|
This one line does not define the solution, but anyway it is upto C+ team member to decide. Unlike other parts of the codebase, the useDeleteSavedSearch hook is currently returning JSX/HTML, whereas all other hooks are used solely for logic or state management. To maintain consistency and follow React best practices, any UI rendering should be handled in a separate component. |
📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Over to you @allgandalf for proposal reviews. |
Lets go with @ishakakkad 's proposal here, it looks more correct to me implementation wise! 🎀👀🎀 C+ reviewed |
Current assignee @mountiny is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
@ishakakkad can you make sure that we fix this one throughout the application ?, using jsx/tsx components inside a hook is surely a wrong approach, we should fix it! |
📣 @ishakakkad 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@ishakakkad thanks! Can you please raise the PR for this one? |
@ishakakkad can we get an ETA on the PR, please? Thanks! |
@trjExpensify will create PR max by tomorrow. |
@ishakakkad do you think you can raise the PR today? |
Hi @allgandalf yes already on this, will create PR by today. |
@allgandalf PR for Delete confirmation modal is ready. |
PR was merged ! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.41-1 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 2025-05-14. 🎊 For reference, here are some details about the assignees on this issue:
|
@allgandalf @trjExpensify @allgandalf The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Payment summary as follows:
Paid, closing! |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.1.32-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests
Action Performed:
Precondition:
Expected Result:
There will be a confirmation modal after clicking Delete.
Actual Result:
There is no confirmation modal after clicking Delete. The expense is deleted directly.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6811079_1745444460671.20250424_053653.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @trjExpensifyThe text was updated successfully, but these errors were encountered: