Skip to content

Commit 75d97db

Browse files
authored
Merge pull request #54 from flagbit/form-extension-fix
Fix of select form extension in product export filters
2 parents a3a4bb1 + a20f570 commit 75d97db

File tree

9 files changed

+70
-17
lines changed

9 files changed

+70
-17
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ jobs:
2424
php-version: "${{ matrix.php-versions }}"
2525
extensions: "intl, xdebug, imagick, apcu"
2626

27-
# Install / Prepare
2827
- name: "Install PHP dependencies"
2928
run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
3029

31-
# CI
3230
- name: "Linting"
3331
run: "vendor/bin/phplint ./src"
3432
- name: "Code Sniffer"
@@ -56,10 +54,10 @@ jobs:
5654
- name: "Install PHP dependencies"
5755
run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
5856

59-
# - name: "yarn install"
60-
# uses: "borales/[email protected]"
61-
# with:
62-
# cmd: "install"
57+
- name: "yarn install"
58+
uses: "borales/[email protected]"
59+
with:
60+
cmd: "install"
6361

64-
# - name: "Check for obsolete ts exports"
65-
# run: "yarn run tests"
62+
- name: "Run frontend tests"
63+
run: "yarn run test"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
/composer.lock
77
/coverage
88
/tests/Kernel/var
9+
/yarn.lock
10+
/tests/public/js/extensions.json
11+
/.phpunit.result.cache
12+
/node_modules

CHANGELOG-4.0.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 4.0.1
2+
3+
## Bug fixes
4+
5+
- Fix of select form extension in product export filters [#54][pr54]
6+
7+
# 4.0.0
8+
9+
[pr54]: https://github.com/flagbit/akeneo-table-attribute-bundle/pull/54

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
verbose: true,
3+
rootDir: './',
4+
testURL: 'http://localhost/',
5+
testMatch: ['**/jest/**/*.test.js'],
6+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
describe('Form Extensions', function() {
2+
it('table attribute overrides akeneo-attribute-select-filter', function() {
3+
const formExtensions = require('../../tests/public/js/extensions.json');
4+
5+
const expected = {
6+
module: 'pim/filter/attribute/select',
7+
parent: null,
8+
targetZone: 'self',
9+
zones: [],
10+
aclResourceId: null,
11+
config: {
12+
url: 'pim_ui_ajaxentity_list',
13+
entityClass: 'Flagbit\\Bundle\\TableAttributeBundle\\Entity\\AttributeOption',
14+
operators: [ 'IN', 'EMPTY', 'NOT EMPTY' ]
15+
},
16+
position: 100,
17+
code: 'akeneo-attribute-select-filter'
18+
};
19+
20+
expect(formExtensions.extensions).toContainEqual(expected);
21+
});
22+
});

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "pim-enterprise-standard",
3+
"description": "Akeneo PIM Enterprise Standard Edition",
4+
"homepage": "http://www.akeneo.com",
5+
"private": true,
6+
"config": {
7+
"source": "vendor/akeneo/pim-community-dev",
8+
"styles": "vendor/akeneo/pim-community-dev/frontend/build/compile-less.js"
9+
},
10+
"scripts": {
11+
"update-extensions": "cd tests && node ../vendor/akeneo/pim-community-dev/frontend/build/update-extensions.js",
12+
"test": "yarn update-extensions && jest --no-cache --config jest.config.js"
13+
},
14+
"workspaces": [
15+
"vendor/akeneo/pim-community-dev",
16+
"vendor/akeneo/pim-community-dev/src/Akeneo/Connectivity/Connection/front"
17+
]
18+
}

src/Resources/config/form_extensions.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,5 @@ attribute_fields:
22
flagbit-table-field: flagbit/table-field
33
extensions:
44
akeneo-attribute-select-filter:
5-
module: pim/filter/attribute/select
65
config:
7-
url: pim_ui_ajaxentity_list
8-
entityClass: "%pim_catalog.entity.attribute_option.class%"
9-
operators:
10-
- IN
11-
- EMPTY
12-
- NOT EMPTY
6+
entityClass: Flagbit\Bundle\TableAttributeBundle\Entity\AttributeOption
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
use Akeneo\Pim\Structure\Component\Repository\AttributeRepositoryInterface;
1515
use Akeneo\Tool\Component\StorageUtils\Repository\IdentifiableObjectRepositoryInterface;
1616
use Flagbit\Bundle\TableAttributeBundle\AttributeType\TableType;
17-
use Flagbit\Bundle\TableAttributeBundle\Component\Product\Factory\Value\TableValueFactory;
1817
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1918

20-
class PimTest extends KernelTestCase
19+
class TagsAndServiceOverridesTest extends KernelTestCase
2120
{
2221

2322
public function testFlatToStandardConverterRegisters()

tests/public/js/require-paths.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = [
2+
"../vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/UIBundle",
3+
"../src"]

0 commit comments

Comments
 (0)