recap-chrome
recap-chrome copied to clipboard
feat(acms): Adds helper method to handle the Download Confirmation Page
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 thepath
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 theexportInstance()
andimportInstance()
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 thesessionStorage
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:
and the banner looks like this: