Skip to content

Commit a8d4c71

Browse files
authored
IBX-9947: Rebranded field type identifiers (#87)
1 parent 7613c50 commit a8d4c71

File tree

13 files changed

+57
-57
lines changed

13 files changed

+57
-57
lines changed

doc/howto/custom_field_type.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Which one you choose depends if the field definition settings and constraints im
1919

2020
### Mapping with configuration
2121
You need to use a simple compiler pass to modify a container parameter, `ibexa.graphql.schema.content.mapping.field_definition_type`.
22-
It is a hash that maps a field type identifier (`ezstring`) to the following entries:
22+
It is a hash that maps a field type identifier (`ibexa_string`) to the following entries:
2323
- `value_type`: the GraphQL type values of this field are represented as. It can either be a native type
2424
(`String`, `Int`...), or a custom type that you will define.
2525
If not specified, `String` will be used.
@@ -161,7 +161,7 @@ class RelationFieldDefinitionMapper extends DecoratingFieldDefinitionMapper impl
161161
```
162162

163163
#### Mutation input type handling
164-
If the input for a field depends on the field definition, like `ezmatrix`
164+
If the input for a field depends on the field definition, like `ibexa_matrix`
165165
which generates its own input types depending on the configured columns, use `mapToFieldValueInputType`
166166
which returns a GraphQL type for a Field Definition.
167167

spec/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapperSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function it_maps_single_selection_to_resolve_single(): void
9898
private function createFieldDefinition(int $selectionLimit = 0, array $selectionContentTypes = []): FieldDefinition
9999
{
100100
return new FieldDefinition([
101-
'fieldTypeIdentifier' => 'ezobjectrelationlist',
101+
'fieldTypeIdentifier' => 'ibexa_object_relation_list',
102102
'fieldSettings' => [
103103
'selectionContentTypes' => $selectionContentTypes,
104104
],

spec/Schema/Domain/Content/Mapper/FieldDefinition/SelectionFieldDefinitionMapperSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class SelectionFieldDefinitionMapperSpec extends ObjectBehavior
1616
{
1717
public const FIELD_IDENTIFIER = 'test';
18-
public const TYPE_IDENTIFIER = 'ezselection';
18+
public const TYPE_IDENTIFIER = 'ibexa_selection';
1919

2020
public function let(FieldDefinitionMapper $innerMapper): void
2121
{

spec/Schema/Domain/Content/Worker/FieldDefinition/AddFieldDefinitionToItemTypeSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class AddFieldDefinitionToItemTypeSpec extends ObjectBehavior
2424
public const FIELD_IDENTIFIER = 'test_field';
2525
public const FIELD_NAME = 'testField';
2626
public const FIELD_DESCRIPTION = ['eng-GB' => 'Description'];
27-
public const FIELD_TYPE = 'ezstring';
27+
public const FIELD_TYPE = 'ibexa_string';
2828
public const FIELD_DEFINITION_TYPE = 'TestFieldDefinition';
2929

3030
/**

src/bundle/Resources/config/default_settings.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,84 @@ parameters:
22
ibexa.graphql.schema.content.field_name.override:
33
id: id_
44
ibexa.graphql.schema.content.mapping.field_definition_type:
5-
ezauthor:
5+
ibexa_author:
66
value_type: "[AuthorFieldValue]"
77
value_resolver: 'field !== null ? field.authors : null'
88
input_type: '[AuthorInput]'
9-
ezbinaryfile:
9+
ibexa_binaryfile:
1010
definition_type: BinaryFieldDefinition
1111
value_type: BinaryFileFieldValue
1212
input_type: BinaryFieldInput
13-
ezboolean:
13+
ibexa_boolean:
1414
definition_type: CheckboxFieldDefinition
1515
value_type: Boolean
1616
value_resolver: 'field !== null ? field.bool : null'
1717
input_type: Boolean
18-
ezcountry:
18+
ibexa_country:
1919
definition_type: CountryFieldDefinition
2020
value_type: String
2121
input_type: '[String]'
22-
ezdate:
22+
ibexa_date:
2323
value_type: DateTime
2424
value_resolver: 'field !== null ? field.date : null'
2525
input_type: DateFieldInput
26-
ezdatetime:
26+
ibexa_datetime:
2727
value_type: DateTime
2828
value_resolver: 'field !== null ? field.value : null'
2929
input_type: DateFieldInput
30-
ezemail:
30+
ibexa_email:
3131
value_type: String
32-
ezuser:
32+
ibexa_user:
3333
value_type: String
3434
value_resolver: 'field.id'
35-
ezfloat:
35+
ibexa_float:
3636
definition_type: FloatFieldDefinition
3737
value_type: Float
3838
value_resolver: 'field !== null ? field.value : null'
3939
input_type: Float
40-
ezgmaplocation:
40+
ibexa_gmap_location:
4141
value_type: MapLocationFieldValue
4242
input_type: 'MapLocationFieldInput'
43-
ezimage:
43+
ibexa_image:
4444
definition_type: BinaryFieldDefinition
4545
value_type: ImageFieldValue
4646
input_type: ImageFieldInput
47-
ezimageasset:
47+
ibexa_imageasset:
4848
value_type: ImageFieldValue
4949
value_resolver: 'query("DomainImageAssetFieldValue", field)'
50-
ezinteger:
50+
ibexa_integer:
5151
definition_type: IntegerFieldDefinition
5252
value_type: Int
5353
value_resolver: 'field !== null ? field.value : null'
5454
input_type: Int
55-
ezkeyword:
55+
ibexa_keyword:
5656
value_type: '[String]'
5757
value_resolver: 'field !== null ? field.values : null'
5858
input_type: '[String]'
59-
ezmedia:
59+
ibexa_media:
6060
definition_type: MediaFieldDefinition
6161
value_type: MediaFieldValue
6262
input_type: MediaFieldInput
63-
ezobjectrelation:
63+
ibexa_object_relation:
6464
definition_type: RelationFieldDefinition
6565
value_type: RelationFieldValue
6666
input_type: Int
67-
ezobjectrelationlist:
67+
ibexa_object_relation_list:
6868
definition_type: RelationListFieldDefinition
6969
value_type: RelationListFieldValue
7070
input_type: '[Int]'
71-
ezrichtext:
71+
ibexa_richtext:
7272
value_type: RichTextFieldValue
7373
input_type: RichTextFieldInput
74-
ezselection:
74+
ibexa_selection:
7575
definition_type: SelectionFieldDefinition
7676
input_type: '[Int]'
77-
ezstring:
77+
ibexa_string:
7878
definition_type: TextLineFieldDefinition
7979
value_type: String
80-
eztext:
80+
ibexa_text:
8181
definition_type: TextBlockFieldDefinition
8282
value_type: String
83-
ezurl:
83+
ibexa_url:
8484
value_type: UrlFieldValue
8585
input_type: UrlFieldInput

src/bundle/Resources/config/graphql/FieldDefinition.types.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ FieldDefinition:
3333
description: "The position of the field definition in the content type"
3434
fieldTypeIdentifier:
3535
type: String
36-
description: "The identifier of the field type (ezstring, ezinteger...)."
36+
description: "The identifier of the field type (ibexa_string, ibexa_integer...)."
3737
isThumbnail:
3838
type: Boolean
3939
description: "Indicates if this field can be a thumbnail."

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,108 +15,108 @@ services:
1515
arguments:
1616
$fieldType: '@Ibexa\Core\FieldType\Author\Type'
1717
tags:
18-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezauthor' }
18+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_author' }
1919

2020
Ibexa\GraphQL\Mutation\InputHandler\FieldType\BinaryFile:
2121
tags:
22-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezbinaryfile' }
22+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_binaryfile' }
2323

2424
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Boolean:
2525
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
2626
arguments:
2727
$fieldType: '@Ibexa\Core\FieldType\Checkbox\Type'
2828
tags:
29-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezboolean' }
29+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_boolean' }
3030

3131
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Country:
3232
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
3333
arguments:
3434
$fieldType: '@Ibexa\Core\FieldType\Country\Type'
3535
tags:
36-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezcountry' }
36+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_country' }
3737

3838
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Date:
3939
arguments:
4040
$fieldType: '@Ibexa\Core\FieldType\Date\Type'
4141
tags:
42-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezdate' }
42+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_date' }
4343

4444
Ibexa\GraphQL\Mutation\InputHandler\FieldType\DateAndTime:
4545
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\Date'
4646
arguments:
4747
$fieldType: '@Ibexa\Core\FieldType\DateAndTime\Type'
4848
tags:
49-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezdatetime' }
49+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_datetime' }
5050

5151
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Float:
5252
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
5353
arguments:
5454
$fieldType: '@Ibexa\Core\FieldType\Float\Type'
5555
tags:
56-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezfloat' }
56+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_float' }
5757

5858
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Email:
5959
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
6060
arguments:
6161
$fieldType: '@Ibexa\Core\FieldType\EmailAddress\Type'
6262
tags:
63-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezemail' }
63+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_email' }
6464

6565
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Image:
6666
tags:
67-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezimage' }
67+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_image' }
6868

6969
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Integer:
7070
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
7171
arguments:
7272
$fieldType: '@Ibexa\Core\FieldType\Integer\Type'
7373
tags:
74-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezinteger' }
74+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_integer' }
7575

7676
Ibexa\GraphQL\Mutation\InputHandler\FieldType\ISBN:
7777
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
7878
arguments:
7979
$fieldType: '@Ibexa\Core\FieldType\ISBN\Type'
8080
tags:
81-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezisbn' }
81+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_isbn' }
8282

8383
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Keyword:
8484
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
8585
arguments:
8686
$fieldType: '@Ibexa\Core\FieldType\Keyword\Type'
8787
tags:
88-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezkeyword' }
88+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_keyword' }
8989

9090
Ibexa\GraphQL\Mutation\InputHandler\FieldType\MapLocation:
9191
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
9292
arguments:
9393
$fieldType: '@Ibexa\Core\FieldType\MapLocation\Type'
9494
tags:
95-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezgmaplocation' }
95+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_gmap_location' }
9696

9797
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Media:
9898
tags:
99-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezmedia' }
99+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_media' }
100100

101101
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Relation:
102102
arguments:
103103
$fieldType: '@Ibexa\Core\FieldType\Relation\Type'
104104
tags:
105-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezobjectrelation' }
105+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_object_relation' }
106106

107107
Ibexa\GraphQL\Mutation\InputHandler\FieldType\RelationList:
108108
arguments:
109109
$fieldType: '@Ibexa\Core\FieldType\RelationList\Type'
110110
tags:
111-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezobjectrelationlist' }
111+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_object_relation_list' }
112112

113113
Ibexa\GraphQL\Mutation\InputHandler\FieldType\RichText:
114114
arguments:
115115
$inputConverters:
116116
html: '@Ibexa\GraphQL\Mutation\InputHandler\FieldType\RichText\HtmlRichTextConverter'
117117
markdown: '@Ibexa\GraphQL\Mutation\InputHandler\FieldType\RichText\MarkdownRichTextConverter'
118118
tags:
119-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezrichtext' }
119+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_richtext' }
120120

121121
Ibexa\GraphQL\Mutation\InputHandler\FieldType\RichText\HtmlRichTextConverter:
122122
arguments:
@@ -135,25 +135,25 @@ services:
135135
arguments:
136136
$fieldType: '@Ibexa\Core\FieldType\Selection\Type'
137137
tags:
138-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezselection' }
138+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_selection' }
139139

140140
Ibexa\GraphQL\Mutation\InputHandler\FieldType\TextBlock:
141141
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
142142
arguments:
143143
$fieldType: '@Ibexa\Core\FieldType\TextBlock\Type'
144144
tags:
145-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'eztext' }
145+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_text' }
146146

147147
Ibexa\GraphQL\Mutation\InputHandler\FieldType\TextLine:
148148
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
149149
arguments:
150150
$fieldType: '@Ibexa\Core\FieldType\TextLine\Type'
151151
tags:
152-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezstring' }
152+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_string' }
153153

154154
Ibexa\GraphQL\Mutation\InputHandler\FieldType\Url:
155155
class: 'Ibexa\GraphQL\Mutation\InputHandler\FieldType\FromHash'
156156
arguments:
157157
$fieldType: '@Ibexa\Core\FieldType\Url\Type'
158158
tags:
159-
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ezurl' }
159+
- { name: ibexa.graphql.field_type.input.handler, fieldtype: 'ibexa_url' }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ services:
129129
Ibexa\GraphQL\Resolver\ImageFieldResolver:
130130
arguments:
131131
$imageFieldType: '@Ibexa\Core\FieldType\Image\Type'
132-
$variationHandler: '@ibexa.field_type.ezimage.variation_service'
132+
$variationHandler: '@ibexa.field_type.ibexa_image.variation_service'
133133
$contentService: '@ibexa.siteaccessaware.service.content'
134134
tags:
135135
- { name: overblog_graphql.query, alias: "ImageVariations", method: "resolveImageVariations" }

src/lib/Mutation/InputHandler/FieldType/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function toFieldValue($input, $inputFormat = null): Value
2323
}
2424

2525
if (!in_array($inputFormat, ['timestring', 'rfc850', 'timestamp'])) {
26-
throw new UnsupportedFieldInputFormatException('ezdate', $inputFormat);
26+
throw new UnsupportedFieldInputFormatException('ibexa_date', $inputFormat);
2727
}
2828

2929
return parent::toFieldValue(

src/lib/Mutation/InputHandler/FieldType/RichText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function toFieldValue($input, $inputFormat = null): Value
3737
$this->inputConverters[$inputFormat]->convertToXml($input)
3838
);
3939
} else {
40-
throw new UnsupportedFieldInputFormatException('ezrichtext', $inputFormat);
40+
throw new UnsupportedFieldInputFormatException('ibexa_richtext', $inputFormat);
4141
}
4242

4343
return $fieldValue;

0 commit comments

Comments
 (0)