Skip to content

Commit

Permalink
chore: Bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Apr 19, 2024
1 parent c1f869a commit 4acef91
Show file tree
Hide file tree
Showing 353 changed files with 6,312 additions and 6,495 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.0', '8.1']
steps:
- uses: shivammathur/setup-php@v2
with:
Expand Down
75 changes: 75 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
node_js:
- "14"
php:
- 8.0
- 8.1
- nightly
dist: bionic
stages:
- "PHP lint tests"
- "Backoffice assets tests"
branches:
except:
- l10n_develop

jobs:
allow_failures:
- php: nightly

include:
- stage: "Backoffice assets tests"
language: node_js
node_js: "14"
script: sh .travis/backoffice_assets.sh

- stage: "PHP lint tests"
language: php
sudo: required
services:
- mysql
env:
- DB=mysql
- MYSQL_VERSION=5.7
- MYSQL_PASSWORD=
php: 7.4
install: sh .travis/composer_install.sh
script: sh .travis/php_lint.sh
- stage: "PHP lint tests"
language: php
sudo: required
services:
- mysql
env:
- DB=mysql
- MYSQL_VERSION=5.7
- MYSQL_PASSWORD=
php: 8.0
install: sh .travis/composer_install.sh
script: sh .travis/php_lint.sh
- stage: "PHP lint tests"
language: php
sudo: required
services:
- mysql
env:
- DB=mysql
- MYSQL_VERSION=5.7
- MYSQL_PASSWORD=
php: 8.1
install: sh .travis/composer_install.sh
script: sh .travis/php_lint.sh
- stage: "PHP lint tests"
language: php
sudo: required
services:
- mysql
env:
- DB=mysql
- MYSQL_VERSION=5.7
- MYSQL_PASSWORD=
php: nightly
install: sh .travis/composer_install.sh
script: sh .travis/php_lint.sh



33 changes: 16 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,25 @@
"role": "Frontend developer"
}
],
"prefer-stable": true,
"require": {
"php": ">=8.1",
"php": ">=8.0",
"ext-zip": "*",
"doctrine/orm": "~2.17.0",
"doctrine/orm": "<2.17",
"guzzlehttp/guzzle": "^7.2.0",
"jms/serializer": "^3.9.0",
"league/flysystem": "^3.0",
"pimple/pimple": "^3.3.1",
"ramsey/uuid": "^4.7",
"roadiz/compat-bundle": "2.2.*",
"roadiz/core-bundle": "2.2.*",
"roadiz/doc-generator": "2.2.*",
"roadiz/documents": "2.2.*",
"roadiz/dts-generator": "2.2.*",
"roadiz/markdown": "2.2.*",
"roadiz/models": "2.2.*",
"roadiz/compat-bundle": "2.1.*",
"roadiz/core-bundle": "2.1.*",
"roadiz/doc-generator": "2.1.*",
"roadiz/documents": "2.1.*",
"roadiz/dts-generator": "2.1.*",
"roadiz/markdown": "2.1.*",
"roadiz/models": "2.1.*",
"roadiz/nodetype-contracts": "~1.1.2",
"roadiz/openid": "2.2.*",
"roadiz/rozier-bundle": "2.2.*",
"roadiz/openid": "2.1.*",
"roadiz/rozier-bundle": "2.1.*",
"symfony/asset": "5.4.*",
"symfony/filesystem": "5.4.*",
"symfony/form": "5.4.*",
Expand All @@ -67,9 +66,9 @@
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpstan-doctrine": "^1.3",
"roadiz/entity-generator": "2.2.*",
"roadiz/random": "2.2.*",
"roadiz/jwt": "2.2.*",
"roadiz/entity-generator": "2.1.*",
"roadiz/random": "2.1.*",
"roadiz/jwt": "2.1.*",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
Expand All @@ -95,8 +94,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
"dev-main": "2.1.x-dev",
"dev-develop": "2.2.x-dev"
}
}
}
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ parameters:
- '#Doctrine\\ORM\\Mapping\\GeneratedValue constructor expects#'
- '#type mapping mismatch: property can contain Doctrine\\Common\\Collections\\Collection<int, [^\>]+> but database expects Doctrine\\Common\\Collections\\Collection&iterable<[^\>]+>#'
- '#should return Doctrine\\Common\\Collections\\Collection<int, [^\>]+Interface> but returns Doctrine\\Common\\Collections\\Collection<int, [^\>]+>#'
- '#but returns Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'
- '#does not accept Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'

reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
Expand Down
2 changes: 1 addition & 1 deletion src/.babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": ["env", "stage-0"],
"presets": ["es2015", "stage-0"],
"plugins": ["transform-runtime", "lodash"]
}
1 change: 1 addition & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# TheatreTheme editor config for contributors
# Root is false as your theme is inside Roadiz filetree
# http://editorconfig.org/
root = false

[*]
indent_style = space
Expand Down
2 changes: 1 addition & 1 deletion src/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
},
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
//extends: 'standard',
extends: ['prettier', 'plugin:prettier/recommended', 'plugin:vue/base'],
extends: ['prettier', 'plugin:prettier/recommended', 'plugin:vue/essential'],
// required to lint *.vue files
plugins: ['html', 'prettier'],
// add your custom rules here
Expand Down
2 changes: 1 addition & 1 deletion src/AjaxControllers/AbstractAjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function getTranslation(Request $request): ?TranslationInterface
* @param string $method
* @param bool $requestCsrfToken
*
* @return bool Return true if request is valid, else throw exception
* @return boolean Return true if request is valid, else throw exception
*/
protected function validateRequest(Request $request, string $method = 'POST', bool $requestCsrfToken = true): bool
{
Expand Down
13 changes: 11 additions & 2 deletions src/AjaxControllers/AjaxAbstractFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
* @package Themes\Rozier\AjaxControllers
*/
abstract class AjaxAbstractFieldsController extends AbstractAjaxController
{
public function __construct(protected readonly HandlerFactoryInterface $handlerFactory)
private HandlerFactoryInterface $handlerFactory;

/**
* @param HandlerFactoryInterface $handlerFactory
*/
public function __construct(HandlerFactoryInterface $handlerFactory)
{
$this->handlerFactory = $handlerFactory;
}

/**
Expand All @@ -24,7 +33,7 @@ public function __construct(protected readonly HandlerFactoryInterface $handlerF
*
* @return null|Response
*/
protected function handleFieldActions(Request $request, AbstractField $field = null): ?Response
protected function handleFieldActions(Request $request, AbstractField $field = null)
{
/*
* Validate
Expand Down
54 changes: 29 additions & 25 deletions src/AjaxControllers/AjaxAttributeValuesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use RZ\Roadiz\CoreBundle\Entity\AttributeValue;
use RZ\Roadiz\CoreBundle\Entity\Node;
use RZ\Roadiz\CoreBundle\Security\Authorization\Voter\NodeVoter;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -26,44 +25,49 @@ final class AjaxAttributeValuesController extends AbstractAjaxController
*
* @return Response JSON response
*/
public function editAction(Request $request, int $attributeValueId): Response
public function editAction(Request $request, int $attributeValueId)
{
/*
* Validate
*/
$this->validateRequest($request, 'POST', false);
$this->denyAccessUnlessGranted('ROLE_ACCESS_NODE_ATTRIBUTES');

/** @var AttributeValue|null $attributeValue */
$attributeValue = $this->em()->find(AttributeValue::class, (int) $attributeValueId);

if ($attributeValue === null) {
throw $this->createNotFoundException($this->getTranslator()->trans(
'attribute_value.%attributeValueId%.not_exists',
[
'%attributeValueId%' => $attributeValueId
]
));
}

$this->denyAccessUnlessGranted(NodeVoter::EDIT_ATTRIBUTE, $attributeValue->getAttributable());
if ($attributeValue !== null) {
$responseArray = [];
/*
* Get the right update method against "_action" parameter
*/
switch ($request->get('_action')) {
case 'updatePosition':
$responseArray = $this->updatePosition($request->request->all(), $attributeValue);
break;
}

$responseArray = [];
/*
* Get the right update method against "_action" parameter
*/
switch ($request->get('_action')) {
case 'updatePosition':
$responseArray = $this->updatePosition($request->request->all(), $attributeValue);
break;
return new JsonResponse(
$responseArray,
Response::HTTP_PARTIAL_CONTENT
);
}

return new JsonResponse(
$responseArray,
Response::HTTP_PARTIAL_CONTENT
);
throw $this->createNotFoundException($this->getTranslator()->trans(
'attribute_value.%attributeValueId%.not_exists',
[
'%attributeValueId%' => $attributeValueId
]
));
}

protected function updatePosition(array $parameters, AttributeValue $attributeValue): array
/**
* @param array $parameters
* @param AttributeValue $attributeValue
*
* @return array
*/
protected function updatePosition($parameters, AttributeValue $attributeValue): array
{
$attributable = $attributeValue->getAttributable();
$details = [
Expand Down
7 changes: 5 additions & 2 deletions src/AjaxControllers/AjaxCustomFormFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
* @package Themes\Rozier\AjaxControllers
*/
class AjaxCustomFormFieldsController extends AjaxAbstractFieldsController
{
/**
* Handle AJAX edition requests for CustomFormFields
* such as coming from widgets.
*
* @param Request $request
* @param int $customFormFieldId
* @param int $customFormFieldId
*
* @return Response JSON response
*/
public function editAction(Request $request, int $customFormFieldId): Response
public function editAction(Request $request, int $customFormFieldId)
{
/*
* Validate
Expand Down
20 changes: 13 additions & 7 deletions src/AjaxControllers/AjaxCustomFormsExplorerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,26 @@
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Themes\Rozier\Models\CustomFormModel;

/**
* @package Themes\Rozier\AjaxControllers
*/
class AjaxCustomFormsExplorerController extends AbstractAjaxController
{
public function __construct(private readonly UrlGeneratorInterface $urlGenerator)
private UrlGeneratorInterface $urlGenerator;

public function __construct(UrlGeneratorInterface $urlGenerator)
{
$this->urlGenerator = $urlGenerator;
}

/**
* @param Request $request
*
* @return Response JSON response
*/
public function indexAction(Request $request): Response
public function indexAction(Request $request)
{
$this->denyAccessUnlessGranted('ROLE_ACCESS_CUSTOMFORMS');
$this->denyAccessUnlessGranted('ROLE_ACCESS_NODES');

$arrayFilter = [];
/*
Expand Down Expand Up @@ -62,15 +68,15 @@ public function indexAction(Request $request): Response
* Get a CustomForm list from an array of id.
*
* @param Request $request
* @return Response
* @return JsonResponse
*/
public function listAction(Request $request): Response
public function listAction(Request $request)
{
if (!$request->query->has('ids')) {
throw new InvalidParameterException('Ids should be provided within an array');
}

$this->denyAccessUnlessGranted('ROLE_ACCESS_CUSTOMFORMS');
$this->denyAccessUnlessGranted('ROLE_ACCESS_NODES');

$cleanCustomFormsIds = array_filter($request->query->filter('ids', [], \FILTER_DEFAULT, [
'flags' => \FILTER_FORCE_ARRAY
Expand Down Expand Up @@ -105,7 +111,7 @@ public function listAction(Request $request): Response
* @param array<CustomForm>|\Traversable<CustomForm> $customForms
* @return array
*/
private function normalizeCustomForms(iterable $customForms): array
private function normalizeCustomForms($customForms)
{
$customFormsArray = [];

Expand Down
Loading

0 comments on commit 4acef91

Please sign in to comment.