recap-chrome icon indicating copy to clipboard operation
recap-chrome copied to clipboard

feat(acms): Adds helper method to handle the Download Confirmation Page

Open ERosendo opened this issue 9 months ago • 0 comments

This PR adds support to upload documents from the new ACMS website and inserts a banner that lets users know a matching record is available in the RECAP archive.

The PR introduces the following changes:

  • Refines the dispatchHandler method to effectively manage the Download confirmation page. The extension uses the path property for page identification.

  • Uses the MutationObserver interface to monitor DOM changes and ensure all elements are rendered before proceeding. This PR removes the default onclick event of the "Accept Charges" button and replaces it with a custom event handler that allows us to upload documents to the RECAP archive.

  • The Appellate class uses the ACMS API to retrieve the pdf documents so the PR adds a new file named acms_api.js to encapsulate utility functions designed to handle API interactions. I used the exportInstance() and importInstance() methods to enable the communication between the content script and the new service.

  • Enhances the parseReceiptPageTitle method by refining the regular expressions to extract the data from the title of the download confirmation page.

  • Introduces a new helper function named storeVueDataInSession that extracts the app settings( API data and Auth token) and the data used by Vue to render the page and stores it in the sessionStorage object, allowing the extension access to the same data.

  • Add a new parameter to the uploadDocument function so we can send the ACMS document GUI when it's available.

Here's a gif showing how the extension works:

Screen Recording 2024-05-01 at 9 06 50 AM

and the banner looks like this:

image

ERosendo avatar Apr 30 '24 15:04 ERosendo