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

[Storefront Preview 🔍 ] Add "onContextChange" Property to StorefrontPreview Component #1527

Merged
merged 11 commits into from
Nov 17, 2023

Conversation

bendvc
Copy link
Collaborator

@bendvc bendvc commented Nov 7, 2023

Description

This is the companion PR for #466 in the Runtime-Admin project.

The goal in this PR is the expose the context changed message event in the form of a handler. This will allow StorefrontPreview implementers to define this handler and take the context and do what they want with it. The use case we are looking at is to integrate 3rd party CMS's like Amplience.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Changes

  • Add onContextChange prop to StorefrontPreview component.
  • Move custom prop validator to utilities

How to Test-Drive This PR

  • Visit this preview link
  • The page will load, and after 7.5s you should see the data reload navigation happen.
  • This happens after 7.5 seconds because the storefront defined a 7.5 second sleep in the form of an async onContextChange handler.
  • You can repeat this by clicking the "Preview" button, the button will immediately grey out, but the page will only load after 7.5s

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

Add "onContextChange" prop to StorefrontPreview component.
@bendvc bendvc requested a review from a team as a code owner November 7, 2023 16:55
bendvc and others added 3 commits November 14, 2023 11:22
…torefront-preview.tsx

Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Signed-off-by: Ben Chypak <bchypak@mobify.com>
adamraya
adamraya previously approved these changes Nov 14, 2023
…torefront-preview.tsx

Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Signed-off-by: Ben Chypak <bchypak@mobify.com>
@bendvc bendvc merged commit 17c504f into develop Nov 17, 2023
20 checks passed
joeluong-sfcc added a commit that referenced this pull request Dec 5, 2023
joeluong-sfcc added a commit that referenced this pull request Dec 6, 2023
joeluong-sfcc added a commit that referenced this pull request Dec 6, 2023
…#1598)

* revert changes from #1527

* Revert "revert changes from #1527"

This reverts commit 2164c3a.

* update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants