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

[MB-8798] Fix deprecation warning for pdf files in the document viewer progress callback #7036

Merged

Conversation

duncan-truss
Copy link
Contributor

@duncan-truss duncan-truss commented Jul 21, 2021

Description

This PR updates our document viewer library react-file-viewer fork to use changes to no longer use the deprecated getDocument function with the progress loading callback trussworks/react-file-viewer#5. This only applies the loading of PDF files in the orders or payment requests document viewer so make sure you are looking at uploads that are not images.

When that PR gets merged into master I will update the package.json to no longer resolve to using the branch name.

It looks like we're still seeing another warning about an undefined function but we will need to upgrade pdf.js to eventually get rid of this mozilla/pdf.js#3768

Reviewer Notes

Is there anything you would like reviewers to give additional scrutiny?

Setup

Add any steps or code to run in this section to help others prepare to run your code:

make db_dev_e2e_populate
make server_run
make office_client_run
  1. Login as a TOO user
  2. Find the move from the queue with locator AMDORD http://officelocal:3000/moves/AMDORD/orders
  3. Navigate to the Edit Orders page if you have not gone there directly
  4. Open the devtools browser console option + command + i or from the Tools -> Browser Tools -> Web Developer Tools menu in Firefox.
  5. Verify there is no more deprecation warning logged to the console when the small.pdf document is loaded.

Code Review Verification Steps

  • If the change is risky, it has been tested in experimental before merging.
  • Code follows the guidelines for Logging
  • The requirements listed in Querying the Database Safely have been satisfied.
  • Any new migrations/schema changes:
    • Follow our guidelines for zero-downtime deploys (see Zero-Downtime Deploys)
    • Have been communicated to #g-database
    • Secure migrations have been tested following the instructions in our docs
  • There are no aXe warnings for UI.
  • This works in Supported Browsers and their phone views (Chrome, Firefox, IE, Edge).
  • Tested in the Experimental environment (for changes to containers, app startup, or connection to data stores)
  • User facing changes have been reviewed by design.
  • Request review from a member of a different team.
  • Have the Jira acceptance criteria been met for this change?

References

Screenshots

Screen Shot 2021-07-13 at 2 16 04 PM

Screen Shot 2021-07-21 at 10 30 11 AM

@robot-mymove
Copy link

robot-mymove commented Jul 21, 2021

Messages
📖 🔗 MB-8798

Generated by 🚫 dangerJS against 8a310fa

@github-actions
Copy link

Bundle difference

Old size New size Diff
46.77 MB 46.77 MB 0 B (0.00%)

@duncan-truss duncan-truss marked this pull request as ready for review July 21, 2021 15:28
Copy link
Contributor

@monfresh monfresh left a comment

Choose a reason for hiding this comment

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

Works as described. Thanks!

@github-actions
Copy link

Bundle difference

Old size New size Diff
46.78 MB 46.78 MB 0 B (0.00%)

@github-actions
Copy link

Bundle difference

Old size New size Diff
46.78 MB 46.78 MB 0 B (0.00%)

@github-actions
Copy link

Bundle difference

Old size New size Diff
46.78 MB 46.78 MB 0 B (0.00%)

@duncan-truss duncan-truss merged commit 503a231 into master Jul 23, 2021
@duncan-truss duncan-truss deleted the ds-mb-8798-react-file-viewer-update-fix-deprecation-msg branch July 23, 2021 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants