Skip to content

Commit b7f6bf3

Browse files
author
Antonio Mansilla
authored
Merge pull request #26 from flagbit/2.X
Update master with latest changes from `2.X` branch.
2 parents a5ee4c7 + 3fbb6d9 commit b7f6bf3

File tree

5 files changed

+161
-37
lines changed

5 files changed

+161
-37
lines changed

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributing
2+
3+
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
4+
5+
## Branch Compatibility
6+
7+
| Branch | Akeneo Compatibility |
8+
| ------------- |:-------------:|
9+
| `master` | `>= 2.0.5 & < 3.0.0` |
10+
| `2.0` | `>= 2.0.0 & < 2.0.5` |
11+
| `1.X` | `>= 1.6.0 & < 2.0.0` |

README.md

Lines changed: 69 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,60 @@
1-
# Flagbit TableAttributeBundle for Akeneo PIM #
1+
<h1 align="center">
2+
Flagbit Table Attribute for Akeneo PIM
3+
<br>
4+
</h1>
5+
6+
<h4 align="center">Adds the new attribute type Table for Akeneo products.</h4>
7+
8+
<p align="center">
9+
<a href="https://travis-ci.org/flagbit/akeneo-table-attribute-bundle">
10+
<img src="https://img.shields.io/travis/flagbit/akeneo-table-attribute-bundle/master.svg?style=flat-square"/>
11+
</a>
12+
<img src="https://poser.pugx.org/flagbit/table-attribute-bundle/downloads?format=flat-square">
13+
<a href="https://scrutinizer-ci.com/g/Flagbit/akeneo-table-attribute-bundle">
14+
<img src="https://img.shields.io/scrutinizer/g/flagbit/akeneo-table-attribute-bundle.svg?style=flat-square">
15+
</a>
16+
<a href="https://packagist.org/packages/flagbit/table-attribute-bundle">
17+
<img src="https://img.shields.io/packagist/v/flagbit/table-attribute-bundle.svg?style=flat-square">
18+
</a>
19+
<a href="LICENSE">
20+
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square">
21+
</a>
22+
</p>
23+
24+
<p align="center">
25+
<a href="#key-features">Key Features</a> •
26+
<a href="#installation">Installation</a> •
27+
<a href="#compatibility">Compatibility</a> •
28+
<a href="#development">Development</a> •
29+
<a href="#contributing">Contributing</a>
30+
</p>
31+
32+
## Key Features
33+
34+
Provides a _table_ as attribute type where you can define a set of columns of different types and validation rules.
35+
36+
#### Column Types
237

3-
[![Build Status](https://img.shields.io/travis/flagbit/akeneo-table-attribute-bundle/master.svg?style=flat-square)](https://travis-ci.org/flagbit/akeneo-table-attribute-bundle)
4-
[![Quality Score](https://img.shields.io/scrutinizer/g/flagbit/akeneo-table-attribute-bundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/Flagbit/akeneo-table-attribute-bundle)
5-
[![Packagist Version](https://img.shields.io/packagist/v/flagbit/table-attribute-bundle.svg?style=flat-square)](https://packagist.org/packages/flagbit/table-attribute-bundle)
6-
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
38+
* Text
39+
* Number (Integer or Decimal)
40+
* Simple select
41+
* Simple select from URL
42+
43+
#### Import/Export
744

8-
Adds the new attribute type *Table* for Akeneo products.
45+
The extension supports the standard Akeneo product import/export, so you don't need to create any special import/export profile for table information.
946

10-
## Installation ##
47+
All product information related to attributes of type _table_ will be imported/exported as JSON.
1148

12-
Now you can simply install the package with the following command.
49+
## Installation
50+
51+
Simply install the package with the following command:
1352

1453
``` bash
1554
composer require flagbit/table-attribute-bundle
1655
```
1756

18-
### Enable the bundle ###
57+
### Enable the bundle
1958

2059
Enable the bundle in the kernel:
2160

@@ -33,9 +72,9 @@ protected function registerProjectBundles()
3372
}
3473
```
3574

36-
### Configuration ###
75+
### Configuration
3776

38-
Add to config yml to `mapping_overrides` in `app/config/config.yml`:
77+
Add `mapping_overrides` in `app/config/config.yml`:
3978

4079
``` yml
4180
akeneo_storage_utils:
@@ -45,7 +84,7 @@ akeneo_storage_utils:
4584
override: Flagbit\Bundle\TableAttributeBundle\Entity\AttributeOption
4685
```
4786
48-
Clear your cache:
87+
Clear the cache:
4988
5089
``` bash
5190
php bin/console --env=prod cache:clear
@@ -60,7 +99,7 @@ php bin/console --env=prod doctrine:schema:update --force
6099
Build and install the new front-end dependencies (new icon, etc.)
61100

62101
``` bash
63-
php bin/console pim:installer:assets --symlink --clean --env=prod
102+
php bin/console --env=prod pim:installer:assets --symlink --clean
64103
yarn run webpack
65104
```
66105

@@ -76,30 +115,16 @@ and migrate the schema updates:
76115
php bin/console --env=prod doctrine:migrations:migrate
77116
```
78117

79-
## Features ##
80-
81-
Provides a the table as attribute type where you can define a set of columns of different types and validation rules.
82-
83-
#### Column Types ####
84-
* Text
85-
* Number (Integer or Decimal)
86-
* Simple select
87-
* Simple select from URL
88-
89-
#### Import/Export ####
90-
The extension supports the standard Akeneo product import/export, so you don't need to create any special import/export
91-
profile for table information.
92-
93-
All product information related to attributes of type _table_ will be imported/exported as JSON.
94-
95-
## Akeneo Compatibility ##
118+
## Compatibility
96119

97120
This extension supports the latest Akeneo PIM CE/EE stable versions:
98121

99122
* 2.3 (LTS)
100123
* 2.1 and 2.2 (STS)
101124

102-
## Running Test-Suits ##
125+
## Development
126+
127+
### Running Test-Suits
103128

104129
The TableAttributeBundle is covered with tests and every change and addition has also to be covered with
105130
unit or/and integration tests. It uses two testing suits: [PHPSpec](https://www.phpspec.net) and
@@ -112,7 +137,7 @@ vendor/bin/phpunit
112137
vendor/bin/phpspec run
113138
```
114139

115-
## Coding style ##
140+
### Coding style
116141

117142
TableAttributeBundle uses the [PSR-2](https://www.php-fig.org/psr/psr-2/) coding style and can be checked with
118143
[Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer).
@@ -121,6 +146,16 @@ TableAttributeBundle uses the [PSR-2](https://www.php-fig.org/psr/psr-2/) coding
121146
vendor/bin/phpcs --standard=PSR2 --extensions=php ./src
122147
```
123148

124-
## License ##
149+
## Contributing
150+
151+
Contributions are always welcome! Please have a look at the [contribution guidelines](CONTRIBUTING.md) first.
152+
153+
## License
154+
155+
The TableAttributeBundle is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
156+
157+
#
125158

126-
The TableAttributeBundle is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
159+
<p align="center">
160+
Supported with ❤ by <a href="https://www.flagbit.de">Flagbit GmbH & Co. KG</a>
161+
</p>

src/Resources/public/js/Json/Renderer/Constraint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ define(
3939
$dropdown.appendChild($option);
4040
});
4141

42-
var $select2 = jQuery($dropdown).select2();
42+
var $select2 = jQuery($dropdown).select2({dropdownAutoWidth: true});
4343

4444
observeChanges($select2);
4545
};

src/Resources/public/js/product/field/table-field.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ define([
152152

153153
init = function (td, column, value) {
154154
var select2Config = {
155-
placeholder: ' '
155+
placeholder: ' ',
156+
dropdownAutoWidth: true
156157
};
157158
if ('options' in column.config) {
158159
var options = [];
@@ -178,7 +179,8 @@ define([
178179

179180
init = function (td, column, value) {
180181
var select2Config = {
181-
placeholder: ' '
182+
placeholder: ' ',
183+
dropdownAutoWidth: true
182184
};
183185
if ('options_url' in column.config) {
184186
select2Config.ajax = {

0 commit comments

Comments
 (0)