Skip to content

Commit

Permalink
Merge pull request #54 from flagbit/form-extension-fix
Browse files Browse the repository at this point in the history
Fix of select form extension in product export filters
  • Loading branch information
flagbird committed Oct 28, 2020
2 parents a3a4bb1 + a20f570 commit 75d97db
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 17 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/main.yml
Expand Up @@ -24,11 +24,9 @@ jobs:
php-version: "${{ matrix.php-versions }}"
extensions: "intl, xdebug, imagick, apcu"

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

# CI
- name: "Linting"
run: "vendor/bin/phplint ./src"
- name: "Code Sniffer"
Expand Down Expand Up @@ -56,10 +54,10 @@ jobs:
- name: "Install PHP dependencies"
run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"

# - name: "yarn install"
# uses: "borales/actions-yarn@v2.0.0"
# with:
# cmd: "install"
- name: "yarn install"
uses: "borales/actions-yarn@v2.0.0"
with:
cmd: "install"

# - name: "Check for obsolete ts exports"
# run: "yarn run tests"
- name: "Run frontend tests"
run: "yarn run test"
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -6,3 +6,7 @@
/composer.lock
/coverage
/tests/Kernel/var
/yarn.lock
/tests/public/js/extensions.json
/.phpunit.result.cache
/node_modules
9 changes: 9 additions & 0 deletions CHANGELOG-4.0.md
@@ -0,0 +1,9 @@
# 4.0.1

## Bug fixes

- Fix of select form extension in product export filters [#54][pr54]

# 4.0.0

[pr54]: https://github.com/flagbit/akeneo-table-attribute-bundle/pull/54
6 changes: 6 additions & 0 deletions jest.config.js
@@ -0,0 +1,6 @@
module.exports = {
verbose: true,
rootDir: './',
testURL: 'http://localhost/',
testMatch: ['**/jest/**/*.test.js'],
};
22 changes: 22 additions & 0 deletions jest/integration/formextensions.test.js
@@ -0,0 +1,22 @@
describe('Form Extensions', function() {
it('table attribute overrides akeneo-attribute-select-filter', function() {
const formExtensions = require('../../tests/public/js/extensions.json');

const expected = {
module: 'pim/filter/attribute/select',
parent: null,
targetZone: 'self',
zones: [],
aclResourceId: null,
config: {
url: 'pim_ui_ajaxentity_list',
entityClass: 'Flagbit\\Bundle\\TableAttributeBundle\\Entity\\AttributeOption',
operators: [ 'IN', 'EMPTY', 'NOT EMPTY' ]
},
position: 100,
code: 'akeneo-attribute-select-filter'
};

expect(formExtensions.extensions).toContainEqual(expected);
});
});
18 changes: 18 additions & 0 deletions package.json
@@ -0,0 +1,18 @@
{
"name": "pim-enterprise-standard",
"description": "Akeneo PIM Enterprise Standard Edition",
"homepage": "http://www.akeneo.com",
"private": true,
"config": {
"source": "vendor/akeneo/pim-community-dev",
"styles": "vendor/akeneo/pim-community-dev/frontend/build/compile-less.js"
},
"scripts": {
"update-extensions": "cd tests && node ../vendor/akeneo/pim-community-dev/frontend/build/update-extensions.js",
"test": "yarn update-extensions && jest --no-cache --config jest.config.js"
},
"workspaces": [
"vendor/akeneo/pim-community-dev",
"vendor/akeneo/pim-community-dev/src/Akeneo/Connectivity/Connection/front"
]
}
8 changes: 1 addition & 7 deletions src/Resources/config/form_extensions.yml
Expand Up @@ -2,11 +2,5 @@ attribute_fields:
flagbit-table-field: flagbit/table-field
extensions:
akeneo-attribute-select-filter:
module: pim/filter/attribute/select
config:
url: pim_ui_ajaxentity_list
entityClass: "%pim_catalog.entity.attribute_option.class%"
operators:
- IN
- EMPTY
- NOT EMPTY
entityClass: Flagbit\Bundle\TableAttributeBundle\Entity\AttributeOption
Expand Up @@ -14,10 +14,9 @@
use Akeneo\Pim\Structure\Component\Repository\AttributeRepositoryInterface;
use Akeneo\Tool\Component\StorageUtils\Repository\IdentifiableObjectRepositoryInterface;
use Flagbit\Bundle\TableAttributeBundle\AttributeType\TableType;
use Flagbit\Bundle\TableAttributeBundle\Component\Product\Factory\Value\TableValueFactory;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

class PimTest extends KernelTestCase
class TagsAndServiceOverridesTest extends KernelTestCase
{

public function testFlatToStandardConverterRegisters()
Expand Down
3 changes: 3 additions & 0 deletions tests/public/js/require-paths.js
@@ -0,0 +1,3 @@
module.exports = [
"../vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/UIBundle",
"../src"]

0 comments on commit 75d97db

Please sign in to comment.