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

feat(hits): add banner to instantsearch-js hits widget #6158

Merged

Conversation

taylorcjohnson
Copy link
Contributor

@taylorcjohnson taylorcjohnson commented Apr 24, 2024

Summary

This is the third pull request to add support for no-code banners to the Hits widget (RFC). Building on the recent changes to the Hits instantsearch-ui-component it updates the Hits instantsearch-js widget to support a new banner template.

EMERCH-1421

There will be a follow-on PR to update React InstantSearch.

Result

The hits widget tests have been updated to ensure that the new class names (bannerRoot, bannerImage, and bannerLink) and new optional banner template (using the html template string and JSX approaches) are supported. No styling was applied in the examples or to instantsearch.css - that will most likely come in a follow-up PR.

Additionally, the code was tested in the getting-started example codebase (connected to appId: F4T6CUV2AH, index: products in the beta environment - where the test rules with a banner consequence exists).

Getting Started App (no query, with updated item template to match new index):
image

Getting Started App (query: nikon; nikon camera promotion alt text and links to https://www.nikonusa.com/):
image

Getting Started App (query: doesnotexist; to demonstrate banner without hits):
image

Copy link

codesandbox-ci bot commented Apr 24, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 99e82f6:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@taylorcjohnson taylorcjohnson self-assigned this Apr 26, 2024
@taylorcjohnson taylorcjohnson requested review from a team, dhayab, Haroenv and aymeric-giraudet and removed request for a team April 26, 2024 06:02
@taylorcjohnson taylorcjohnson marked this pull request as ready for review April 26, 2024 06:03
Co-authored-by: Haroen Viaene <hello@haroen.me>
@aymeric-giraudet aymeric-giraudet enabled auto-merge (squash) April 26, 2024 12:48
@aymeric-giraudet aymeric-giraudet merged commit cfc9016 into master Apr 26, 2024
12 checks passed
@aymeric-giraudet aymeric-giraudet deleted the feat/hits/add-banner-to-instantsearch-js-hits-widget branch April 26, 2024 12:58
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