Skip to content

Commit

Permalink
feat: Added NumericFilter on node.position, added new node_listing
Browse files Browse the repository at this point in the history
…serialization group
  • Loading branch information
ambroisemaupate committed Aug 28, 2023
1 parent 6eb85cf commit a73b5b2
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/api_resources/nsarticle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ App\GeneratedEntity\NSArticle:
normalizationContext:
groups:
- nodes_sources
- node_listing
- urls
- tag_base
- translation_base
Expand All @@ -48,6 +49,7 @@ App\GeneratedEntity\NSArticle:
enable_max_depth: true
groups:
- nodes_sources
- node_listing
- urls
- tag_base
- translation_base
Expand Down
1 change: 1 addition & 0 deletions config/api_resources/nsarticlefeedblock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ App\GeneratedEntity\NSArticleFeedBlock:
normalizationContext:
groups:
- nodes_sources
- node_listing
- urls
- tag_base
- translation_base
Expand Down
2 changes: 2 additions & 0 deletions config/api_resources/nspage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ App\GeneratedEntity\NSPage:
normalizationContext:
groups:
- nodes_sources
- node_listing
- urls
- tag_base
- translation_base
Expand All @@ -52,6 +53,7 @@ App\GeneratedEntity\NSPage:
enable_max_depth: true
groups:
- nodes_sources
- node_listing
- urls
- tag_base
- translation_base
Expand Down
1 change: 1 addition & 0 deletions config/api_resources/web_response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RZ\Roadiz\CoreBundle\Api\Model\WebResponse:
- children
- children_count
- nodes_sources
- node_listing
- urls
- tag_base
- translation_base
Expand Down
1 change: 1 addition & 0 deletions lib/RoadizCoreBundle/config/api_resources/web_response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RZ\Roadiz\CoreBundle\Api\Model\WebResponse:
- children
- children_count
- nodes_sources
- node_listing
- urls
- tag_base
- translation_base
Expand Down
4 changes: 2 additions & 2 deletions lib/RoadizCoreBundle/src/Entity/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ class Node extends AbstractDateTimedPositioned implements LeafInterface, Attribu

#[ORM\Column(name: 'children_order', type: 'string', length: 50)]
#[SymfonySerializer\Groups(['node'])]
#[Serializer\Groups(['node'])]
#[Serializer\Groups(['node', 'node_listing'])]
#[Assert\Length(max: 50)]
#[Gedmo\Versioned]
private string $childrenOrder = 'position';

#[ORM\Column(name: 'children_order_direction', type: 'string', length: 4)]
#[SymfonySerializer\Groups(['node'])]
#[Serializer\Groups(['node'])]
#[Serializer\Groups(['node', 'node_listing'])]
#[Assert\Length(max: 4)]
#[Gedmo\Versioned]
private string $childrenOrderDirection = 'ASC';
Expand Down
3 changes: 3 additions & 0 deletions lib/RoadizCoreBundle/src/Entity/NodesSources.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ class NodesSources extends AbstractEntity implements Loggable
"node.createdAt",
"node.updatedAt"
])]
#[ApiFilter(BaseFilter\NumericFilter::class, properties: [
"node.position",
])]
#[ApiFilter(BaseFilter\DateFilter::class, properties: [
"node.createdAt",
"node.updatedAt"
Expand Down
1 change: 1 addition & 0 deletions lib/RoadizCoreBundle/src/NodeType/ApiResourceGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ protected function getItemOperations(NodeTypeInterface $nodeType): array
{
$groups = [
"nodes_sources",
"node_listing",
"urls",
"tag_base",
"translation_base",
Expand Down

0 comments on commit a73b5b2

Please sign in to comment.