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/instant enabled option #218

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

seizan8
Copy link
Contributor

@seizan8 seizan8 commented Jul 23, 2024

The option for enabling and disabling the instant search currently has no effect at all.
In the sciprts template an option instantEnabled is passed with the value true every time. Even if the value was dynamic, the js was not using the variable at all.

I replaced the static "true" with the value from the setting. And then checked it in the js before adding the listener for the instant search. So the instant search is now only enabled it the settings is set to true.

@@ -1,6 +1,6 @@
<script type="text/javascript">
var monsieurbizSearchPlugin = {
instantEnabled: true,
instantEnabled: {{ setting('monsieurbiz.search', 'instant_search_enabled__monsieurbiz_product') ? 'true' : 'false' }},
Copy link
Member

Choose a reason for hiding this comment

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

🎯 suggestion: This is OK if you only index products. If I also have taxons or other entities in ES, we need to check that instant search is disabled for all entities.
Perhaps you should create a twig function to loop through all documentable entities and check the configuration. ‏

Copy link
Member

Choose a reason for hiding this comment

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

We need to build a form dynamically with all documentable entities with a default value to true if the value is not set yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maximehuran a form here? But this is not a form, we don't generate any input fields. I am confused why you suggest a form here.

@@ -1,6 +1,6 @@
<script type="text/javascript">
var monsieurbizSearchPlugin = {
instantEnabled: true,
instantEnabled: {{ setting('monsieurbiz.search', 'instant_search_enabled__monsieurbiz_product') ? 'true' : 'false' }},
Copy link
Member

Choose a reason for hiding this comment

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

We need to build a form dynamically with all documentable entities with a default value to true if the value is not set yet

@Kiwikoti Kiwikoti removed their request for review October 28, 2024 08:36
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.

4 participants