App: [$500] Delete request confirmation modal has `Delete comment` as the title

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Create a request
  2. Navigate to the expense/iouReport
  3. Hover over the request > click the trash icon on the comment action menu
  4. Observe the title of the modal reads Delete comment

Expected Result:

The delete confirmation modal should read Delete request

Actual Result:

The delete confirmation modal reads Delete comment

Workaround:

N/A

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.77-5 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation

https://github.com/Expensify/App/assets/16232057/270e74dc-8c12-4715-9c36-f505e49d7da1

Expensify/Expensify Issue URL: Issue reported by: @trjExpensify Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01677c1677ad8e585b
  • Upwork Job ID: 1709667849059155968
  • Last Price Increase: 2023-10-04
  • Automatic offers:
    • aimane-chnaif | Reviewer | 27107636

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 25 (15 by maintainers)

Most upvoted comments

The title in video says Delete request (as expected?) 🤔

Ah, you’re looking at the second place in the video you can see this same modal where it is indeed correct. Look at the first one shown at 0.10s where it’s incorrect.

I just opened the PR with the fix.

Proposal

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

The delete confirmation modal reads Delete comment.

What is the root cause of that problem?

The problem is that within the PopoverReportActionContextMenu.js component:

https://github.com/Expensify/App/blob/ef3073066be6855bed47088b29e99a405e1d0feb/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js#L318C1-L333C7

The ConfirmModal title passes empty object reportAction to the reportActionContextMenu.deleteAction translate function which causes the function to render ‘comment’ because action value is false:

https://github.com/Expensify/App/blob/ef3073066be6855bed47088b29e99a405e1d0feb/src/languages/en.ts#L403C1-L403C141

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

Within the PopoverReportActionContextMenu.js component pass the correct title by passing {action: reportAction} like it is passed below for the prompt:

            <ConfirmModal
-               title={translate('reportActionContextMenu.deleteAction', {reportAction})}
+               title={translate('reportActionContextMenu.deleteAction', {action: reportAction})}
                isVisible={isDeleteCommentConfirmModalVisible}
                shouldSetModalVisibility={shouldSetModalVisibilityForDeleteConfirmation}
                onConfirm={confirmDeleteAndHideModal}
                onCancel={hideDeleteModal}
                onModalHide={() => {
                    callbackWhenDeleteModalHide.current();
                }}
                prompt={translate('reportActionContextMenu.deleteConfirmation', {action: reportAction})}
                confirmText={translate('common.delete')}
                cancelText={translate('common.cancel')}
                danger
            />

What alternative solutions did you explore? (Optional)

N/A

Videos

https://github.com/Expensify/App/assets/56457735/cde60184-6d2b-41a4-a8cb-2d656936c4be