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

fix(island-ui): pdf viewer worker url #16280

Merged
merged 5 commits into from
Oct 4, 2024
Merged

Conversation

thordurhhh
Copy link
Member

@thordurhhh thordurhhh commented Oct 4, 2024

What

pdf viewer worker url update

Why

Current one is not correct.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Enhanced PDF viewer flexibility by dynamically setting the worker source URL based on the deployment environment (localhost vs. production).
  • Bug Fixes

    • Maintained consistent user experience with preserved error handling and loading views.

Copy link
Contributor

coderabbitai bot commented Oct 4, 2024

Walkthrough

The changes in the PdfViewer.tsx file involve updating the logic for setting the worker source for the PDF.js library. The previous hardcoded URL has been replaced with a dynamic approach that constructs the worker URL based on the application's environment, distinguishing between localhost and production settings. The component's structure, state management, rendering logic, error handling, and loading views remain unchanged.

Changes

File Change Summary
libs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx Modified worker source logic to dynamically set the URL based on the environment (localhost vs production).

Possibly related PRs

  • chore: update PDF package #15760: This PR modifies the way the worker source for the PDF.js library is specified in the PdfViewer component, which is directly related to the changes made in the main PR regarding the worker source logic.
  • fix(island-ui): Update url for pdf worker #16273: This PR updates the URL for the PDF worker in the PdfViewer.tsx file, which aligns closely with the main PR's changes to the worker source logic based on the environment.

Suggested labels

automerge

Suggested reviewers

  • RunarVestmann
  • Tryggvig

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@thordurhhh thordurhhh marked this pull request as ready for review October 4, 2024 15:20
@thordurhhh thordurhhh requested a review from a team as a code owner October 4, 2024 15:20
@thordurhhh thordurhhh requested a review from disaerna October 4, 2024 15:20
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 36.92%. Comparing base (b204713) to head (d7c05b0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ibs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx 0.00% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16280      +/-   ##
==========================================
- Coverage   36.92%   36.92%   -0.01%     
==========================================
  Files        6781     6781              
  Lines      140030   140035       +5     
  Branches    39815    39817       +2     
==========================================
  Hits        51705    51705              
- Misses      88325    88330       +5     
Flag Coverage Δ
air-discount-scheme-web 0.00% <ø> (ø)
api 3.37% <ø> (ø)
application-api-files 57.91% <ø> (ø)
application-core 71.62% <ø> (+0.32%) ⬆️
application-system-api 41.63% <ø> (ø)
application-template-api-modules 24.40% <ø> (ø)
application-templates-accident-notification 29.44% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 26.63% <ø> (ø)
application-templates-driving-license 18.63% <ø> (ø)
application-templates-estate 12.32% <0.00%> (-0.01%) ⬇️
application-templates-example-payment 25.41% <ø> (ø)
application-templates-financial-aid 14.34% <ø> (ø)
application-templates-general-petition 23.68% <ø> (ø)
application-templates-health-insurance 26.62% <ø> (ø)
application-templates-inheritance-report 6.45% <ø> (ø)
application-templates-marriage-conditions 15.23% <ø> (ø)
application-templates-mortgage-certificate 43.96% <ø> (ø)
application-templates-parental-leave 30.15% <ø> (ø)
application-types 6.71% <ø> (ø)
application-ui-components 1.28% <ø> (ø)
application-ui-shell 21.27% <0.00%> (-0.02%) ⬇️
auth-react 22.77% <0.00%> (-0.03%) ⬇️
clients-charge-fjs-v2 24.11% <ø> (ø)
contentful-apps 5.57% <ø> (ø)
financial-aid-backend 56.53% <ø> (ø)
financial-aid-shared 19.03% <ø> (ø)
island-ui-core 28.44% <0.00%> (-0.04%) ⬇️
judicial-system-web 28.10% <0.00%> (-0.02%) ⬇️
portals-admin-regulations-admin 1.88% <ø> (ø)
portals-core 16.15% <0.00%> (-0.02%) ⬇️
services-auth-personal-representative 45.55% <ø> (+0.02%) ⬆️
shared-components 27.65% <0.00%> (-0.04%) ⬇️
shared-form-fields 31.59% <0.00%> (-0.05%) ⬇️
web 1.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ibs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx 5.12% <0.00%> (-0.76%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b204713...d7c05b0. Read the comment docs.

@thordurhhh thordurhhh added automerge Merge this PR as soon as all checks pass and removed automerge Merge this PR as soon as all checks pass labels Oct 4, 2024
@datadog-island-is
Copy link

datadog-island-is bot commented Oct 4, 2024

Datadog Report

All test runs 54cbd53 🔗

34 Total Test Services: 0 Failed, 33 Passed
🔻 Test Sessions change in coverage: 6 decreased, 1 increased (+0.21%), 140 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-web 0 0 0 2 0 7.52s 1 no change Link
api 0 0 0 4 0 2.66s 1 no change Link
application-api-files 0 0 0 12 0 6.71s 1 no change Link
application-core 0 0 0 90 0 21.42s 1 increased (+0.21%) Link
application-system-api 0 0 0 120 2 3m 3.64s 1 no change Link
application-template-api-modules 0 0 0 135 0 2m 8.49s 1 no change Link
application-templates-accident-notification 0 0 0 148 0 21.45s 1 no change Link
application-templates-criminal-record 0 0 0 2 0 11.44s 1 no change Link
application-templates-driving-license 0 0 0 13 0 17.85s 1 no change Link
application-templates-example-payment 0 0 0 2 0 12.6s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (6)

This report shows up to 5 code coverage decreases.

  • shared-form-fields - jest 39.87% (-0.06%) - Details
  • auth-react - jest 32.13% (-0.04%) - Details
  • shared-components - jest 34.78% (-0.04%) - Details
  • portals-core - jest 24.7% (-0.03%) - Details
  • island-ui-core - jest 28.62% (-0.03%) - Details

@thordurhhh thordurhhh added the automerge Merge this PR as soon as all checks pass label Oct 4, 2024
@kodiakhq kodiakhq bot merged commit e66d89b into main Oct 4, 2024
120 checks passed
@kodiakhq kodiakhq bot deleted the island-ui/pdf-viewer-worker-url branch October 4, 2024 15:58
thordurhhh added a commit that referenced this pull request Oct 4, 2024
* Update url

* Update url

* Update url

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
kodiakhq bot added a commit that referenced this pull request Oct 4, 2024
* fix(island-ui): Update url for pdf worker (#16273)

* fix(island-ui): pdf viewer worker url (#16280)

* Update url

* Update url

* Update url

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Nov 15, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants