Skip to content

Conversation

@adamrefaey
Copy link
Collaborator

Change

This pull request introduces several changes across the backend and frontend to enhance document processing, report management, and user experience. Key updates include improved handling of document processing states, the addition of a report deletion feature, and UI adjustments for better usability.

Backend Changes

Document Processing Improvements:

  • Enhanced the DocumentProcessorController to provide more descriptive messages based on the processing status (IN_PROGRESS, PROCESSED, or not started) when initiating document processing. This ensures clearer feedback to users. [1] [2]

Report Deletion Feature:

  • Added a new DELETE endpoint in the ReportsController to allow users to delete reports. This includes API documentation (@ApiOperation, @ApiResponse, and @ApiParam) for better clarity. [1] [2]
  • Integrated the deletion functionality into the API Gateway by creating a deleteReportIntegration and adding the corresponding method to the reportIdResource in the infrastructure code. [1] [2]

Frontend Changes

Report Management Enhancements:

  • Updated the ReportDetailPage to include a DELETE request for discarding reports, redirecting users to the home tab after successful deletion.

UI and Usability Improvements:

  • Automatically open the upload modal on the UploadPage when the component mounts, simplifying the user flow. Removed redundant UI elements like the "select file" button. [1] [2] [3] [4]
  • Added a conditional check in the AiAnalysisTab to render the FlaggedValuesSection only when flagged values are present, improving the component's robustness.

Localization:

  • Added a new translation key for the "Upload Report" page title in the English localization file.

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 24, 2025 18:48
@adamrefaey adamrefaey self-assigned this Apr 24, 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 implements fixes and improvements to the report upload, processing, and management workflows. Key changes include frontend updates to automatically open the upload modal and streamline the UI, new backend endpoints and API Gateway integration for report deletion, and enhanced document processing messaging based on status.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/pages/Upload/UploadPage.tsx Automatically opens the upload modal by default and removes the redundant file selection button.
frontend/src/pages/Reports/components/AiAnalysisTab.tsx Adds a conditional check for rendering the FlaggedValuesSection based on the flagged values.
frontend/src/pages/Reports/ReportDetailPage.tsx Updates navigation behavior and incorporates an asynchronous report deletion process.
backend/src/reports/reports.controller.ts Introduces a DELETE endpoint with detailed API documentation for report deletion.
backend/src/iac/backend-stack.ts Adds a DELETE integration to the API Gateway for the new report deletion endpoint.
backend/src/document-processor/controllers/document-processor.controller.ts Enhances document processing messaging based on the current processing status.
Files not reviewed (1)
  • frontend/src/common/utils/i18n/resources/en/common.json: Language not supported
Comments suppressed due to low confidence (1)

frontend/src/pages/ReportDetailPage.tsx:87

  • The async deletion in handleDiscard does not include error handling. Wrapping the deletion call in a try/catch block and giving user feedback on failure is recommended.
await axios.delete(`${API_URL}/api/reports/${reportId}`, await getAuthConfig());

@GuidoBR GuidoBR merged commit 66e62c7 into main Apr 24, 2025
1 of 2 checks passed
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