Skip to content

fix: add confirmation dialog before cancelling document in PWA#4438

Open
Frankli9986 wants to merge 1 commit intofrappe:developfrom
Frankli9986:fix/pwa-cancel-confirmation
Open

fix: add confirmation dialog before cancelling document in PWA#4438
Frankli9986 wants to merge 1 commit intofrappe:developfrom
Frankli9986:fix/pwa-cancel-confirmation

Conversation

@Frankli9986
Copy link
Copy Markdown

@Frankli9986 Frankli9986 commented Apr 23, 2026

Problem

In the PWA, when viewing a submitted document (e.g., Expense Claim), the Cancel button at the bottom of the screen directly cancels the document without any confirmation. Users can easily mistake it for a general "Cancel" button and accidentally change the document status to Cancelled.

Issue: #2199

Solution

Added a confirmation dialog using Ionic's alertController before executing the cancel action in RequestActionSheet.vue. This matches the existing pattern used in FormView.vue which already has a showCancelDialog confirmation.

Changes

  • Imported alertController from @ionic/vue
  • Added confirmCancel async function that shows an alert with:
    • Header: "Confirm"
    • Message: "Are you sure you want to cancel this document?"
    • Buttons: "No" (cancel) and "Yes" (proceed with cancellation)
  • Updated the Cancel button @click handler to call confirmCancel instead of directly calling updateDocumentStatus

Testing

  • The confirmation dialog appears when clicking Cancel on a submitted document in the PWA action sheet view
  • Clicking "No" dismisses the dialog without any action
  • Clicking "Yes" proceeds with the cancellation as before

Summary by CodeRabbit

  • New Features
    • Document cancellation now displays a confirmation dialog. Users selecting the cancel action receive a prompt with "Yes" and "No" buttons to confirm their intent. The cancellation only processes after explicit user confirmation.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01a042bc-3c82-4c78-81c8-64120b2122fa

📥 Commits

Reviewing files that changed from the base of the PR and between 4359f48 and d48166c.

📒 Files selected for processing (1)
  • frontend/src/components/RequestActionSheet.vue

Walkthrough

The Cancel button in RequestActionSheet.vue now invokes a confirmation dialog before updating the document status. Instead of directly triggering a document status update, the button calls a new confirmCancel function that uses Ionic's alertController to display a confirmation dialog with "No" and "Yes" options. The document status is updated to docstatus: 2 only when the user selects "Yes" in the dialog. Ionic imports have been updated to include alertController.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding a confirmation dialog before cancelling documents in the PWA, which directly matches the implementation in RequestActionSheet.vue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant