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 insurance widget conflict with product details panel #590

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

olance
Copy link
Contributor

@olance olance commented Oct 25, 2024

Reason for change

The insurance integration conflicts with PrestaShop's product details pane on product pages, and prevents its display.

Fixes ECOM-2155

Code changes

  • Cleaned the JS global scope by moving all variables/functions into the self-executing function in alma-product-insurance.js
  • Changed from JSON output into data attributes to JSON output into plain JavaScript objects in the global window.AlmaInsurance object
  • Stopped trying to reload product details data from the DOM; using the data passed along the updatedProduct event by PrestaShop

How to test

As a reviewer, you are encouraged to test the PR locally.

  • Load a product page for an insurance-eligible product
    👉 The insurance widget should be displayed
    👉 You should be able to switch from the product description to the product display panel
    👉 There should be no error in the console about dataset.product being null/undefined

Checklist for authors and reviewers

  • The title of the PR uses business wording, not technical jargon, for the changelog readers to understand it
  • The PR implements the changes asked in the referenced task / issue
  • You understand the impact of this PR on existing code/features
  • The changes include adequate logging and Datadog traces
  • Documentation is updated (API, developer documentation, ADR, Notion...)

Non applicable

  • The automated tests are compliant with the testing strategy
  • The tests are relevant, and cover the corner/error cases, not only the happy path

@olance olance requested a review from a team as a code owner October 25, 2024 11:03
@github-actions github-actions bot added the type: bugfix Bug fix label Oct 25, 2024
Copy link

⏳E2E tests are currently running.
➡️ You can follow their progression here.

Copy link

sonarcloud bot commented Oct 25, 2024

Copy link

❌ E2E tests have failed.
➡️ You can find the results here.

@olance olance changed the title Fix/js product details Fix insurance widget conflict with product details panel Oct 25, 2024
@olance olance merged commit 6c9ffa8 into develop Oct 25, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants