Skip to content

Commit

Permalink
chore: Bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Jun 19, 2024
1 parent cfda0ed commit 420f436
Show file tree
Hide file tree
Showing 351 changed files with 6,249 additions and 5,974 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.0', '8.1']
php-version: ['8.1', '8.2', '8.3']
steps:
- uses: shivammathur/setup-php@v2
with:
Expand Down
75 changes: 0 additions & 75 deletions .travis.yml

This file was deleted.

33 changes: 17 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,26 @@
"role": "Frontend developer"
}
],
"prefer-stable": true,
"require": {
"php": ">=8.0",
"php": ">=8.1",
"ext-zip": "*",
"doctrine/orm": "<2.17",
"doctrine/orm": "~2.17.0",
"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.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/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/nodetype-contracts": "~1.1.2",
"roadiz/openid": "2.1.*",
"roadiz/rozier-bundle": "2.1.*",
"roadiz/openid": "2.2.*",
"roadiz/rozier-bundle": "2.2.*",
"symfony/asset": "5.4.*",
"symfony/filesystem": "5.4.*",
"symfony/form": "5.4.*",
Expand All @@ -66,9 +67,9 @@
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpstan-doctrine": "^1.3",
"roadiz/entity-generator": "2.1.*",
"roadiz/random": "2.1.*",
"roadiz/jwt": "2.1.*",
"roadiz/entity-generator": "2.2.*",
"roadiz/random": "2.2.*",
"roadiz/jwt": "2.2.*",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
Expand All @@ -94,8 +95,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.1.x-dev",
"dev-develop": "2.2.x-dev"
"dev-main": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
}
}
}
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ 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": ["es2015", "stage-0"],
"presets": ["env", "stage-0"],
"plugins": ["transform-runtime", "lodash"]
}
1 change: 0 additions & 1 deletion src/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# 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/essential'],
extends: ['prettier', 'plugin:prettier/recommended', 'plugin:vue/base'],
// 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 boolean Return true if request is valid, else throw exception
* @return bool Return true if request is valid, else throw exception
*/
protected function validateRequest(Request $request, string $method = 'POST', bool $requestCsrfToken = true): bool
{
Expand Down
61 changes: 39 additions & 22 deletions src/AjaxControllers/AjaxAbstractFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;

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

/**
* @param HandlerFactoryInterface $handlerFactory
*/
public function __construct(HandlerFactoryInterface $handlerFactory)
protected function findEntity(int|string $entityId): ?AbstractField
{
$this->handlerFactory = $handlerFactory;
return $this->em()->find($this->getEntityClass(), (int) $entityId);
}

/**
Expand All @@ -33,7 +30,7 @@ public function __construct(HandlerFactoryInterface $handlerFactory)
*
* @return null|Response
*/
protected function handleFieldActions(Request $request, AbstractField $field = null)
protected function handleFieldActions(Request $request, AbstractField $field = null): ?Response
{
/*
* Validate
Expand Down Expand Up @@ -79,11 +76,12 @@ protected function handleFieldActions(Request $request, AbstractField $field = n
*/
protected function updatePosition(array $parameters, AbstractField $field = null): array
{
/*
* First, we set the new parent
*/
if (!empty($parameters['newPosition']) && null !== $field) {
$field->setPosition((float) $parameters['newPosition']);
if (!empty($parameters['afterFieldId']) && is_numeric($parameters['afterFieldId'])) {
$afterField = $this->findEntity((int) $parameters['afterFieldId']);
if (null === $afterField) {
throw new BadRequestHttpException('afterFieldId does not exist');
}
$field->setPosition($afterField->getPosition() + 0.5);
// Apply position update before cleaning
$this->em()->flush();
$handler = $this->handlerFactory->getHandler($field);
Expand All @@ -97,12 +95,31 @@ protected function updatePosition(array $parameters, AbstractField $field = null
]),
];
}
return [
'statusCode' => '400',
'status' => 'error',
'responseText' => $this->getTranslator()->trans('field.%name%.updated', [
'%name%' => $field->getName(),
]),
];
if (!empty($parameters['beforeFieldId']) && is_numeric($parameters['beforeFieldId'])) {
$beforeField = $this->findEntity((int) $parameters['beforeFieldId']);
if (null === $beforeField) {
throw new BadRequestHttpException('beforeFieldId does not exist');
}
$field->setPosition($beforeField->getPosition() - 0.5);
// Apply position update before cleaning
$this->em()->flush();
$handler = $this->handlerFactory->getHandler($field);
$handler->cleanPositions();
$this->em()->flush();
return [
'statusCode' => '200',
'status' => 'success',
'responseText' => $this->getTranslator()->trans('field.%name%.updated', [
'%name%' => $field->getName(),
]),
];
}

throw new BadRequestHttpException('Cannot update position for Field. Missing parameters.');
}

/**
* @return class-string<AbstractField>
*/
abstract protected function getEntityClass(): string;
}
Loading

0 comments on commit 420f436

Please sign in to comment.