Skip to content

Commit

Permalink
Merge pull request #72 from algolia/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Jan Petr authored Sep 9, 2016
2 parents 70fe546 + 22c8b93 commit 255fa15
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 25 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## 1.0.1

- Fixed issue with merging JS files - added new line at the end of [algoliaBundle.min.js](https://github.com/algolia/algoliasearch-magento-2/blob/master/view/frontend/web/internals/algoliaBundle.min.js)
- Fixed page indexing when some excluded pages were set
- Fixed data types of `enabled` variables in `algoliaConfig`
- Fixed few typos

## 1.0.0

- Release
Expand All @@ -16,7 +23,7 @@
- Layout's XML files were rewritten and optimized
- Extension's assets were removed and replaced by SVGs
- Fixed CSS of autocomplete menu's footer (#55, #58)
- Instatnsearch.js library was updated to it's latest version (#56)
- Instantsearch.js library was updated to it's latest version (#56)
- The extension officially supports only 2.0.X versions of Magento, however it's still possible and encouraged to use it on 2.1.0 (#53)
- Fixed some annotations in code (#52, #51)

Expand Down
2 changes: 1 addition & 1 deletion Helper/AlgoliaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private function checkClient($methodName)
$this->resetCredentialsFromConfig();

if (!isset($this->client)) {
throw new AlgoliaException('Operation "' . $methodName . ' could not be performed because Algolia credetials were not provided.');
throw new AlgoliaException('Operation "' . $methodName . ' could not be performed because Algolia credentials were not provided.');
}
}
}
2 changes: 1 addition & 1 deletion Helper/ConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function showSuggestionsOnNoResultsPage($storeId = null)

public function isEnabledFrontEnd($storeId = null)
{
// Frontend = Backend + Frontent
// Frontend = Backend + Frontend
return (bool) $this->configInterface->getValue(self::ENABLE_BACKEND, ScopeInterface::SCOPE_STORE, $storeId) && (bool) $this->configInterface->getValue(self::ENABLE_FRONTEND, ScopeInterface::SCOPE_STORE, $storeId);
}

Expand Down
4 changes: 2 additions & 2 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public function rebuildStoreAdditionalSectionsIndex($storeId)
return;
}

$additionnal_sections = $this->configHelper->getAutocompleteSections();
$additional_sections = $this->configHelper->getAutocompleteSections();

foreach ($additionnal_sections as $section) {
foreach ($additional_sections as $section) {
if ($section['name'] === 'products' || $section['name'] === 'categories' || $section['name'] === 'pages' || $section['name'] === 'suggestions') {
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions Helper/Entity/CategoryHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ public function getObject(Category $category)
foreach ($this->config->getCategoryAdditionalAttributes($storeId) as $attribute) {
$value = $category->getData($attribute['attribute']);

$attribute_ressource = $category->getResource()->getAttribute($attribute['attribute']);
$attribute_resource = $category->getResource()->getAttribute($attribute['attribute']);

if ($attribute_ressource) {
$value = $attribute_ressource->getFrontend()->getValue($category);
if ($attribute_resource) {
$value = $attribute_resource->getFrontend()->getValue($category);
}

if (isset($data[$attribute['attribute']])) {
Expand Down
2 changes: 1 addition & 1 deletion Helper/Entity/PageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getPages($storeId)
$excluded_pages = array_values($this->config->getExcludedPages());

foreach ($excluded_pages as &$excluded_page) {
$excluded_page = $excluded_page['pages'];
$excluded_page = $excluded_page['attribute'];
}

$pages = [];
Expand Down
6 changes: 3 additions & 3 deletions Helper/Entity/ProductHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function setSettings($storeId, $saveToTmpIndicesToo = false)
$synonymsToSet[] = [
'objectID' => $objectID,
'type' => 'synonym',
'synonyms' => $this->explodeSynomyms($synonym['synonyms']),
'synonyms' => $this->explodeSynonyms($synonym['synonyms']),
];
}

Expand All @@ -301,7 +301,7 @@ public function setSettings($storeId, $saveToTmpIndicesToo = false)
'objectID' => $objectID,
'type' => 'oneWaySynonym',
'input' => $onewaySynonym['input'],
'synonyms' => $this->explodeSynomyms($onewaySynonym['synonyms']),
'synonyms' => $this->explodeSynonyms($onewaySynonym['synonyms']),
];
}
}
Expand Down Expand Up @@ -800,7 +800,7 @@ public function getObject(Product $product)
return $customData;
}

private function explodeSynomyms($synonyms)
private function explodeSynonyms($synonyms)
{
return array_map('trim', explode(',', $synonyms));
}
Expand Down
2 changes: 1 addition & 1 deletion Model/Source/CustomPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected function getTableData()

return [
'attribute' => [
'label' => 'Attribute',
'label' => 'Page',
'values' => function () use ($pageCollection) {
$options = [];
$magento_pages = $pageCollection->addFieldToFilter('is_active', 1);
Expand Down
2 changes: 1 addition & 1 deletion Model/Source/Sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ protected function getTableData()

return [
'name' => [
'label' => 'Attribute',
'label' => 'Section',
'values' => function () use ($config) {
$options = [];

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This extension replaces the default search of Magento with a typo-tolerant, fast

See features and benefits of [Algolia Search Extension for Magento](https://community.algolia.com/magento).

![Latest version](https://img.shields.io/badge/latest-1.0.0-green.svg)
![Latest version](https://img.shields.io/badge/latest-1.0.1-green.svg)
![Magento 2.0.X](https://img.shields.io/badge/Magento-2.0.X-blue.svg)
![PHP >= 5.5.22](https://img.shields.io/badge/PHP-%3E=5.5.22-green.svg)

Expand Down
2 changes: 1 addition & 1 deletion Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
$table->addColumn('method', $table::TYPE_TEXT, 50, ['nullable' => false]);
$table->addColumn('data', $table::TYPE_TEXT, 5000, ['nullable' => false]);
$table->addColumn('max_retries', $table::TYPE_INTEGER, 11, ['nullable' => false, 'default' => 3]);
$table->addColumn('retries', $table::TYPE_INTEGER, 11, ['nullable' => false, 'defualt' => 0]);
$table->addColumn('retries', $table::TYPE_INTEGER, 11, ['nullable' => false, 'default' => 0]);
$table->addColumn('error_log', $table::TYPE_TEXT, null, ['nullable' => false]);
$table->addColumn('data_size', $table::TYPE_INTEGER, 11, ['nullable' => true, 'default' => null]);

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "algolia/algoliasearch-magento-2",
"description": "Algolia Search integration for Magento 2",
"type": "magento2-module",
"version": "1.0.0",
"version": "1.0.1",
"license": ["MIT"],
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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="1.0.0">
<module name="Algolia_AlgoliaSearch" setup_version="1.0.1">
</module>
</config>
2 changes: 1 addition & 1 deletion i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Synonyms,Synonyms
<br>
<br>
Algolia offers more synonymys’ types - placeholders and alternative corrections. These types can be managed directly from your <a href=""https://www.algolia.com/dashboard"" target=""_blank"">Algolia’s dashboard</a>.
Any changes you will make to placeholders and alternative corrections in Algolia’s dashboard won’t be overriden.
Any changes you will make to placeholders and alternative corrections in Algolia’s dashboard won’t be overridden.

","

Expand Down
4 changes: 2 additions & 2 deletions view/frontend/templates/internals/configuration.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ if ($config->isInstantEnabled() && $isSearchPage) {

$algoliaJsConfig = [
'instant' => [
'enabled' => $config->isInstantEnabled(),
'enabled' => (bool) $config->isInstantEnabled(),
'selector' => $config->getInstantSelector(),
'isAddToCartEnabled' => $config->isAddToCartEnable(),
],
'autocomplete' => [
'enabled' => $config->isAutoCompleteEnabled(),
'enabled' => (bool) $config->isAutoCompleteEnabled(),
'selector' => $config->getAutocompleteSelector(),
'sections' => $config->getAutocompleteSections(),
'nbOfProductsSuggestions' => $config->getNumberOfProductsSuggestions(),
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ requirejs(['algoliaBundle'], function(algoliaBundle) {
products: algoliaBundle.Hogan.compile($('#autocomplete_products_template').html()),
categories: algoliaBundle.Hogan.compile($('#autocomplete_categories_template').html()),
pages: algoliaBundle.Hogan.compile($('#autocomplete_pages_template').html()),
additionnalSection: algoliaBundle.Hogan.compile($('#autocomplete_extra_template').html())
additionalSection: algoliaBundle.Hogan.compile($('#autocomplete_extra_template').html())
};

/**
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/instantsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ requirejs(['algoliaBundle'], function(algoliaBundle) {
}
};

/** Add all facet widgets to instatnsearch object **/
/** Add all facet widgets to instantsearch object **/

window.getFacetWidget = function (facet, templates) {

Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/internals/algoliaBundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion view/frontend/web/internals/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ requirejs(['algoliaBundle'], function(algoliaBundle) {
templates: {
suggestion: function (hit) {
hit.url = algoliaConfig.baseUrl + '/catalogsearch/result/?q=' + hit.value + '&refinement_key=' + section.name;
return algoliaConfig.autocomplete.templates.additionnalSection.render(hit);
return algoliaConfig.autocomplete.templates.additionalSection.render(hit);
}
}
};
Expand Down

0 comments on commit 255fa15

Please sign in to comment.