Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 15 commits into from
May 14, 2024

Conversation

ERosendo
Copy link
Contributor

@ERosendo ERosendo commented Apr 30, 2024

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 ERosendo force-pushed the feat-adds-logic-to-handle-download-confirmation-page branch from c54f9e4 to 78caeb6 Compare May 1, 2024 14:18
@ERosendo ERosendo marked this pull request as ready for review May 1, 2024 14:42
@ERosendo ERosendo requested a review from mlissner May 1, 2024 14:42
Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

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

This seems fine to me, but it would be a lot better if you added more comments for each function. You're doing some clever things here that are in your brain now, but I think in a month or two you'll regret not explaining exactly what each thing does and why.

Think you could add that, and then we can merge?

@ERosendo
Copy link
Contributor Author

Think you could add that, and then we can merge?

Sure!

@ERosendo ERosendo force-pushed the feat-adds-logic-to-handle-download-confirmation-page branch from 3f9f3bc to 1d55c5f Compare May 14, 2024 19:30
@ERosendo ERosendo requested a review from mlissner May 14, 2024 19:31
Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

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

Cool. Let's do it. Thank you!

@mlissner mlissner merged commit 40a6be1 into main May 14, 2024
8 checks passed
@mlissner mlissner deleted the feat-adds-logic-to-handle-download-confirmation-page branch May 14, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants