Skip to content

Conversation

@adamrefaey
Copy link
Collaborator

Change

This pull request introduces a reusable ConfirmationModal component for confirmation dialogs, integrates it into the ReportDetailPage and ActionButtons components, and improves the user experience by adding toast notifications and confirmation modals for critical actions. It also includes minor updates to localization files for consistency in capitalization.

New Reusable Component:

  • Added a ConfirmationModal component (frontend/src/common/components/Modal/ConfirmationModal.tsx) with customizable title, message, and actions. This component is styled as a bottom sheet and supports dynamic content replacement. [1] [2]

Integration of ConfirmationModal:

  • Updated ActionButtons to use the ConfirmationModal for discard and new upload actions, providing users with clear confirmation dialogs before proceeding with destructive or significant actions.
  • Modified ReportDetailPage to pass necessary props (reportTitle and reportId) to ActionButtons for modal integration.

Enhanced User Feedback:

  • Added toast notifications to ReportDetailPage to inform users of the success or failure of the discard action.

Localization Updates:

  • Capitalized "Yes" and "No" in English (common.json), Spanish (common.json), and French (common.json) localization files for consistency. [1] [2] [3]

Code Enhancements:

  • Introduced useToasts to ReportDetailPage for toast management and updated the discard logic to handle errors gracefully. [1] [2]

Does this PR introduce a breaking change?

{...}

What needs to be documented once your changes are merged?

{...}

Additional Comments

{...}

@adamrefaey adamrefaey requested review from GuidoBR and Copilot April 29, 2025 13:08
@adamrefaey adamrefaey self-assigned this Apr 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a reusable ConfirmationModal component and integrates it into the existing report actions to improve user feedback and safeguard critical actions. Key changes include:

  • A new ConfirmationModal component for confirmation dialogs styled as a bottom sheet.
  • Integration of confirmation dialogs into ActionButtons for discard and new upload actions, along with corresponding toast notifications.
  • Localization updates for consistent capitalization across English, Spanish, and French.

Reviewed Changes

Copilot reviewed 3 out of 7 changed files in this pull request and generated no comments.

File Description
frontend/src/pages/Reports/components/ActionButtons.tsx Adds state management and confirmation modal triggers for both discard and new upload actions.
frontend/src/pages/Reports/ReportDetailPage.tsx Implements toast notifications around the discard action and passes necessary props to ActionButtons.
frontend/src/common/components/Modal/ConfirmationModal.tsx Introduces the reusable ConfirmationModal component with dynamic content replacement based on provided props.
Files not reviewed (4)
  • frontend/src/common/components/Modal/ConfirmationModal.scss: Language not supported
  • frontend/src/common/utils/i18n/resources/en/common.json: Language not supported
  • frontend/src/common/utils/i18n/resources/es/common.json: Language not supported
  • frontend/src/common/utils/i18n/resources/fr/common.json: Language not supported

@GuidoBR GuidoBR merged commit e396e34 into main Apr 29, 2025
1 check passed
@adamrefaey adamrefaey deleted the ADE-67 branch April 29, 2025 13:27
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.

3 participants