Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @author Baptiste Meyer <[email protected]>
*/
final class InnerFieldsNameConverter implements AdvancedNameConverterInterface
final class InnerFieldsNameConverter implements NameConverterInterface, AdvancedNameConverterInterface
{
public function __construct(private readonly NameConverterInterface $inner = new CamelCaseToSnakeCaseNameConverter())
{
Expand Down
2 changes: 1 addition & 1 deletion src/JsonApi/Serializer/ReservedAttributeNameConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @author Baptiste Meyer <[email protected]>
*/
final class ReservedAttributeNameConverter implements AdvancedNameConverterInterface
final class ReservedAttributeNameConverter implements NameConverterInterface, AdvancedNameConverterInterface
{
public const JSON_API_RESERVED_ATTRIBUTES = [
'id' => '_id',
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/Resources/config/doctrine_mongodb_odm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<service id="api_platform.doctrine_mongodb.odm.state.collection_provider" class="ApiPlatform\Doctrine\Odm\State\CollectionProvider" public="false">
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
<argument type="service" id="doctrine_mongodb" />
<argument type="tagged" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.collection" />
<argument type="tagged_iterator" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.collection" />
<argument type="tagged_locator" tag="api_platform.doctrine.odm.links_handler" index-by="key" />

<tag name="api_platform.state_provider" priority="-100" key="ApiPlatform\Doctrine\Odm\State\CollectionProvider" />
Expand All @@ -165,7 +165,7 @@
<service id="api_platform.doctrine_mongodb.odm.state.item_provider" class="ApiPlatform\Doctrine\Odm\State\ItemProvider" public="false">
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
<argument type="service" id="doctrine_mongodb" />
<argument type="tagged" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.item" />
<argument type="tagged_iterator" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.item" />
<argument type="tagged_locator" tag="api_platform.doctrine.odm.links_handler" index-by="key" />

<tag name="api_platform.state_provider" priority="-100" key="ApiPlatform\Doctrine\Odm\State\ItemProvider" />
Expand Down
111 changes: 53 additions & 58 deletions src/Symfony/Bundle/Resources/views/DataCollector/request.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -139,67 +139,62 @@
</div>
</div>
{% if dataCollected.resourceMetadataCollection is not empty %}
<div class="sf-tabs">
<div class="tab">
<h3 class="tab-title metadata-tab-title">Metadata</h3>
<h3>Resources</h3>
<div class="tab-content metadata-tab-content">
<div class="sf-tabs">
{% for resourceMetadata in dataCollected.resourceMetadataCollection %}
<div class="tab">
<h3 class="tab-title">
{{ resourceMetadata.resource.uriTemplate ?? resourceMetadata.resource.shortName }}
</h3>
<div class="tab-content">
<table>
<thead>
<tr>
<th scope="col" class="key">Resource</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{- profiler_dump(resourceMetadata.resource, 1) -}}</td>
</tr>
</tbody>
</table>
{{ apiPlatform.operationTable(resourceMetadata.operations, '', dataCollected.requestAttributes.operation_name|default('')) }}
<table>
<thead>
<tr>
<th scope="col" class="key">Filters</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% if dataCollected.filters and loop.index0 in dataCollected.filters|keys %}
{% for id, filter in dataCollected.filters[loop.index0] %}
{% set ignored_filter = filter is same as(null) %}
<tr{% if ignored_filter %} class="status-warning"{% endif %}>
<td>
{{ id }}
{% if ignored_filter %}
<span class="newline text-muted">ignored filter</span>
{% else %}
{{ dump(filter) }}
{% endif %}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="text-muted" colspan="2">
No available filter declared for this resource.
<h3>Resources</h3>
<div class="tab-content metadata-tab-content">
<div class="sf-tabs">
{% for resourceMetadata in dataCollected.resourceMetadataCollection %}
<div class="tab">
<h3 class="tab-title">
{{ resourceMetadata.resource.uriTemplate ?: resourceMetadata.resource.shortName }}
</h3>
<div class="tab-content">
<table>
<thead>
<tr>
<th scope="col" class="key">Resource</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{- profiler_dump(resourceMetadata.resource, 1) -}}</td>
</tr>
</tbody>
</table>
{{ apiPlatform.operationTable(resourceMetadata.operations, '', dataCollected.requestAttributes.operation_name|default('')) }}
<table>
<thead>
<tr>
<th scope="col" class="key">Filters</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% if dataCollected.filters and loop.index0 in dataCollected.filters|keys %}
{% for id, filter in dataCollected.filters[loop.index0] %}
{% set ignored_filter = filter is same as(null) %}
<tr{% if ignored_filter %} class="status-warning"{% endif %}>
<td>
{{ id }}
{% if ignored_filter %}
<span class="newline text-muted">ignored filter</span>
{% else %}
{{ dump(filter) }}
{% endif %}
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
{% endfor %}
{% endfor %}
{% else %}
<tr>
<td class="text-muted" colspan="2">
No available filter declared for this resource.
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions tests/.ignored-deprecations
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
%Since api-platform/core 3.4: Injecting the "ApiPlatform\\JsonSchema\\TypeFactoryInterface" inside "ApiPlatform\\OpenApi\\Factory\\OpenApiFactory" is deprecated and "ApiPlatform\\JsonSchema\\TypeFactoryInterface" will be removed in 4.x.%
%Since api-platform/core 3.3: Use a "ApiPlatform\\State\\ProviderInterface" as first argument in "ApiPlatform\\Symfony\\EventListener\\QueryParameterValidateListener" instead of "ApiPlatform\\ParameterValidator\\ParameterValidator".%
%Use quoteSingleIdentifier\(\) individually for each part of a qualified name instead.%
%class implements "Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface" that is deprecated since Symfony 7.2, use NameConverterInterface instead.%
1 change: 1 addition & 0 deletions tests/.ignored-deprecations-legacy-events
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
%Since symfony/validator 7.1: Not passing a value for the "requireTld" option to the Url constraint is deprecated. Its default value will change to "true".%
%Since api-platform/core 3.4: Injecting the "ApiPlatform\\JsonSchema\\TypeFactoryInterface" inside "ApiPlatform\\JsonSchema\\SchemaFactory" is deprecated and "ApiPlatform\\JsonSchema\\TypeFactoryInterface" will be removed in 4.x.%
%Since api-platform/core 3.4: Injecting the "ApiPlatform\\JsonSchema\\TypeFactoryInterface" inside "ApiPlatform\\OpenApi\\Factory\\OpenApiFactory" is deprecated and "ApiPlatform\\JsonSchema\\TypeFactoryInterface" will be removed in 4.x.%
%class implements "Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface" that is deprecated since Symfony 7.2, use NameConverterInterface instead.%
8 changes: 3 additions & 5 deletions tests/Symfony/Bundle/Twig/ApiPlatformProfilerPanelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,12 @@ public function testProfilerGeneralLayout(): void
$this->assertCount(1, $metrics->filter('.metric'), 'The should be one metric displayed (resource class).');
$this->assertSame('mongodb' === $this->env ? DocumentDummy::class : Dummy::class, $metrics->filter('span.value')->html());

$this->assertCount(4, $crawler->filter('.sf-tabs .tab-content'), 'Tabs must be presents on the panel.');
$this->assertCount(3, $crawler->filter('.sf-tabs .tab-content'), 'Tabs must be presents on the panel.');

// Metadata tab
$this->assertSame('Metadata', $crawler->filter('.tab:nth-of-type(1) .tab-title')->html());
$tabContent = $crawler->filter('.tab:nth-of-type(1) .tab-content');
$tabContent = $crawler->filter('.tab:nth-of-type(1)');
$this->assertStringEndsWith('Dummy', trim($tabContent->filter('h3')->html()), 'the resource shortname should be displayed.');

$this->assertCount(9, $tabContent->filter('table'));
$this->assertCount(3, $tabContent->filter('table'));
$this->assertSame('Resource', $tabContent->filter('table:first-of-type thead th:first-of-type')->html());
$this->assertSame('Operations', $tabContent->filter('table:nth-of-type(2) thead th:first-of-type')->html());
$this->assertSame('Filters', $tabContent->filter('table:nth-of-type(3) thead th:first-of-type')->html());
Expand Down
Loading