Skip to content

Commit 92b420f

Browse files
committed
Merge branch '4.6' into merge-ibx-10527
# Conflicts: # phpstan-baseline.neon # src/bundle/DependencyInjection/IbexaRestExtension.php # src/lib/Server/Controller/ContentType.php
2 parents 376a23f + 5f21d04 commit 92b420f

38 files changed

+1612
-12
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ jobs:
2929
- name: Run code style check
3030
run: composer run-script check-cs -- --format=checkstyle | cs2pr
3131

32-
rector:
33-
name: Run rector
34-
uses: ibexa/gh-workflows/.github/workflows/rector.yml@main
35-
3632
tests:
3733
name: Unit & integration tests
3834
runs-on: "ubuntu-24.04"

.github/workflows/rector.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Rector PHP
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '[0-9]+.[0-9]+'
8+
pull_request: ~
9+
10+
jobs:
11+
rector:
12+
name: Run rector
13+
runs-on: "ubuntu-22.04"
14+
strategy:
15+
matrix:
16+
php:
17+
- '8.3'
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
- uses: ibexa/gh-workflows/actions/composer-install@main
22+
with:
23+
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
24+
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
25+
26+
- name: Run rector
27+
run: vendor/bin/rector process --dry-run --ansi

phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ parameters:
150150
count: 1
151151
path: src/lib/Input/FieldTypeParser.php
152152

153-
-
154-
message: '#^Method Ibexa\\Rest\\Input\\Handler\\Json\:\:convert\(\) return type has no value type specified in iterable type array\.$#'
155-
identifier: missingType.iterableValue
156-
count: 1
157-
path: src/lib/Input/Handler/Json.php
158-
159153
-
160154
message: '#^Access to an undefined property DOMNode\:\:\$data\.$#'
161155
identifier: property.notFound

src/bundle/DependencyInjection/IbexaRestExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
4646
$loader->load('default_settings.yml');
4747
$loader->load('serializer.yaml');
4848
$loader->load('twig.yaml');
49+
$loader->load('criteria.yaml');
50+
$loader->load('sort_clauses.yaml');
4951

5052
$processor = new ConfigurationProcessor($container, 'ibexa.site_access.config');
5153
$processor->mapConfigArray('rest_root_resources', $mergedConfig);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"ViewInput": {
3+
"identifier": "ContentTypeView",
4+
"ContentTypeQuery": {
5+
"limit": "10",
6+
"offset": "1",
7+
"Query": {
8+
"ContentTypeIdCriterion": [1,2],
9+
"ContentTypeIdentifierCriterion": "folder",
10+
"IsSystemCriterion": true,
11+
"ContentTypeGroupIdCriterion": 1,
12+
"ContainsFieldDefinitionIdCriterion": 2
13+
},
14+
"SortClauses": {
15+
"Identifier": "descending",
16+
"Id": "ascending"
17+
}
18+
}
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ViewInput>
3+
<identifier>ContentTypeView</identifier>
4+
<ContentTypeQuery>
5+
<limit>10</limit>
6+
<offset>1</offset>
7+
<Query>
8+
<ContentTypeIdCriterion>1</ContentTypeIdCriterion>
9+
<ContentTypeIdCriterion>2</ContentTypeIdCriterion>
10+
<ContentTypeIdentifierCriterion>folder</ContentTypeIdentifierCriterion>
11+
<IsSystemCriterion>true</IsSystemCriterion>
12+
<ContentTypeGroupIdCriterion>1</ContentTypeGroupIdCriterion>
13+
<ContainsFieldDefinitionIdCriterion>2</ContainsFieldDefinitionIdCriterion>
14+
</Query>
15+
<SortClauses>
16+
<Identifier>descending</Identifier>
17+
<Id>ascending</Id>
18+
</SortClauses>
19+
</ContentTypeQuery>
20+
</ViewInput>

src/bundle/Resources/api_platform/schemas/content_types_schemas.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,77 @@ schemas:
400400
properties:
401401
ContentTypeList:
402402
$ref: "#/components/schemas/ContentTypeInfoList"
403+
ContentTypeQuery:
404+
description: This class represents a content type query.
405+
type: object
406+
properties:
407+
limit:
408+
description: The maximum number of results to return.
409+
type: integer
410+
offset:
411+
description: The offset to start returning results from.
412+
type: integer
413+
Query:
414+
description: An array of filters to apply to the query.
415+
type: object
416+
properties:
417+
ContentTypeIdCriterion:
418+
oneOf:
419+
- type: array
420+
items:
421+
type: integer
422+
- type: integer
423+
ContentTypeIdentifierCriterion:
424+
oneOf:
425+
- type: array
426+
items:
427+
type: string
428+
- type: string
429+
IsSystemCriterion:
430+
type: boolean
431+
ContentTypeGroupIdCriterion:
432+
oneOf:
433+
- type: array
434+
items:
435+
type: integer
436+
- type: integer
437+
ContainsFieldDefinitionIdCriterion:
438+
oneOf:
439+
- type: array
440+
items:
441+
type: integer
442+
- type: integer
443+
SortClauses:
444+
description: An array of sort clauses to apply to the query.
445+
type: object
446+
properties:
447+
Id:
448+
type: string
449+
enum: [ ascending, descending ]
450+
Identifier:
451+
type: string
452+
enum: [ ascending, descending ]
453+
ContentTypeViewInput:
454+
description: This class represents a content type view input.
455+
xml:
456+
name: ViewInput
457+
type: object
458+
required:
459+
- identifier
460+
- ContentTypeQuery
461+
properties:
462+
identifier:
463+
description: The identifier of a view.
464+
type: string
465+
ContentTypeQuery:
466+
$ref: "#/components/schemas/ContentTypeQuery"
467+
ContentTypeViewInputWrapper:
468+
type: object
469+
required:
470+
- ViewInput
471+
properties:
472+
ViewInput:
473+
$ref: "#/components/schemas/ContentTypeViewInput"
403474
Field:
404475
description: This class represents a field of a content item.
405476
type: object
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
services:
2+
_instanceof:
3+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\ContentTypeCriterionInterface:
4+
tags:
5+
- 'ibexa.rest.content_type.criterion'
6+
7+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\CriterionProcessor:
8+
parent: Ibexa\Contracts\Rest\Input\Parser\Query\Criterion\BaseCriterionProcessor
9+
10+
Ibexa\Rest\Server\Input\Parser\ContentType\SortClause\SortClauseProcessor:
11+
parent: Ibexa\Contracts\Rest\Input\Parser\Query\SortClause\BaseSortClauseProcessor
12+
13+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\ContentTypeCriteriaRegistry:
14+
arguments:
15+
- !tagged_iterator ibexa.rest.content_type.criterion
16+
17+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\ContentTypeId:
18+
parent: Ibexa\Rest\Server\Common\Parser
19+
tags:
20+
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.ContentTypeId }
21+
22+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\ContentTypeIdentifier:
23+
parent: Ibexa\Rest\Server\Common\Parser
24+
tags:
25+
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.ContentTypeIdentifier }
26+
27+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\IsSystem:
28+
parent: Ibexa\Rest\Server\Common\Parser
29+
tags:
30+
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.IsSystem }
31+
32+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\ContentTypeGroupId:
33+
parent: Ibexa\Rest\Server\Common\Parser
34+
tags:
35+
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.ContentTypeGroupId }
36+
37+
Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\ContainsFieldDefinitionId:
38+
parent: Ibexa\Rest\Server\Common\Parser
39+
tags:
40+
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.ContainsFieldDefinitionId }

src/bundle/Resources/config/input_parsers.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ services:
6262
tags:
6363
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.ContentTypeUpdate }
6464

65+
Ibexa\Rest\Server\Input\Parser\ContentType\RestViewInput:
66+
parent: Ibexa\Rest\Server\Common\Parser
67+
arguments:
68+
$validator: '@validator'
69+
tags:
70+
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.ContentTypeViewInput }
71+
72+
Ibexa\Rest\Server\Input\Parser\ContentType\Query\ContentTypeQuery:
73+
parent: Ibexa\Rest\Server\Common\Parser
74+
arguments:
75+
$criterionProcessor: '@Ibexa\Rest\Server\Input\Parser\ContentType\Criterion\CriterionProcessor'
76+
$sortClauseProcessor: '@Ibexa\Rest\Server\Input\Parser\ContentType\SortClause\SortClauseProcessor'
77+
tags:
78+
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.ContentTypeQuery }
79+
6580
Ibexa\Rest\Server\Input\Parser\FieldDefinitionCreate:
6681
parent: Ibexa\Rest\Server\Common\Parser
6782
class: Ibexa\Rest\Server\Input\Parser\FieldDefinitionCreate

src/bundle/Resources/config/routing.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,13 @@ ibexa.rest.list_content_types:
575575
controller: Ibexa\Rest\Server\Controller\ContentType\ContentTypeListController::listContentTypes
576576
methods: [GET]
577577

578+
ibexa.rest.content_types.view:
579+
path: /content/types/view
580+
methods: [ POST ]
581+
controller: Ibexa\Rest\Server\Controller\ContentType\ContentTypeCreateViewController::createView
582+
options:
583+
expose: true
584+
578585
ibexa.rest.copy_content_type:
579586
path: /content/types/{contentTypeId}
580587
controller: Ibexa\Rest\Server\Controller\ContentType\ContentTypeCopyController::copyContentType

0 commit comments

Comments
 (0)