Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.5' into temp_1.3_to_4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Aug 16, 2023
2 parents 9c4585b + 24693cc commit 2d5114f
Show file tree
Hide file tree
Showing 206 changed files with 2,339 additions and 1,781 deletions.
1 change: 0 additions & 1 deletion .github/workflows/browser-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
with:
project-edition: 'oss'
project-version: '^3.3.x-dev'
test-suite: '--mode=standard --profile=content-forms --tags=~@broken --non-strict'
test-setup-phase-1: '--mode=standard --profile=setup-content-forms'
secrets:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
fail-fast: false
matrix:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
composer.lock
.php_cs.cache
.php-cs-fixer.cache
25 changes: 25 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;

$configFactory = new InternalConfigFactory();
$configFactory->withRules([
'declare_strict_types' => false,
]);

return $configFactory
->buildConfig()
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->files()->name('*.php')
);
14 changes: 0 additions & 14 deletions .php_cs

This file was deleted.

28 changes: 14 additions & 14 deletions behat_suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ setup-content-forms:
suites:
setup:
paths:
- vendor/ezsystems/ezplatform-content-forms/features/User/Setup
- vendor/ibexa/content-forms/features/User/Setup
contexts:
- EzSystems\EzPlatformContentForms\Behat\Context\UserRegistrationContext
- eZ\Bundle\EzPublishCoreBundle\Features\Context\YamlConfigurationContext
- Ibexa\ContentForms\Behat\Context\UserRegistrationContext
- Ibexa\Bundle\Core\Features\Context\YamlConfigurationContext

content-forms:
suites:
content_edit:
paths:
- vendor/ezsystems/ezplatform-content-forms/features/ContentEdit
- vendor/ibexa/content-forms/features/ContentEdit
contexts:
- EzSystems\EzPlatformContentForms\Behat\Context\ContentEditContext
- EzSystems\EzPlatformContentForms\Behat\Context\ContentTypeContext
- EzSystems\EzPlatformContentForms\Behat\Context\PagelayoutContext
- Ibexa\ContentForms\Behat\Context\ContentEditContext
- Ibexa\ContentForms\Behat\Context\ContentTypeContext
- Ibexa\ContentForms\Behat\Context\PagelayoutContext
fieldtype_form:
paths:
- vendor/ezsystems/ezplatform-content-forms/features/FieldTypeForm
- vendor/ibexa/content-forms/features/FieldTypeForm
contexts:
- EzSystems\EzPlatformContentForms\Behat\Context\ContentTypeContext
- EzSystems\EzPlatformContentForms\Behat\Context\FieldTypeFormContext
- EzSystems\EzPlatformContentForms\Behat\Context\SelectionFieldTypeFormContext
- Ibexa\ContentForms\Behat\Context\ContentTypeContext
- Ibexa\ContentForms\Behat\Context\FieldTypeFormContext
- Ibexa\ContentForms\Behat\Context\SelectionFieldTypeFormContext
user_registration: # @todo move to ezplatform-user
paths:
- vendor/ezsystems/ezplatform-content-forms/features/User/Registration
- vendor/ibexa/content-forms/features/User/Registration
contexts:
- EzSystems\EzPlatformContentForms\Behat\Context\UserRegistrationContext
- Ibexa\ContentForms\Behat\Context\UserRegistrationContext
- Behat\MinkExtension\Context\MinkContext
- eZ\Bundle\EzPublishCoreBundle\Features\Context\YamlConfigurationContext
- Ibexa\Bundle\Core\Features\Context\YamlConfigurationContext
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
require_once __DIR__ . '/vendor/autoload.php';
36 changes: 20 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "ezsystems/ezplatform-content-forms",
"description": "Use Symfony Forms with eZ Platform Content & User objects",
"name": "ibexa/content-forms",
"description": "Use Symfony Forms with Ibexa Content & User objects",
"license": "GPL-2.0-only",
"type": "ezplatform-bundle",
"type": "ibexa-bundle",
"replace": {
"ezsystems/ezplatform-content-forms": "*"
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"ext-json": "*",
"ezsystems/ezplatform-kernel": "^1.3@dev",
"ibexa/core": "~4.5.0@dev",
"symfony/dependency-injection": "^5.0",
"symfony/http-kernel": "^5.0",
"symfony/http-foundation": "^5.0",
Expand All @@ -22,16 +25,16 @@
"jms/translation-bundle": "^1.5"
},
"require-dev": {
"ibexa/ci-scripts": "^0.1@dev",
"ezsystems/doctrine-dbal-schema": "^1.0@dev",
"ezsystems/behatbundle": "^8.3@dev",
"ezsystems/ezplatform-http-cache": "^2.3@dev",
"ezsystems/ezplatform-rest": "^1.3@dev",
"ibexa/ci-scripts": "^0.2@dev",
"ibexa/behat": "~4.5.0@dev",
"ibexa/doctrine-schema": "~4.5.0@dev",
"ibexa/http-cache": "~4.5.0@dev",
"ibexa/rest": "~4.5.0@dev",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"behat/behat": "^3.5",
"friendsofphp/php-cs-fixer": "^2.16.0",
"ezsystems/ezplatform-code-style": "^0.1.0"
"friendsofphp/php-cs-fixer": "^3.0",
"ibexa/code-style": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -45,14 +48,15 @@
},
"autoload-dev": {
"psr-4": {
"EzSystems\\EzPlatformContentForms\\Tests\\": "src/lib/Tests",
"EzSystems\\EzPlatformContentFormsBundle\\Tests\\": "src/bundle/Tests",
"EzSystems\\EzPlatformContentForms\\Tests\\": "tests/lib/",
"EzSystems\\EzPlatformContentFormsBundle\\Tests\\": "tests/bundle/",
"Ibexa\\Tests\\Bundle\\ContentForms\\": "tests/bundle/",
"Ibexa\\Tests\\ContentForms\\": "tests/lib/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
"dev-main": "4.5.x-dev"
}
},
"config": {
Expand All @@ -61,7 +65,7 @@
}
},
"scripts": {
"fix-cs": "php-cs-fixer fix -v --show-progress=estimating",
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"check-cs": "@fix-cs --dry-run",
"test": "phpunit -c phpunit.xml.dist"
}
Expand Down
2 changes: 1 addition & 1 deletion doc/specifications/content_edit.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The Form, `ContentEditType`, uses a `ContentUpdateData` object.
## Future development

### Version conflits
[Version conflicts](https://jira.ez.no/browse/EZP-25465) must be handled. There are discussions
[Version conflicts](https://issues.ibexa.co/browse/EZP-25465) must be handled. There are discussions
about moving this logic down to the API. On the other hand, it would be fairly simple to implement
that logic in this controller.

Expand Down
4 changes: 2 additions & 2 deletions features/User/Registration/user_registration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Scenario: The user registration templates can be customized
Given I do have the user/register policy
And the following user registration templates configuration:
"""
ezpublish:
ibexa:
system:
default:
user_registration:
Expand All @@ -39,7 +39,7 @@ Scenario: The user registration templates can be customized
{% extends no_layout is defined and no_layout == true ? view_base_layout : pagelayout %}
{% block content %}
<section class="ez-content-edit">
<section class="ibexa-content-edit">
{{ form_start(form) }}
{{- form_widget(form.fieldsData) -}}
{{ form_end(form) }}
Expand Down
2 changes: 1 addition & 1 deletion features/User/Setup/setup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: User registration form setup
Given a User Group "TestUserGroup"
And the following user registration group configuration:
"""
ezpublish:
ibexa:
system:
default:
user_registration:
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</php>
<testsuites>
<testsuite name="ContentForms tests">
<directory suffix="Test.php">./src/lib/Tests/</directory>
<directory suffix="Test.php">./tests/lib</directory>
</testsuite>
<testsuite name="ContentFormsBundle tests">
<directory suffix="Test.php">./src/bundle/Tests</directory>
<directory suffix="Test.php">./tests/bundle</directory>
</testsuite>
<testsuite name="Ibexa ContentForms tests">
<directory suffix="Test.php">./tests/</directory>
Expand Down
68 changes: 35 additions & 33 deletions src/bundle/Controller/ContentEditController.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace EzSystems\EzPlatformContentFormsBundle\Controller;

use eZ\Bundle\EzPublishCoreBundle\Controller;
use eZ\Publish\API\Repository\ContentService;
use eZ\Publish\API\Repository\ContentTypeService;
use EzSystems\EzPlatformContentForms\Content\View\ContentCreateDraftView;
use EzSystems\EzPlatformContentForms\Content\View\ContentCreateSuccessView;
use EzSystems\EzPlatformContentForms\Content\View\ContentCreateView;
use EzSystems\EzPlatformContentForms\Content\View\ContentEditSuccessView;
use EzSystems\EzPlatformContentForms\Content\View\ContentEditView;
use EzSystems\EzPlatformContentForms\Data\Content\CreateContentDraftData;
use EzSystems\EzPlatformContentForms\Form\ActionDispatcher\ActionDispatcherInterface;
use EzSystems\EzPlatformContentForms\Form\Type\Content\ContentDraftCreateType;
namespace Ibexa\Bundle\ContentForms\Controller;

use Ibexa\Bundle\Core\Controller;
use Ibexa\ContentForms\Content\View\ContentCreateDraftView;
use Ibexa\ContentForms\Content\View\ContentCreateSuccessView;
use Ibexa\ContentForms\Content\View\ContentCreateView;
use Ibexa\ContentForms\Content\View\ContentEditSuccessView;
use Ibexa\ContentForms\Content\View\ContentEditView;
use Ibexa\ContentForms\Data\Content\CreateContentDraftData;
use Ibexa\ContentForms\Form\ActionDispatcher\ActionDispatcherInterface;
use Ibexa\ContentForms\Form\Type\Content\ContentDraftCreateType;
use Ibexa\Contracts\Core\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\ContentTypeService;
use Symfony\Component\HttpFoundation\Request;

class ContentEditController extends Controller
{
/** @var ContentTypeService */
/** @var \Ibexa\Contracts\Core\Repository\ContentTypeService */
private $contentTypeService;

/** @var ContentService */
/** @var \Ibexa\Contracts\Core\Repository\ContentService */
private $contentService;

/** @var ActionDispatcherInterface */
/** @var \Ibexa\ContentForms\Form\ActionDispatcher\ActionDispatcherInterface */
private $contentActionDispatcher;

public function __construct(
Expand All @@ -45,21 +45,21 @@ public function __construct(
/**
* Displays and processes a content creation form. Showing the form does not create a draft in the repository.
*
* @param \EzSystems\EzPlatformContentForms\Content\View\ContentCreateView $view
* @param \Ibexa\ContentForms\Content\View\ContentCreateView $view
*
* @return \EzSystems\EzPlatformContentForms\Content\View\ContentCreateView
* @return \Ibexa\ContentForms\Content\View\ContentCreateView
*/
public function createWithoutDraftAction(ContentCreateView $view): ContentCreateView
{
return $view;
}

/**
* @param \EzSystems\EzPlatformContentForms\Content\View\ContentCreateSuccessView $view
* @param \Ibexa\ContentForms\Content\View\ContentCreateSuccessView $view
*
* @return \EzSystems\EzPlatformContentForms\Content\View\ContentCreateSuccessView
* @return \Ibexa\ContentForms\Content\View\ContentCreateSuccessView
*
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
*/
public function createWithoutDraftSuccessAction(ContentCreateSuccessView $view): ContentCreateSuccessView
{
Expand All @@ -74,11 +74,11 @@ public function createWithoutDraftSuccessAction(ContentCreateSuccessView $view):
* @param int $fromVersionNo
* @param string $fromLanguage
*
* @return \EzSystems\EzPlatformContentForms\Content\View\ContentCreateDraftView|\Symfony\Component\HttpFoundation\Response
* @return \Ibexa\ContentForms\Content\View\ContentCreateDraftView|\Symfony\Component\HttpFoundation\Response
*
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
* @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentType
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentType
*/
public function createContentDraftAction(
Request $request,
Expand All @@ -103,7 +103,7 @@ public function createContentDraftAction(
ContentDraftCreateType::class,
$createContentDraft,
[
'action' => $this->generateUrl('ezplatform.content.draft.create'),
'action' => $this->generateUrl('ibexa.content.draft.create'),
]
);

Expand All @@ -124,26 +124,28 @@ public function createContentDraftAction(
}

/**
* @param \EzSystems\EzPlatformContentForms\Content\View\ContentEditView $view
* @param \Ibexa\ContentForms\Content\View\ContentEditView $view
*
* @return \EzSystems\EzPlatformContentForms\Content\View\ContentEditView
* @return \Ibexa\ContentForms\Content\View\ContentEditView
*
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
*/
public function editVersionDraftAction(ContentEditView $view): ContentEditView
{
return $view;
}

/**
* @param \EzSystems\EzPlatformContentForms\Content\View\ContentEditSuccessView $view
* @param \Ibexa\ContentForms\Content\View\ContentEditSuccessView $view
*
* @return \EzSystems\EzPlatformContentForms\Content\View\ContentEditSuccessView
* @return \Ibexa\ContentForms\Content\View\ContentEditSuccessView
*
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
*/
public function editVersionDraftSuccessAction(ContentEditSuccessView $view): ContentEditSuccessView
{
return $view;
}
}

class_alias(ContentEditController::class, 'EzSystems\EzPlatformContentFormsBundle\Controller\ContentEditController');
Loading

0 comments on commit 2d5114f

Please sign in to comment.