Skip to content

Commit

Permalink
Merge branch 'release/v2.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Dec 19, 2024
2 parents 0f1ed06 + 1195db9 commit 48b083b
Show file tree
Hide file tree
Showing 41 changed files with 295 additions and 67 deletions.
12 changes: 7 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ SMTP_MAILER_PORT=1125
#
# 127.0.0.1 roadiz-core-app.test roadiz-core-app.local varnish.roadiz-core-app.test varnish.roadiz-core-app.local pma.roadiz-core-app.test pma.roadiz-core-app.local solr.roadiz-core-app.test solr.roadiz-core-app.local mail.roadiz-core-app.test mail.roadiz-core-app.local
#
HOSTNAME=`roadiz-core-app.test`,`roadiz-core-app.local`
HOSTNAME_VARNISH=`varnish.roadiz-core-app.test`,`varnish.roadiz-core-app.local`
HOSTNAME_PMA=`pma.roadiz-core-app.test`,`pma.roadiz-core-app.local`
HOSTNAME_SOLR=`solr.roadiz-core-app.test`,`solr.roadiz-core-app.local`
HOSTNAME_MAILER=`mail.roadiz-core-app.test`,`mail.roadiz-core-app.local`
HOSTNAME=`^roadiz\-core\-app\.(test|local)$`
HOSTNAME_VARNISH=`^varnish\.roadiz\-core\-app\.(test|local)$`
HOSTNAME_PMA=`^pma\.roadiz\-core\-app\.(test|local)$`
HOSTNAME_SOLR=`^solr\.roadiz\-core\-app\.(test|local)$`
HOSTNAME_MAILER=`^(mail|mailer)\.roadiz\-core\-app\.(test|local)$`
PATH_PREFIX=`(?i)^/(rz\-admin|files|assets|themes|bundles|api|_wdt|_profiler|css/main\-color\.css|custom\-form|css/login/image)`


DEFAULT_GATEWAY=172.58.0.0
###> rezozero/intervention-request-bundle ###
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to Roadiz will be documented in this file.

## [2.4.3](https://github.com/roadiz/core-bundle-dev-app/compare/v2.4.2...v2.4.3) - 2024-12-19

### Bug Fixes

- Keep only fully translated languages - ([b661641](https://github.com/roadiz/core-bundle-dev-app/commit/b661641a33a51dc9a1e56f29e7e39328356dcfce))

### Features

- Added new NodeTypeField.php `normalizationContext` to alter normalization groups per field basis ([#29](https://github.com/roadiz/core-bundle-dev-app/issues/29)) - ([39448bd](https://github.com/roadiz/core-bundle-dev-app/commit/39448bdc690aa6c46775c58e5da803fb06364d0b))

## [2.4.2](https://github.com/roadiz/core-bundle-dev-app/compare/v2.4.1...v2.4.2) - 2024-12-11

### Bug Fixes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
meta {
name: Get a Page by its path wrapped in a WebResponse object
name: Get a WebResponse
type: http
seq: 1
}
Expand All @@ -12,19 +12,18 @@ get {

params:query {
path: /
~path: /articles/article-with-attributes
~properties[item][]: nodeReferences
~properties[item][]: title
~properties[]: item
~properties[item]: title
~path: /articles/article-with-attributes
~properties[]: blocks
~properties[item]: url
~properties[item][]: url
~path: /contact
~_preview: 1
~path: /fr/articles/article-with-attributes
~testsd: sd
~path: /fr/articles
~properties[item][]: nodeReferences
~path: /data:image/svg-xml
~_locale: zh
}

auth:bearer {
Expand Down
14 changes: 7 additions & 7 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
- "traefik.http.services.${APP_NAMESPACE}_pma.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_pma.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_pma.rule=Host(${HOSTNAME_PMA})"
- "traefik.http.routers.${APP_NAMESPACE}_pma.rule=HostRegexp(${HOSTNAME_PMA})"
- "traefik.http.routers.${APP_NAMESPACE}_pma.service=${APP_NAMESPACE}_pma"

solr:
Expand All @@ -74,7 +74,7 @@ services:
- "traefik.http.services.${APP_NAMESPACE}_solr.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_solr.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_solr.rule=Host(${HOSTNAME_SOLR})"
- "traefik.http.routers.${APP_NAMESPACE}_solr.rule=HostRegexp(${HOSTNAME_SOLR})"
- "traefik.http.routers.${APP_NAMESPACE}_solr.service=${APP_NAMESPACE}_solr"

redis:
Expand Down Expand Up @@ -144,11 +144,11 @@ services:
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}.rule=Host(${HOSTNAME})"
- "traefik.http.routers.${APP_NAMESPACE}.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}.service=${APP_NAMESPACE}"
# Listen HTTPS
- "traefik.http.routers.${APP_NAMESPACE}_secure.entrypoints=https"
- "traefik.http.routers.${APP_NAMESPACE}_secure.rule=Host(${HOSTNAME})"
- "traefik.http.routers.${APP_NAMESPACE}_secure.rule=HostRegexp(${HOSTNAME}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}_secure.tls=true"
- "traefik.http.routers.${APP_NAMESPACE}_secure.service=${APP_NAMESPACE}"

Expand All @@ -167,11 +167,11 @@ services:
- "traefik.http.services.${APP_NAMESPACE}_varnish.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_varnish.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_varnish.rule=Host(${HOSTNAME_VARNISH})"
- "traefik.http.routers.${APP_NAMESPACE}_varnish.rule=HostRegexp(${HOSTNAME_VARNISH}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}_varnish.service=${APP_NAMESPACE}_varnish"
# Listen HTTPS
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.entrypoints=https"
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.rule=Host(${HOSTNAME_VARNISH})"
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.rule=HostRegexp(${HOSTNAME_VARNISH}) && PathRegexp(${PATH_PREFIX})"
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.tls=true"
- "traefik.http.routers.${APP_NAMESPACE}_varnish_secure.service=${APP_NAMESPACE}_varnish"

Expand All @@ -188,7 +188,7 @@ services:
- "traefik.http.services.${APP_NAMESPACE}_mailer.loadbalancer.passhostheader=true"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}_mailer.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}_mailer.rule=Host(${HOSTNAME_MAILER})"
- "traefik.http.routers.${APP_NAMESPACE}_mailer.rule=HostRegexp(${HOSTNAME_MAILER})"
- "traefik.http.routers.${APP_NAMESPACE}_mailer.service=${APP_NAMESPACE}_mailer"

networks:
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"league/flysystem-aws-s3-v3": "^3.10",
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-symfony": "^1.1.8",
"phpunit/phpunit": "^9.5",
Expand Down
2 changes: 2 additions & 0 deletions config/api_resources/web_response.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
resources:
RZ\Roadiz\CoreBundle\Api\Model\WebResponse:
filters:
- app.property_filter
graphQlOperations: { }
operations:
article_get_by_path:
Expand Down
7 changes: 7 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ services:
app.serializer.normalizer.menu_link_path.json:
class: 'App\Serializer\Normalizer\MenuLinkPathNormalizer'
decorates: 'api_platform.serializer.normalizer.item'

app.property_filter:
parent: 'api_platform.serializer.property_filter'
tags: [ 'api_platform.filter' ]
autowire: false
autoconfigure: false
public: false
3 changes: 2 additions & 1 deletion lib/DocGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
}
},
"require-dev": {
"phpstan/phpstan": "^1.5.3"
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2"
},
"extra": {
"branch-alias": {
Expand Down
1 change: 1 addition & 0 deletions lib/Documents/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"doctrine/doctrine-bundle": "^2.8.1",
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2",
"phpstan/phpstan-doctrine": "^1.3",
"phpunit/phpunit": "^9.5"
},
Expand Down
3 changes: 2 additions & 1 deletion lib/DtsGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"symfony/http-foundation": "6.4.*"
},
"require-dev": {
"phpstan/phpstan": "^1.5.3"
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2"
},
"license": "MIT",
"authors": [
Expand Down
1 change: 1 addition & 0 deletions lib/EntityGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"require-dev": {
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2",
"phpunit/phpunit": "^9.5",
"api-platform/core": "~3.3.11"
},
Expand Down
25 changes: 25 additions & 0 deletions lib/EntityGenerator/src/Field/AbstractFieldGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,21 @@ protected function getFieldDefaultValueDeclaration(): Literal|string|null
return null;
}

/**
* @return array<string, mixed>|null
*/
protected function getNormalizationContext(): ?array
{
if (\method_exists($this->field, 'getNormalizationContext')) {
$normalizationContext = $this->field->getNormalizationContext();
if (\is_array($normalizationContext) && !empty($normalizationContext['groups'])) {
return $normalizationContext;
}
}

return null;
}

protected function addFieldAttributes(Property $property, PhpNamespace $namespace, bool $exclude = false): self
{
if ($exclude) {
Expand Down Expand Up @@ -134,6 +149,16 @@ protected function addFieldAttributes(Property $property, PhpNamespace $namespac
$this->getSerializationMaxDepth(),
]);
}

/*
* Enable different serialization context for this field.
*/
if (null !== $this->getNormalizationContext()) {
$property->addAttribute('Symfony\Component\Serializer\Attribute\Context', [
'normalizationContext' => $this->getNormalizationContext(),
'groups' => $this->getSerializationGroups(),
]);
}
}

if (
Expand Down
18 changes: 18 additions & 0 deletions lib/EntityGenerator/src/Field/CustomFormsFieldGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ protected function addSerializationAttributes(Property|Method $property): self
return $this;
}

protected function addFieldAnnotation(Property $property): AbstractFieldGenerator
{
parent::addFieldAnnotation($property);

$property->addComment('');
$property->addComment('@var '.$this->options['custom_form_class'].'[]|null');

return $this;
}

protected function getNormalizationContext(): array
{
return [
'groups' => ['nodes_sources', 'urls'],
...(parent::getNormalizationContext() ?? []),
];
}

protected function getDefaultSerializationGroups(): array
{
$groups = parent::getDefaultSerializationGroups();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,18 @@ class NSMock extends NodesSources
/**
* Custom forms field.
* (Virtual field, this var is a buffer)
*
* @var \mock\Entity\CustomForm[]|null
*/
#[JMS\Exclude]
#[Serializer\SerializedName(serializedName: 'theForms')]
#[Serializer\Groups(['nodes_sources', 'nodes_sources_default', 'nodes_sources_custom_forms'])]
#[ApiProperty(description: 'Custom forms field')]
#[Serializer\MaxDepth(2)]
#[Serializer\Context(
normalizationContext: ['groups' => ['nodes_sources', 'urls']],
groups: ['nodes_sources', 'nodes_sources_default', 'nodes_sources_custom_forms'],
)]
private ?array $theForms = null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,18 @@ class NSMock extends NodesSources
/**
* Custom forms field.
* (Virtual field, this var is a buffer)
*
* @var \mock\Entity\CustomForm[]|null
*/
#[JMS\Exclude]
#[Serializer\SerializedName(serializedName: 'theForms')]
#[Serializer\Groups(['nodes_sources', 'nodes_sources_default', 'nodes_sources_custom_forms'])]
#[ApiProperty(description: 'Custom forms field')]
#[Serializer\MaxDepth(2)]
#[Serializer\Context(
normalizationContext: ['groups' => ['nodes_sources', 'urls']],
groups: ['nodes_sources', 'nodes_sources_default', 'nodes_sources_custom_forms'],
)]
private ?array $theForms = null;

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/Jwt/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"symfony/http-client": "6.4.*"
},
"require-dev": {
"phpstan/phpstan": "^1.5.3"
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 2 additions & 1 deletion lib/Markdown/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"twig/twig": "^3.16"
},
"require-dev": {
"phpstan/phpstan": "^1.5.3"
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2"
},
"license": "MIT",
"authors": [
Expand Down
1 change: 1 addition & 0 deletions lib/Models/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"doctrine/doctrine-bundle": "^2.8.1",
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2",
"phpunit/phpunit": "^9.5"
},
"autoload": {
Expand Down
3 changes: 2 additions & 1 deletion lib/OpenId/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"symfony/security-http": "6.4.*"
},
"require-dev": {
"phpstan/phpstan": "^1.5.3"
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 2 additions & 1 deletion lib/Random/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"ext-openssl": "*"
},
"require-dev": {
"phpstan/phpstan": "^1.5.3"
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions lib/RoadizCompatBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-symfony": "^1.1.8",
"roadiz/doc-generator": "2.4.*",
Expand Down
1 change: 1 addition & 0 deletions lib/RoadizCoreBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpdoc-parser": "<2",
"phpstan/phpstan-doctrine": "^1.3",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "6.4.*",
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
parameters:
roadiz_core.cms_version: '2.4.2'
roadiz_core.cms_version: '2.4.3'
roadiz_core.cms_version_prefix: 'main'
env(APP_NAMESPACE): "roadiz"
env(APP_VERSION): "0.1.0"
Expand Down
29 changes: 29 additions & 0 deletions lib/RoadizCoreBundle/migrations/Version20241218095458.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241218095458 extends AbstractMigration
{
public function getDescription(): string
{
return 'Added normalization_context to NodeTypeField';
}

public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE node_type_fields ADD normalization_context JSON DEFAULT NULL');
}

public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE node_type_fields DROP normalization_context');
}
}
Loading

0 comments on commit 48b083b

Please sign in to comment.