From 4559778277ab3d0e7e36392b31fbf0d0f19d7bd1 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Fri, 29 Jan 2021 12:01:00 +0100 Subject: [PATCH 1/8] Add Akeneo 5 to Composer dependencies --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0ad1b84..edcb16c 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ }, "require": { "ext-json": "*", - "akeneo/pim-community-dev": "^4.0" + "akeneo/pim-community-dev": "^5.0" }, "require-dev": { "phpspec/phpspec": "^6.1", From 9f1368ddaebd84deed851883e8cc99cd468bb757 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Mon, 26 Apr 2021 17:43:33 +0200 Subject: [PATCH 2/8] Adapt backend tests to Akeneo 5 --- .../Component/Product/Factory/Value/TableValueFactorySpec.php | 2 +- tests/Kernel/config/packages/test/imports.yml | 2 ++ tests/Pim/TagsAndServiceOverridesTest.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/Flagbit/Bundle/TableAttributeBundle/Component/Product/Factory/Value/TableValueFactorySpec.php b/spec/Flagbit/Bundle/TableAttributeBundle/Component/Product/Factory/Value/TableValueFactorySpec.php index ecd38ad..55c528c 100644 --- a/spec/Flagbit/Bundle/TableAttributeBundle/Component/Product/Factory/Value/TableValueFactorySpec.php +++ b/spec/Flagbit/Bundle/TableAttributeBundle/Component/Product/Factory/Value/TableValueFactorySpec.php @@ -64,7 +64,7 @@ public function it_throws_exception_on_empty_data() private function createAttribute(bool $isScopable, bool $isLocalizable): Attribute { - return new Attribute('code', 'flagbit_catalog_table', [], $isLocalizable, $isScopable, null, false, 'backend', ['de_DE', 'en_US']); + return new Attribute('code', 'flagbit_catalog_table', [], $isLocalizable, $isScopable, null, null, false, 'backend', ['de_DE', 'en_US']); } public function it_supports_attribute_type() diff --git a/tests/Kernel/config/packages/test/imports.yml b/tests/Kernel/config/packages/test/imports.yml index 82385b8..dfb55b7 100644 --- a/tests/Kernel/config/packages/test/imports.yml +++ b/tests/Kernel/config/packages/test/imports.yml @@ -16,6 +16,7 @@ imports: - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/test_fake/oneup_flysystem.yml' } - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/oro_filter.yml' } - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/oro_translation.yml' } + - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/services/test/storage.yml' } - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/security.yml' } - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/test/security.yml' } - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/sensio_framework_extra.yml' } @@ -25,6 +26,7 @@ imports: - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/services/pim_parameters.yml' } - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/services/services.yml' } - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/services/pim.yml' } + - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/monolog.yml' } # - { resource: '../../../../../vendor/akeneo/pim-community-dev/config/packages/doctrine.yml' } doctrine: diff --git a/tests/Pim/TagsAndServiceOverridesTest.php b/tests/Pim/TagsAndServiceOverridesTest.php index 23dccb7..fed61bf 100644 --- a/tests/Pim/TagsAndServiceOverridesTest.php +++ b/tests/Pim/TagsAndServiceOverridesTest.php @@ -73,6 +73,7 @@ public function testScalarValueCreated() false, null, null, + null, 'flagbit_catalog_table', [] ); @@ -126,6 +127,7 @@ public function testSupportsTableValueFactory() false, null, null, + null, 'flagbit_catalog_table', [] ); From c77f88f5aaf35b6abd1203e200c9252b801454d3 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Mon, 26 Apr 2021 17:45:28 +0200 Subject: [PATCH 3/8] Fix service dependencies to Akeneo 5 --- src/Resources/config/query_builders.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/config/query_builders.xml b/src/Resources/config/query_builders.xml index db163c1..e254c7c 100644 --- a/src/Resources/config/query_builders.xml +++ b/src/Resources/config/query_builders.xml @@ -7,7 +7,7 @@ - + flagbit_catalog_table From 0408c97689beb7eb61b292f3b435c5a583cbd0e3 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Mon, 26 Apr 2021 17:58:49 +0200 Subject: [PATCH 4/8] Adapt frontend test to Akeneo 5 --- jest/integration/formextensions.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest/integration/formextensions.test.js b/jest/integration/formextensions.test.js index 3cce844..a9df08e 100644 --- a/jest/integration/formextensions.test.js +++ b/jest/integration/formextensions.test.js @@ -14,6 +14,7 @@ describe('Form Extensions', function() { operators: [ 'IN', 'EMPTY', 'NOT EMPTY' ] }, position: 100, + feature: null, code: 'akeneo-attribute-select-filter' }; From 385d7d04ebc046fc7eb469331566ced70fe6ca0b Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Mon, 26 Apr 2021 18:02:02 +0200 Subject: [PATCH 5/8] Use PHP 7.4 in CI build --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6bc89ad..355d4d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: "ubuntu-18.04" strategy: matrix: - php-versions: ['7.3'] + php-versions: ['7.4'] steps: - uses: "actions/checkout@v2.0.0" @@ -40,7 +40,7 @@ jobs: runs-on: "ubuntu-18.04" strategy: matrix: - php-versions: [ '7.3' ] + php-versions: [ '7.4' ] steps: - uses: "actions/checkout@v2.0.0" From 59e250e3a5ff0291b44cb570cdf51278a6d9a19c Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Tue, 27 Apr 2021 16:12:37 +0200 Subject: [PATCH 6/8] Reconstruct old table attribute config frontend --- .../config/form_extensions/attribute/edit.yml | 5 +- src/Resources/config/requirejs.yml | 1 + .../public/js/product/field/choices.js | 47 +++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 src/Resources/public/js/product/field/choices.js diff --git a/src/Resources/config/form_extensions/attribute/edit.yml b/src/Resources/config/form_extensions/attribute/edit.yml index c28cf39..e1e8a81 100644 --- a/src/Resources/config/form_extensions/attribute/edit.yml +++ b/src/Resources/config/form_extensions/attribute/edit.yml @@ -1,12 +1,9 @@ extensions: flagbit-catalog-table-attribute-edit-form: - module: pim/attribute-edit-form/tab/choices + module: flagbit/product/field/choices parent: pim-attribute-edit-form-form-tabs targetZone: container position: 110 - config: - label: flagbit.table_attribute.form.attribute.tab.title - activeForTypes: [flagbit_catalog_table] flagbit-catalog-table-attribute-edit-form-options-grid: module: flagbit/options-grid diff --git a/src/Resources/config/requirejs.yml b/src/Resources/config/requirejs.yml index 1198fa5..a91308c 100644 --- a/src/Resources/config/requirejs.yml +++ b/src/Resources/config/requirejs.yml @@ -15,6 +15,7 @@ config: flagbit/tablecolumnview: flagbittableattribute/js/tablecolumnview flagbit/inittable: flagbittableattribute/js/inittable flagbit/options-grid: flagbittableattribute/js/options-grid + flagbit/product/field/choices: flagbittableattribute/js/product/field/choices config: pim/form/common/attributes/create-button: diff --git a/src/Resources/public/js/product/field/choices.js b/src/Resources/public/js/product/field/choices.js new file mode 100644 index 0000000..ef49ad3 --- /dev/null +++ b/src/Resources/public/js/product/field/choices.js @@ -0,0 +1,47 @@ +'use strict'; + +define([ + 'underscore', + 'oro/translator', + 'pim/form', + 'pim/template/common/form-container' +], +function ( + _, + __, + BaseForm, + template +) { + return BaseForm.extend({ + className: 'tab-content', + template: _.template(template), + + /** + * {@inheritdoc} + */ + initialize: function () { + BaseForm.prototype.initialize.apply(this, arguments); + }, + + /** + * {@inheritdoc} + */ + configure: function () { + this.trigger('tab:register', { + code: this.code, + label: __('flagbit.table_attribute.form.attribute.tab.title') + }); + + return BaseForm.prototype.configure.apply(this, arguments); + }, + + /** + * {@inheritdoc} + */ + render: function () { + this.$el.html(this.template()); + + this.renderExtensions(); + } + }); +}); From fd1e18420dceabd4ea95fad0704b77163c410ccd Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Tue, 27 Apr 2021 16:58:16 +0200 Subject: [PATCH 7/8] Update documenting files --- CHANGELOG-5.0.md | 3 +++ CONTRIBUTING.md | 4 +++- README.md | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG-5.0.md diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md new file mode 100644 index 0000000..913e5ab --- /dev/null +++ b/CHANGELOG-5.0.md @@ -0,0 +1,3 @@ +# 5.0.0 + +- Add support for Akeneo 5.0.0. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4987217..d4e4f75 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,9 @@ Please note that this project is released with a [Contributor Code of Conduct](C | Branch | Akeneo Compatibility | | ------------- |:-------------:| -| `master` | `>= 3.0.0` | +| `master` | `>= 5.0.0` | +| `4.0` | `>= 4.0.0` | +| `3.0` | `>= 3.0.0` | | `2.X` | `>= 2.0.5 & < 3.0.0` | | `2.0` | `>= 2.0.0 & < 2.0.5` | | `1.X` | `>= 1.6.0 & < 2.0.0` | diff --git a/README.md b/README.md index 9557e86..06a86c7 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ php bin/console --env=prod doctrine:migrations:migrate This extension supports the latest Akeneo PIM CE/EE stable versions: +* 5.0 * 4.0 * 3.2 (LTS) * 3.0 (LTS) From c6843b3b21d8e58ece0c20b1d170df509af11c78 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Tue, 27 Apr 2021 17:05:48 +0200 Subject: [PATCH 8/8] Update PHP version in Scrutinizer config --- .scrutinizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index a9ce3bf..a2ab7a2 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -6,7 +6,7 @@ build: - libmagickwand-dev - libmagickcore-dev php: - version: 7.3 + version: 7.4 pecl_extensions: - apcu - imagick