Skip to content

Commit fa9a093

Browse files
authored
IBX-9947: Rebranded field type identifiers (#70)
1 parent 2f67bb9 commit fa9a093

File tree

20 files changed

+42
-41
lines changed

20 files changed

+42
-41
lines changed

src/bundle/Resources/config/services/fieldtype.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
parameters:
2-
ibexa.field_type.matrix.identifier: 'ezmatrix'
2+
ibexa.field_type.matrix.identifier: 'ibexa_matrix'
3+
ibexa.field_type.matrix.legacy_identifier: 'ezmatrix'
34

45
services:
56
_defaults:
@@ -15,7 +16,7 @@ services:
1516
arguments:
1617
$fieldTypeIdentifier: '%ibexa.field_type.matrix.identifier%'
1718
tags:
18-
- { name: ibexa.field_type, alias: '%ibexa.field_type.matrix.identifier%' }
19+
- { name: ibexa.field_type, alias: '%ibexa.field_type.matrix.identifier%', legacy_alias: '%ibexa.field_type.matrix.legacy_identifier%' }
1920

2021
Ibexa\FieldTypeMatrix\FieldType\Converter\MatrixConverter:
2122
tags:

src/bundle/Resources/config/services/graphql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222

2323
Ibexa\FieldTypeMatrix\GraphQL\InputHandler:
2424
tags:
25-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: ezmatrix }
25+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: ibexa_matrix }
2626

2727
Ibexa\FieldTypeMatrix\GraphQL\FieldValueResolver:
2828
arguments:

src/bundle/Resources/encore/ibexa.config.manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = (ibexaConfig, ibexaConfigManager) => {
1010
ibexaConfigManager.add({
1111
ibexaConfig,
1212
entryName: 'ibexa-admin-ui-content-edit-parts-js',
13-
newItems: [path.resolve(__dirname, '../public/js/scripts/fieldType/ezmatrix.js')],
13+
newItems: [path.resolve(__dirname, '../public/js/scripts/fieldType/ibexa_matrix.js')],
1414
});
1515

1616
ibexaConfigManager.add({

src/bundle/Resources/public/js/scripts/fieldType/ezmatrix.js renamed to src/bundle/Resources/public/js/scripts/fieldType/ibexa_matrix.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
const SELECTOR_ADD_MATRIX_ENTRY = '.ibexa-btn--add-matrix-entry';
55
const SELECTOR_MATRIX_ENTRIES_CONTAINER = '.ibexa-table__body';
66
const SELECTOR_MATRIX_ENTRY_TEMPLATE = '.ibexa-data-source__entry-template';
7-
const SELECTOR_MATRIX_ENTRY_CHECKBOX = '.ibexa-table__ezmatrix-entry-checkbox';
7+
const SELECTOR_MATRIX_ENTRY_CHECKBOX = '.ibexa-table__ibexa_matrix-entry-checkbox';
88
const SELECTOR_MATRIX_ENTRY = '.ibexa-table__matrix-entry';
9-
const SELECTOR_FIELD = '.ibexa-field-edit--ezmatrix';
9+
const SELECTOR_FIELD = '.ibexa-field-edit--ibexa_matrix';
1010
const NUMBER_PLACEHOLDER = /__index__/g;
1111

1212
if (!doc.querySelector(SELECTOR_FIELD)) {
1313
return;
1414
}
1515

16-
class EzMatrixValidator extends ibexa.BaseFieldValidator {
16+
class IbexaMatrixValidator extends ibexa.BaseFieldValidator {
1717
/**
1818
* Adds an item.
1919
*
2020
* @method addItem
2121
* @param {Event} event
22-
* @memberof EzMatrixValidator
22+
* @memberof IbexaMatrixValidator
2323
*/
2424
addItem(event) {
2525
const matrixNode = event.target.closest(SELECTOR_FIELD);
@@ -51,7 +51,7 @@
5151
* @param {HTMLElement} parentNode
5252
* @param {String} template
5353
* @returns {String}
54-
* @memberof EzMatrixValidator
54+
* @memberof IbexaMatrixValidator
5555
*/
5656
setIndex(parentNode, template) {
5757
return template.replace(NUMBER_PLACEHOLDER, this.getNextIndex(parentNode));
@@ -62,7 +62,7 @@
6262
*
6363
* @method updateDisabledState
6464
* @param {HTMLElement} parentNode
65-
* @memberof EzMatrixValidator
65+
* @memberof IbexaMatrixValidator
6666
*/
6767
updateDisabledState(parentNode) {
6868
const isEnabled = this.findCheckedEntries(parentNode).length > 0;
@@ -76,7 +76,7 @@
7676
*
7777
* @method removeItem
7878
* @param {Event} event
79-
* @memberof EzMatrixValidator
79+
* @memberof IbexaMatrixValidator
8080
*/
8181
removeItems(event) {
8282
const matrixNode = event.target.closest(SELECTOR_FIELD);
@@ -107,7 +107,7 @@
107107
* Attaches event listeners based on a config.
108108
*
109109
* @method init
110-
* @memberof EzMatrixValidator
110+
* @memberof IbexaMatrixValidator
111111
*/
112112
init() {
113113
super.init();
@@ -130,7 +130,7 @@
130130
}
131131
}
132132

133-
const validator = new EzMatrixValidator({
133+
const validator = new IbexaMatrixValidator({
134134
classInvalid: 'is-invalid',
135135
fieldSelector: SELECTOR_FIELD,
136136
eventsMap: [

src/bundle/Resources/public/scss/fieldType/_ezmatrix.scss renamed to src/bundle/Resources/public/scss/fieldType/_ibexa_matrix.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@use '@ibexa-admin-ui/src/bundle/Resources/public/scss/functions/calculate.rem' as *;
22

3-
.ibexa-field-edit--ezmatrix {
3+
.ibexa-field-edit--ibexa_matrix {
44
.ibexa-data-source__field {
55
.ibexa-form-error {
66
display: none;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@use 'fieldType/ezmatrix';
1+
@use 'fieldType/ibexa_matrix';

src/bundle/Resources/translations/ibexa_fieldtypes.en.xliff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
77
</header>
88
<body>
9-
<trans-unit id="9b320b4900667da4bd9353127c1f70114587bec4" resname="ezmatrix.name">
9+
<trans-unit id="9b320b4900667da4bd9353127c1f70114587bec4" resname="ibexa_matrix.name">
1010
<source>Matrix</source>
1111
<target state="new">Matrix</target>
12-
<note>key: ezmatrix.name</note>
12+
<note>key: ibexa_matrix.name</note>
1313
</trans-unit>
1414
</body>
1515
</file>

src/bundle/Resources/translations/ibexa_matrix_fieldtype.en.xliff

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
77
</header>
88
<body>
9-
<trans-unit id="bc68ce8e6e2d293ef01129f0238e11152df66ca6" resname="ezmatrix.add">
9+
<trans-unit id="bc68ce8e6e2d293ef01129f0238e11152df66ca6" resname="ibexa_matrix.add">
1010
<source>Add</source>
1111
<target state="new">Add</target>
12-
<note>key: ezmatrix.add</note>
12+
<note>key: ibexa_matrix.add</note>
1313
</trans-unit>
14-
<trans-unit id="f5aef330799a7345c75e72279e06eb9f5b7d0da9" resname="ezmatrix.remove">
14+
<trans-unit id="f5aef330799a7345c75e72279e06eb9f5b7d0da9" resname="ibexa_matrix.remove">
1515
<source>Delete</source>
1616
<target state="new">Delete</target>
17-
<note>key: ezmatrix.remove</note>
17+
<note>key: ibexa_matrix.remove</note>
1818
</trans-unit>
1919
<trans-unit id="8422049ef51bbcd967ea5578aee3ed094edd252c" resname="field.column.add_new">
2020
<source>Add</source>
@@ -41,10 +41,10 @@
4141
<target state="new">Columns</target>
4242
<note>key: field.columns</note>
4343
</trans-unit>
44-
<trans-unit id="07c51cf854c53ebcc11d9261c7ca5b0772d7f7a4" resname="field_definition.ezmatrix.minimum_rows">
44+
<trans-unit id="07c51cf854c53ebcc11d9261c7ca5b0772d7f7a4" resname="field_definition.ibexa_matrix.minimum_rows">
4545
<source>Minimum number of rows</source>
4646
<target state="new">Minimum number of rows</target>
47-
<note>key: field_definition.ezmatrix.minimum_rows</note>
47+
<note>key: field_definition.ibexa_matrix.minimum_rows</note>
4848
</trans-unit>
4949
<trans-unit id="fc0bcd313cd08b3ce3b2380d4cc714c20047a5c0" resname="fieldtype.column.identifier">
5050
<source>Identifier</source>

src/bundle/Resources/views/themes/admin/matrix_fieldtype/content_edit_form_fields.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% trans_default_domain 'ibexa_matrix_fieldtype' %}
22

3-
{% block ezplatform_fieldtype_ezmatrix_widget %}
3+
{% block ezplatform_fieldtype_ibexa_matrix_widget %}
44
{% set readonly = attr.readonly|default(false) %}
55

66
<script type="text/template" class="ibexa-data-source__entry-template">
@@ -40,7 +40,7 @@
4040
<svg class="ibexa-icon ibexa-icon--small ibexa-icon--edit">
4141
<use xlink:href="{{ ibexa_icon_path('create') }}"></use>
4242
</svg>
43-
<span class="ibexa-btn__label">{{ 'ezmatrix.add'|trans|desc('Add') }}</span>
43+
<span class="ibexa-btn__label">{{ 'ibexa_matrix.add'|trans|desc('Add') }}</span>
4444
</button>
4545
<button
4646
type="button"
@@ -50,7 +50,7 @@
5050
<svg class="ibexa-icon ibexa-icon--small ibexa-icon--edit">
5151
<use xlink:href="{{ ibexa_icon_path('trash') }}"></use>
5252
</svg>
53-
<span class="ibexa-btn__label">{{ 'ezmatrix.remove'|trans|desc('Delete') }}</span>
53+
<span class="ibexa-btn__label">{{ 'ibexa_matrix.remove'|trans|desc('Delete') }}</span>
5454
</button>
5555
{% endblock %}
5656
{% endembed %}
@@ -61,12 +61,12 @@
6161
{% endembed %}
6262
{% endblock %}
6363

64-
{% block ezplatform_fieldtype_ezmatrix_entry_row %}
64+
{% block ezplatform_fieldtype_ibexa_matrix_entry_row %}
6565
{% set readonly = attr.readonly|default(false) %}
6666
{% set col_checkbox %}
6767
<input
6868
type="checkbox"
69-
class="ibexa-input ibexa-input--checkbox ibexa-table__ezmatrix-entry-checkbox"
69+
class="ibexa-input ibexa-input--checkbox ibexa-table__ibexa_matrix-entry-checkbox"
7070
{{ readonly ? 'disabled' }}
7171
>
7272
{% endset %}

src/bundle/Resources/views/themes/admin/matrix_fieldtype/content_fields.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% trans_default_domain 'ibexa_matrix_fieldtype' %}
22

3-
{% block ezmatrix_field %}
3+
{% block ibexa_matrix_field %}
44
{% set columnsSettings = fieldSettings['columns'] %}
55
{% set fieldData = field.value.rows %}
66

0 commit comments

Comments
 (0)