Skip to content

Commit

Permalink
chore: more testing node-types
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Feb 8, 2022
1 parent 8f3376f commit 9644f2c
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 25 deletions.
24 changes: 24 additions & 0 deletions config/api_resources/nsarticle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
App\GeneratedEntity\NSArticle:
iri: Article
shortName: Article
collectionOperations:
get:
method: GET
normalization_context:
groups:
- nodes_sources_base
- nodes_sources_default
- urls
- tag_base
- translation_base
- document_display
itemOperations:
get:
method: GET
normalization_context:
groups:
- nodes_sources
- urls
- tag_base
- translation_base
- document_display
14 changes: 0 additions & 14 deletions config/api_resources/nsgroupblock.yml

This file was deleted.

24 changes: 24 additions & 0 deletions config/api_resources/nsoffer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
App\GeneratedEntity\NSOffer:
iri: Offer
shortName: Offer
collectionOperations:
get:
method: GET
normalization_context:
groups:
- nodes_sources_base
- nodes_sources_default
- urls
- tag_base
- translation_base
- document_display
itemOperations:
get:
method: GET
normalization_context:
groups:
- nodes_sources
- urls
- tag_base
- translation_base
- document_display
2 changes: 1 addition & 1 deletion src/DataTransformer/NSPageOutputDataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NSPageOutputDataTransformer extends NodesSourcesOutputDataTransformer
/**
* @inheritDoc
*/
public function transform($data, string $to, array $context = [])
public function transform($data, string $to, array $context = []): object
{
if (!$data instanceof NSPage) {
throw new \InvalidArgumentException('Data to transform must be instance of ' . NSPage::class);
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ importFiles:
groups: []
settings: []
nodetypes:
- src/Resources/node-types/Article.json
- src/Resources/node-types/BasicBlock.json
- src/Resources/node-types/GroupBlock.json
- src/Resources/node-types/Neutral.json
- src/Resources/node-types/Offer.json
- src/Resources/node-types/Page.json
28 changes: 28 additions & 0 deletions src/Resources/node-types/Article.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "Article",
"display_name": "Article",
"description": "Article",
"visible": true,
"publishable": false,
"reachable": true,
"hiding_nodes": false,
"hiding_non_reachable_nodes": false,
"color": "#000000",
"fields": [
{
"position": 1.0,
"name": "content",
"label": "Your content",
"type": 4,
"expanded": false,
"node_type_name": "Article",
"universal": false,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": false,
"visible": true
}
],
"default_ttl": 0,
"searchable": true
}
17 changes: 16 additions & 1 deletion src/Resources/node-types/Neutral.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
{
"name": "Neutral",
"display_name": "Neutral",
"description": "Neutral",
"visible": true,
"publishable": false,
"reachable": false,
"hiding_nodes": false,
"hiding_non_reachable_nodes": false,
"color": "#a8a8a8",
"fields": [],
"fields": [
{
"position": 1.0,
"name": "number",
"label": "Number",
"type": 6,
"expanded": false,
"node_type_name": "Neutral",
"universal": false,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": true,
"visible": true
}
],
"default_ttl": 0,
"searchable": true
}
41 changes: 41 additions & 0 deletions src/Resources/node-types/Offer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "Offer",
"display_name": "Offer",
"description": "Offer",
"visible": true,
"publishable": false,
"reachable": true,
"hiding_nodes": false,
"hiding_non_reachable_nodes": false,
"color": "#000000",
"fields": [
{
"position": 1.0,
"name": "price",
"label": "Price",
"type": 6,
"expanded": false,
"node_type_name": "Offer",
"universal": false,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": true,
"visible": true
},
{
"position": 2.0,
"name": "vat",
"label": "VAT",
"type": 7,
"expanded": false,
"node_type_name": "Offer",
"universal": false,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": false,
"visible": true
}
],
"default_ttl": 0,
"searchable": true
}
45 changes: 36 additions & 9 deletions src/Resources/node-types/Page.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "Page",
"display_name": "Page",
"description": "Page",
"visible": true,
"publishable": true,
"reachable": true,
Expand All @@ -22,6 +23,19 @@
"indexed": false,
"visible": true
},
{
"position": 2.0,
"name": "sub_title",
"label": "Sub-title",
"type": 0,
"expanded": false,
"node_type_name": "Page",
"universal": false,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": false,
"visible": true
},
{
"position": 2.0,
"name": "children",
Expand All @@ -37,13 +51,13 @@
"visible": true
},
{
"position": 2.0,
"name": "subtitle",
"label": "subtitle",
"type": 0,
"position": 3.0,
"name": "images",
"label": "Images",
"type": 9,
"expanded": false,
"node_type_name": "Page",
"universal": false,
"universal": true,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": false,
Expand All @@ -64,12 +78,12 @@
},
{
"position": 3.0,
"name": "images",
"label": "Images",
"type": 9,
"name": "over_title",
"label": "Overtitle",
"type": 0,
"expanded": false,
"node_type_name": "Page",
"universal": true,
"universal": false,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": false,
Expand All @@ -88,6 +102,19 @@
"indexed": false,
"visible": true
},
{
"position": 4.0,
"name": "test",
"label": "test",
"type": 0,
"expanded": false,
"node_type_name": "Page",
"universal": false,
"exclude_from_search": false,
"excluded_from_serialization": false,
"indexed": false,
"visible": true
},
{
"position": 5.0,
"name": "node_references",
Expand Down

0 comments on commit 9644f2c

Please sign in to comment.