Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Agata Firlejczyk committed Oct 15, 2019
2 parents e586c16 + e4f693e commit e579e92
Show file tree
Hide file tree
Showing 23 changed files with 579 additions and 340 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

## Unreleased

### Fixes
- Fix `vsbridge:reindex` command, fix initialize right areacode, loading di.xml files for adminhtml areacode. ([#127](https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/127))
- Fix `vsbridge:reindex --all` command, data will be reindex store by store. ([#130](https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/130))

### Changed/Improved
- Rework abstract mapper to allow configure static type map in di.xml ([#125](https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/125))
- Minor refactoring for product resource model ([#126](https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/126/)).
- Vsbridge Category Indexer - Save Mode: reindex subcategories if url_key has change in category ([#122](https://github.com/DivanteLtd/magento2-vsbridge-indexer/issues/122)).
- Sort configurable options by option sort order. ([#129](https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/129))

## [1.3.0] (2019.09.18)

Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,13 @@ Sign up for a demo at https://vuestorefront.io/ (Vue Storefront integrated with

- Install with composer
```json
composer config repositories.divante vcs https://github.com/DivanteLtd/magento2-vsbridge-indexer
composer require divante/magento2-vsbridge-indexer:dev-master
composer require divante/magento2-vsbridge-indexer
```

## Installation/Getting Started - MSI support
- Install with composer changes from develop branch
- Install second module which will support MSI
```json
composer config repositories.divante vcs https://github.com/DivanteLtd/magento2-vsbridge-indexer
composer require divante/magento2-vsbridge-indexer:dev-develop
```
- Install also second module which will support MSI
```json
composer config repositories.divante-msi vcs https://github.com/DivanteLtd/magento2-vsbridge-indexer-msi
composer require divante/magento2-vsbridge-indexer-msi:dev-develop
composer require divante/magento2-vsbridge-indexer-msi:0.1.0
```
Not fully supported, few fields are exported to ES.
From inventory indexer:
Expand Down Expand Up @@ -256,6 +249,7 @@ php bin/magento indexer:reindex vsbridge_product_indexer
php bin/magento indexer:reindex vsbridge_category_indexer
php bin/magento indexer:reindex vsbridge_cms_block_indexer
php bin/magento indexer:reindex vsbridge_cms_page_indexer
php bin/magento indexer:reindex vsbridge_review_indexer
```


Expand Down Expand Up @@ -283,6 +277,7 @@ Note: If a docker with ElasticSearch is disabled, Indexer will display error: "N
- save/delete the static block
- save/delete the static page
- save/delete the attribute (deleting the attribute causes displaying “invalid” status for vsbridge products indexer).
- save/delete the review

#### Update on Schedule Mode

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Agata",
"email": "[email protected]"
}],
"version": "1.3.0",
"version": "1.4.0",
"keywords": [
"magento",
"magento2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ abstract class AbstractMapping
/**
* @var array
*/
private $staticFieldMapping = [
'status' => FieldInterface::TYPE_INTEGER,
'visibility' => FieldInterface::TYPE_INTEGER,
'position' => FieldInterface::TYPE_LONG,
'level' => FieldInterface::TYPE_INTEGER,
'category_ids' => FieldInterface::TYPE_LONG,
'sku' => FieldInterface::TYPE_KEYWORD,
'url_path' => FieldInterface::TYPE_KEYWORD,
'url_key' => FieldInterface::TYPE_KEYWORD,
];
private $staticFieldMapping;

/**
* AbstractMapping constructor.
*
* @param array $staticFieldMapping
*/
public function __construct(array $staticFieldMapping)
{
$this->staticFieldMapping = $staticFieldMapping;
}

/**
* @var array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/
class Category extends AbstractMapping implements MappingInterface
{

/**
* @var array
*/
Expand Down Expand Up @@ -61,17 +60,20 @@ class Category extends AbstractMapping implements MappingInterface
* @param GeneralMapping $generalMapping
* @param CategoryChildAttributes $categoryChildAttributes
* @param AttributeDataProvider $resourceModel
* @param array $staticFieldMapping
*/
public function __construct(
EventManager $eventManager,
GeneralMapping $generalMapping,
CategoryChildAttributes $categoryChildAttributes,
AttributeDataProvider $resourceModel
AttributeDataProvider $resourceModel,
array $staticFieldMapping
) {
$this->eventManager = $eventManager;
$this->generalMapping = $generalMapping;
$this->resourceModel = $resourceModel;
$this->childAttributes = $categoryChildAttributes;
parent::__construct($staticFieldMapping);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/module-vsbridge-indexer-catalog/Index/Mapping/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class Product extends AbstractMapping implements MappingInterface
{

/**
* @var EventManager
*/
Expand Down Expand Up @@ -52,12 +51,14 @@ public function __construct(
EventManager $eventManager,
GeneralMapping $generalMapping,
ConfigurableAttributes $configurableAttributes,
AttributeDataProvider $resourceModel
AttributeDataProvider $resourceModel,
array $staticFieldMapping
) {
$this->eventManager = $eventManager;
$this->generalMapping = $generalMapping;
$this->resourceModel = $resourceModel;
$this->configurableAttributes = $configurableAttributes;
parent::__construct($staticFieldMapping);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

declare(strict_types = 1);

/**
* @package Divante\VsbridgeIndexerCatalog
* @author Agata Firlejczyk <[email protected]>
* @copyright 2019 Divante Sp. z o.o.
* @license See LICENSE_DIVANTE.txt for license details.
*/

namespace Divante\VsbridgeIndexerCatalog\Model\Attribute;

/**
* Class LoadOptionById
*/
class LoadOptionById
{

/**
* @var LoadOptions
*/
private $loadOptions;

/**
* LoadOptionById constructor.
*
* @param LoadOptions $loadOptions
*/
public function __construct(LoadOptions $loadOptions)
{
$this->loadOptions = $loadOptions;
}

/**
* @param string $attributeCode
* @param int $optionId
* @param int $storeId
*
* @return array
*/
public function execute(string $attributeCode, int $optionId, int $storeId): array
{
$options = $this->loadOptions->execute($attributeCode, $storeId);

foreach ($options as $option) {
if ($optionId === (int)$option['value']) {
return $option;
}
}

return [];
}
}

This file was deleted.

Loading

0 comments on commit e579e92

Please sign in to comment.