Skip to content

Commit

Permalink
Merge pull request #30 from Datatrics/release/1.6.1
Browse files Browse the repository at this point in the history
Release/1.6.1
  • Loading branch information
Marvin-Magmodules authored Aug 18, 2022
2 parents 4a513d6 + 96c5265 commit ce3ba5e
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 42 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ jobs:
strategy:
matrix:
include:
- PHP_VERSION: php72-fpm
MAGENTO_VERSION: 2.3.3
- PHP_VERSION: php73-fpm
MAGENTO_VERSION: 2.3.6-p1
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.4.2
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.4

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand All @@ -26,7 +23,10 @@ jobs:
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/

- name: Install the extensions in Magento
run: docker exec magento-project-community-edition composer require datatrics/magento2-integration:dev-continuous-integration-test-branch fooman/phpstan-magento2-magic-methods:^0.7 phpstan/phpstan:0.*
run: docker exec magento-project-community-edition composer require datatrics/magento2-integration:dev-continuous-integration-test-branch

- name: Activate the extension
run: docker exec magento-project-community-edition bash -c "php bin/magento module:enable Datatrics_Connect && php bin/magento setup:upgrade && php bin/magento setup:di:compile"

- name: Run PHPStan
run: docker exec magento-project-community-edition /bin/bash -c "./vendor/bin/phpstan analyse -c /data/extensions/*/phpstan.neon /data/extensions"
run: docker exec magento-project-community-edition /bin/bash -c "./vendor/bin/phpstan analyse --no-progress -c /data/extensions/*/phpstan.neon /data/extensions"
23 changes: 12 additions & 11 deletions .github/workflows/setup-di-compile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: setup:di:compile
name: Run setup:upgrade and setup:di:compile
on: [pull_request]

jobs:
Expand All @@ -9,24 +9,25 @@ jobs:
- PHP_VERSION: php72-fpm
MAGENTO_VERSION: 2.3.3
- PHP_VERSION: php73-fpm
MAGENTO_VERSION: 2.3.6-p1
MAGENTO_VERSION: 2.3.7
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.4.2
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.4.3-with-replacements
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.4
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Start Docker
run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }}
run: PHP_VERSION=${{ matrix.PHP_VERSION }} MAGENTO_VERSION=magento${{ matrix.MAGENTO_VERSION }} docker-compose -f .github/workflows/templates/docker-compose.yml up -d

- name: Create branch for Composer and remove version from composer.json
run: git checkout -b continuous-integration-test-branch && sed -i '/version/d' ./composer.json

- name: Upload our code into the docker container
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/

- name: Install the extension in Magento
run: docker exec magento-project-community-edition composer require datatrics/magento2-integration:dev-continuous-integration-test-branch
- name: Upload the code into the docker container
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ && docker exec magento-project-community-edition composer require datatrics/magento2-integration:dev-continuous-integration-test-branch

- name: Run setup:di:compile
run: docker exec magento-project-community-edition php bin/magento setup:di:compile
- name: Activate the extension and run setup:upgrade and setup:di:compile
run: docker exec magento-project-community-edition bash -c "php bin/magento module:enable Datatrics_Connect && php bin/magento setup:upgrade && php bin/magento setup:di:compile"
18 changes: 18 additions & 0 deletions .github/workflows/templates/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3'

services:
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: magento-test
MYSQL_USER: magento
MYSQL_PASSWORD: magento
MYSQL_SQL_TO_RUN: 'GRANT ALL ON *.* TO "root"@"%";'
web:
image: michielgerritsen/magento-project-community-edition:${PHP_VERSION}-${MAGENTO_VERSION}
container_name: magento-project-community-edition
depends_on:
- db
volumes:
- ./:/data/extensions/workdir
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* Make input field readonly
*/
class Readonly extends Field
class ReadonlyField extends Field
{

/**
Expand Down
20 changes: 5 additions & 15 deletions Model/Source/CategoryList.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Datatrics\Connect\Model\Source;

use Magento\Catalog\Model\CategoryFactory;
use Magento\Catalog\Model\ResourceModel\Category\Collection;
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory;
use Magento\Framework\Data\OptionSourceInterface;
Expand All @@ -25,10 +24,6 @@ class CategoryList implements OptionSourceInterface
* @var array
*/
public $options = [];
/**
* @var CategoryFactory
*/
private $categoryFactory;
/**
* @var CollectionFactory
*/
Expand All @@ -37,14 +32,11 @@ class CategoryList implements OptionSourceInterface
/**
* CategoryList constructor.
*
* @param CategoryFactory $categoryFactory
* @param CollectionFactory $categoryCollectionFactory
*/
public function __construct(
CategoryFactory $categoryFactory,
CollectionFactory $categoryCollectionFactory
) {
$this->categoryFactory = $categoryFactory;
$this->categoryCollectionFactory = $categoryCollectionFactory;
}

Expand Down Expand Up @@ -112,18 +104,16 @@ public function getCategoryCollection()
*
* @return string
*/
public function getCategoryPath(string $path, array $categoryList) : string
public function getCategoryPath(string $path, array $categoryList): string
{
$categoryPath = [];
$rootCats = [1, 2];
$path = explode('/', $path);

if (!empty($path)) {
foreach ($path as $catId) {
if (!in_array($catId, $rootCats)) {
if (!empty($categoryList[$catId]['name'])) {
$categoryPath[] = $categoryList[$catId]['name'];
}
foreach ($path as $catId) {
if (!in_array($catId, $rootCats)) {
if (!empty($categoryList[$catId]['name'])) {
$categoryPath[] = $categoryList[$catId]['name'];
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Service/ProductData/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ public function execute(array $entityIds, array $attributeMap, array $extraParam

$result = $this->price->execute(
$entityIds,
$productsBehaviour['grouped']['price_logic'] ?? 'max',
$productsBehaviour['bundle']['price_logic'] ?? 'min',
$extraParameters['behaviour']['grouped']['price_logic'] ?? 'max',
$extraParameters['behaviour']['bundle']['price_logic'] ?? 'min',
$storeId
);
foreach ($result as $entityId => $priceData) {
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": "datatrics/magento2-integration",
"description": "Datatrics Connect extension for Magento 2",
"type": "magento2-module",
"version": "1.6.0",
"version": "1.6.1",
"license": [
"BSD-2-Clause"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system/integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<field id="token" translate="label" type="text" sortOrder="2" showInDefault="1"
showInWebsite="0" showInStore="0">
<label>Token</label>
<frontend_model>Datatrics\Connect\Block\Adminhtml\System\Config\Frontend\Readonly</frontend_model>
<frontend_model>Datatrics\Connect\Block\Adminhtml\System\Config\Frontend\ReadonlyField</frontend_model>
<config_path>datatrics_connect_general/integration/token</config_path>
</field>
<field id="integration" translate="label" type="button" sortOrder="100" showInDefault="1"
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<default>
<datatrics_connect_general>
<general>
<version>v1.6.0</version>
<version>v1.6.1</version>
<enable>0</enable>
<source>Magento 2</source>
<debug>0</debug>
Expand Down
3 changes: 1 addition & 2 deletions view/adminhtml/templates/system/config/button/debug.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
<div class="result"></div>
</div>
</div>
<?= $block->getButtonHtml() ?>

<?= $block->getButtonHtml() ?>

0 comments on commit ce3ba5e

Please sign in to comment.