Skip to content

Commit

Permalink
Merge pull request #1472 from algolia/develop
Browse files Browse the repository at this point in the history
release/3.13.0
  • Loading branch information
mohitalgolia authored Jan 27, 2024
2 parents be7b243 + f0010a3 commit 9cc28e3
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 50 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGE LOG

## 3.13.0

### Updates
- Updated instantSearch library version from 4.41.0 to 4.63.0
- Updated disclaimer for advanced algolia indices settings in the magento admin

## 3.12.1

### Updates
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Algolia Search & Discovery extension for Magento 2
==================================================

![Latest version](https://img.shields.io/badge/latest-3.12.1-green)
![Latest version](https://img.shields.io/badge/latest-3.13.0-green)
![Magento 2](https://img.shields.io/badge/Magento-2.4.x-orange)

![PHP](https://img.shields.io/badge/PHP-8.2%2C8.1%2C7.4-blue)
Expand Down Expand Up @@ -74,15 +74,16 @@ Please check our [Custom Extension](https://github.com/algolia/algoliasearch-cus

Knowing the version of the library will help you understand what is available in these libraries for you to leverage in terms of customisation. This table will help you determine which documentation to reference when you start working on your customisation.

| Extension Version | autocomplete.js | instantsearch.js | search-insights.js | recommend.js |
|-------------------|-------------------------------------------------------------------| --- | --- | --- |
| v1.x | [0.26.0](https://github.com/algolia/autocomplete.js/tree/v0.26.0) | [2.10.2](https://github.com/algolia/instantsearch.js/tree/v2.10.2) | [0.0.14](https://cdn.jsdelivr.net/npm/[email protected]) | NA |
| v2.x | [0.38.0](https://github.com/algolia/autocomplete.js/tree/v0.38.0) | [4.7.2](https://github.com/algolia/instantsearch.js/tree/v4.7.2) | [1.4.0](https://github.com/algolia/search-insights.js/tree/v1.4.0) | NA |
| v3.x | [0.38.0](https://github.com/algolia/autocomplete.js/tree/v0.38.0) | [4.15.0](https://github.com/algolia/instantsearch.js/tree/v4.15.0) | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | NA |
| v3.9.1 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0) | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.5.0](https://github.com/algolia/recommend/tree/v1.5.0) |
| v3.10.x | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0) | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
| v3.11.0 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0) | [2.6.0](https://github.com/algolia/search-insights.js/tree/v2.6.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
| >=v3.12.1 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0) | [2.11.0](https://github.com/algolia/search-insights.js/tree/v2.11.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
| Extension Version | autocomplete.js | instantsearch.js | search-insights.js | recommend.js |
|-----------------|-------------------------------------------------------------------|--------------------------------------------------------------------| --- | --- |
| v1.x | [0.26.0](https://github.com/algolia/autocomplete.js/tree/v0.26.0) | [2.10.2](https://github.com/algolia/instantsearch.js/tree/v2.10.2) | [0.0.14](https://cdn.jsdelivr.net/npm/[email protected]) | NA |
| v2.x | [0.38.0](https://github.com/algolia/autocomplete.js/tree/v0.38.0) | [4.7.2](https://github.com/algolia/instantsearch.js/tree/v4.7.2) | [1.4.0](https://github.com/algolia/search-insights.js/tree/v1.4.0) | NA |
| v3.x | [0.38.0](https://github.com/algolia/autocomplete.js/tree/v0.38.0) | [4.15.0](https://github.com/algolia/instantsearch.js/tree/v4.15.0) | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | NA |
| v3.9.1 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0) | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.5.0](https://github.com/algolia/recommend/tree/v1.5.0) |
| v3.10.x | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0) | [1.7.1](https://github.com/algolia/search-insights.js/tree/v1.7.1) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
| v3.11.0 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.41.0](https://github.com/algolia/instantsearch.js/tree/v4.41.0) | [2.6.0](https://github.com/algolia/search-insights.js/tree/v2.6.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |
| >=v3.13.0 | [1.6.3](https://github.com/algolia/autocomplete.js/tree/v1.6.3) | [4.63.0](https://github.com/algolia/instantsearch/tree/instantsearch.js%404.63.0) | [2.6.0](https://github.com/algolia/search-insights.js/tree/v2.6.0) | [1.8.0](https://github.com/algolia/recommend/tree/v1.8.0) |


The autocomplete and instantsearch libraries are accessible in the `algoliaBundle` global. This bundle is a prepackage javascript file that contains it's dependencies. What is included in this bundle can be seen here:

Expand Down
2 changes: 1 addition & 1 deletion composer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Algolia Search & Discovery extension for Magento 2",
"type": "magento2-module",
"license": ["MIT"],
"version": "3.12.1",
"version": "3.13.0",
"require": {
"magento/framework": "~102.0|~103.0",
"algolia/algoliasearch-client-php": "3.3.2",
Expand Down
20 changes: 10 additions & 10 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@
<field id="analytics_region" translate="label comment" type="select" sortOrder="96" showInDefault="1">
<label>Analytics Region</label>
<source_model>Algolia\AlgoliaSearch\Model\Source\AnalyticsRegion</source_model>
</field>
</field>
<field id="connection_timeout" translate="label comment" type="text" sortOrder="100" showInDefault="1">
<label>Connection Timeout (In Seconds)</label>
</field>
Expand Down Expand Up @@ -1315,47 +1315,47 @@
</group>
</section>
<section id="algoliasearch_extra_settings" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Advanced - Extra Algolia indices settings</label>
<label>Advanced Algolia indices settings</label>
<tab>algolia</tab>
<resource>Algolia_AlgoliaSearch::algolia_algoliasearch</resource>
<group id="extra_settings" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Advanced - Extra Algolia indices settings</label>
<label>Advanced Algolia indices settings</label>
<comment>
<![CDATA[
<p>Here, you can specify additional Algolia indices settings which can be applied only programatically via one of Algolia API clients.</p>
<p>
To set extra settings, please fill the right textarea with JSON where you specify the extra settings.<br>
To set settings, please fill the right textarea with JSON where you specify the settings.<br>
Example: <code>{"exactOnSingleWordQuery":"word"}</code>
</p>
<p><span class="algolia-config-warning">&#9888;</span> Edit extra settings only when you're sure what you're doing. Bad settings can effect your search functionality and have a bad impact on your relevance.</p>
<p><span class="algolia-config-warning">&#9888;</span> These settings will overwrite existing parameters, not add to them. Proceed to edit these settings only when you're sure what you're doing. Bad settings can effect your search functionality and have a bad impact on your relevance.</p>
<br/>
<div class="algolia-admin-content"></div>
]]>
</comment>

<field id="products_extra_settings" translate="label comment" type="\Algolia\AlgoliaSearch\Model\Textarea" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<backend_model>Algolia\AlgoliaSearch\Model\Backend\ExtraSettings</backend_model>
<label>Products' indices extra settings</label>
<label>Products' indices settings</label>
<attribute type="abrala" value="80">
<value>90</value>
</attribute>
</field>
<field id="categories_extra_settings" translate="label comment" type="\Algolia\AlgoliaSearch\Model\Textarea" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<backend_model>Algolia\AlgoliaSearch\Model\Backend\ExtraSettings</backend_model>
<label>Categories' indices extra settings</label>
<label>Categories' indices settings</label>
</field>
<field id="pages_extra_settings" translate="label comment" type="\Algolia\AlgoliaSearch\Model\Textarea" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<backend_model>Algolia\AlgoliaSearch\Model\Backend\ExtraSettings</backend_model>
<label>Pages' indices extra settings</label>
<label>Pages' indices settings</label>
</field>
<field id="suggestions_extra_settings" translate="label comment" type="\Algolia\AlgoliaSearch\Model\Textarea" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<backend_model>Algolia\AlgoliaSearch\Model\Backend\ExtraSettings</backend_model>
<label>Suggestions' indices extra settings</label>
<label>Suggestions' indices settings</label>
</field>
<field id="additional_sections_extra_settings" translate="label comment" type="\Algolia\AlgoliaSearch\Model\Textarea" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<backend_model>Algolia\AlgoliaSearch\Model\Backend\ExtraSettings</backend_model>
<label>Additional sections' indices extra settings</label>
<label>Additional sections' indices settings</label>
</field>
</group>
</section>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Algolia_AlgoliaSearch" setup_version="3.12.1">
<module name="Algolia_AlgoliaSearch" setup_version="3.13.0">
<sequence>
<module name="Magento_Theme"/>
<module name="Magento_Backend"/>
Expand Down
20 changes: 9 additions & 11 deletions view/frontend/web/instantsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,6 @@ define(
var instantsearchOptions = {
searchClient: searchClient,
indexName: indexName,
searchFunction: function (helper) {
if (helper.state.query === '' && !algoliaConfig.isSearchPage) {
$('.algolia-instant-replaced-content').show();
$('.algolia-instant-selector-results').hide();
} else {
helper.search();
$('.algolia-instant-replaced-content').hide();
$('.algolia-instant-selector-results').show();
}
},
routing: window.routing,
};

Expand Down Expand Up @@ -242,7 +232,15 @@ define(
data.last = Math.min(data.page * data.hitsPerPage + data.hitsPerPage, data.nbHits);
data.seconds = data.processingTimeMS / 1000;
data.translations = window.algoliaConfig.translations;

const searchParams = new URLSearchParams(window.location.search);
const searchQuery = searchParams.has("q") || '';
if (searchQuery === '' && !algoliaConfig.isSearchPage) {
$('.algolia-instant-replaced-content').show();
$('.algolia-instant-selector-results').hide();
} else {
$('.algolia-instant-replaced-content').hide();
$('.algolia-instant-selector-results').show();
}
return hoganTemplate.render(data)
}
}
Expand Down
35 changes: 18 additions & 17 deletions view/frontend/web/internals/algoliaBundle.min.js

Large diffs are not rendered by default.

0 comments on commit 9cc28e3

Please sign in to comment.