Skip to content

Commit

Permalink
Merge pull request #57 from flagbit/akeneo5
Browse files Browse the repository at this point in the history
Update for Akeneo 5
  • Loading branch information
flagbird authored Jun 1, 2021
2 parents 75d97db + c6843b3 commit 65821c8
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: "ubuntu-18.04"
strategy:
matrix:
php-versions: ['7.3']
php-versions: ['7.4']

steps:
- uses: "actions/[email protected]"
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: "ubuntu-18.04"
strategy:
matrix:
php-versions: [ '7.3' ]
php-versions: [ '7.4' ]

steps:
- uses: "actions/[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build:
- libmagickwand-dev
- libmagickcore-dev
php:
version: 7.3
version: 7.4
pecl_extensions:
- apcu
- imagick
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG-5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 5.0.0

- Add support for Akeneo 5.0.0.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions jest/integration/formextensions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('Form Extensions', function() {
operators: [ 'IN', 'EMPTY', 'NOT EMPTY' ]
},
position: 100,
feature: null,
code: 'akeneo-attribute-select-filter'
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 1 addition & 4 deletions src/Resources/config/form_extensions/attribute/edit.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/query_builders.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<services>

<service id="flagbit_catalog_table.doctrine.query.filter.columns" class="%pim_catalog.query.elasticsearch.filter.option.class%">
<argument type="service" id="pim_catalog.validator.helper.attribute"/>
<argument type="service" id="pim_catalog.validator.helper.attribute_filter"/>
<argument type="service" id="pim_catalog.repository.attribute_option"/>
<argument type="collection">
<argument>flagbit_catalog_table</argument>
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/requirejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
47 changes: 47 additions & 0 deletions src/Resources/public/js/product/field/choices.js
Original file line number Diff line number Diff line change
@@ -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();
}
});
});
2 changes: 2 additions & 0 deletions tests/Kernel/config/packages/test/imports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions tests/Pim/TagsAndServiceOverridesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function testScalarValueCreated()
false,
null,
null,
null,
'flagbit_catalog_table',
[]
);
Expand Down Expand Up @@ -126,6 +127,7 @@ public function testSupportsTableValueFactory()
false,
null,
null,
null,
'flagbit_catalog_table',
[]
);
Expand Down

0 comments on commit 65821c8

Please sign in to comment.