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(autocomplete-core): add insights option to enable the Insights plugin #1121

Merged

Conversation

FabienMotte
Copy link
Contributor

@FabienMotte FabienMotte commented Apr 13, 2023

Summary

FX-2249

This PR adds an option insights to autocomplete-core package to enable the Insights plugin and load the Insights library if it has not been loaded yet.

Results

When creating the Autocomplete instance, the insights option can be used to enable the Insights plugin and load the Insights library if it has not been loaded yet. The option accepts a boolean or the Insights plugin parameters (that will be passed down to the default plugin).

⚠️ Note: CI is failing because we have circular dependencies issues due to the fact that the autocomplete-plugin-algolia-insights package is now imported in the autocomplete-core package.
These issues are fixed in an other PR #1123 to facilitate the review process.

@@ -285,7 +286,7 @@ See: https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocom
},
});

const input = container.querySelector<HTMLInputElement>('.aa-Input');
const input = container.querySelector<HTMLInputElement>('.aa-Input')!;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related to the PR but I noticed a TS error since input can be null.

@FabienMotte FabienMotte marked this pull request as ready for review April 13, 2023 14:56
@FabienMotte FabienMotte requested review from a team, dhayab and aymeric-giraudet and removed request for a team April 13, 2023 14:56
Copy link
Member

@dhayab dhayab left a comment

Choose a reason for hiding this comment

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

This looks great!

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 18, 2023

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 ffff04c:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration

…hts-plugin-setup

# Conflicts:
#	packages/autocomplete-plugin-algolia-insights/src/types/EventParams.ts
@FabienMotte FabienMotte merged commit 162164d into feat/automatic-events Apr 19, 2023
@FabienMotte FabienMotte deleted the feat/automatic-events-insights-plugin-setup branch April 19, 2023 14: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.

4 participants