fix(attachment menu): Update logic to identify attachment menu page #269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR solves multiple issues related to the attachment menu page.
Avoid getting hidden inputs in the query to get the download button:
it seems that some version of CM/ECF uses hidden inputs after the download button and the current logic fails to identify the attachment menu event when the button is there. So in order to avoid those undesired elements in the query, this PR adds the type
button
in the CSS selector string used by thequerySelectorAll
method.Identify the attachment page for CM/ECF v1.7:
CM/ECF v1.7 uses a different style on the attachment menu page. The current logic fails because the button to download the files has a different value. This PR changes the logic that checks the button's value in order to identify the attachment menu in this version.
Detecting the attachment menu when the combined file size is over the size limit.
The buttons to download the files are removed when the combined size of the files is over the size limit of PACER. In such case, the user finds a note at the bottom of the list saying
Note: You must view each document individually because the combined PDF would be over the size limit
. This issue is described in Attachment pages with lots of big files are not identified as attachment pages#238div
tag with anid
attribute. This PR adds a query to get thisdiv
(document.getElementById('file_too_big')
) and uses it in the logic validations to identify the attachment page.div
. This PR adds a query to get thisdiv
and checks the text content of the last child.