Skip to content

Commit

Permalink
IBX-2139: Reverted event name change (#273)
Browse files Browse the repository at this point in the history
* IBX-2139: Reverted event name change

* IBX-2139: Renamed events for on the fly actions

* IBX-2139: Replaced old controllers calls

* IBX-2139: Fixed view for COTF creation
  • Loading branch information
ViniTou authored Jan 31, 2022
1 parent a9a488d commit 8601f6a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/bundle/Controller/ContentOnTheFlyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function createContentAction(
Location $parentLocation
) {
if ((new ContentTypeIsUser($this->configResolver->getParameter('user_content_type_identifier')))->isSatisfiedBy($contentType)) {
return $this->forward('EzSystems\EzPlatformAdminUiBundle\Controller\UserOnTheFlyController::createUserAction', [
return $this->forward('Ibexa\Bundle\AdminUi\Controller\UserOnTheFlyController::createUserAction', [
'languageCode' => $languageCode,
'contentType' => $contentType,
'parentLocation' => $parentLocation,
Expand Down Expand Up @@ -256,7 +256,7 @@ public function editContentAction(
);

if ((new ContentTypeIsUser($this->configResolver->getParameter('user_content_type_identifier')))->isSatisfiedBy($contentType)) {
return $this->forward('EzSystems\EzPlatformAdminUiBundle\Controller\UserOnTheFlyController::editUserAction', [
return $this->forward('Ibexa\Bundle\AdminUi\Controller\UserOnTheFlyController::editUserAction', [
'languageCode' => $languageCode,
'contentId' => $contentId,
'versionNo' => $versionNo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,40 @@
<meta name="LanguageCode" content="{{ language.languageCode }}" />
{% endblock %}

{% block page_title %}
{% include '@ibexadesign/content/edit/content_header.html.twig' with {
class: 'ibexa-content-edit-page-title--increased-left-margin',
{% set context_actions %}
{% set menu_items %}
<li class="ibexa-context-menu__item ibexa-adaptive-items__item">
<button class="btn ibexa-btn ibexa-btn--primary ibexa-btn--confirm">
<span class="ibexa-btn__label">{{ 'on_the_fly.confirm'|trans()|desc('Confirm') }}</span>
</button>
</li>
<li class="ibexa-context-menu__item ibexa-adaptive-items__item">
<button class="btn ibexa-btn ibexa-btn--secondary ibexa-btn--cancel">
<span class="ibexa-btn__label">{{'on_the_fly.cancel'|trans()|desc('Cancel') }}</span>
</button>
</li>
{% endset %}

{{ include('@ibexadesign/ui/component/context_menu/context_menu.html.twig', {
menu_items: menu_items,
}) }}
{% endset %}

{% block header %}
{% include '@ibexadesign/ui/edit_header.html.twig' with {
action_name: 'creating'|trans|desc('Creating'),
title: 'new_content_item'|trans({'%contentType%': content_type.name})|desc('New %contentType%'),
icon_name: 'content-type',
show_autosave_status: true,
description: content_type.description,
without_close_button: true
context_actions: context_actions,
} %}
{% endblock %}

{% block details %}{% endblock %}

{% block form_fields %}
<section class="container ibexa-container">
<section class="container">
<div class="card ibexa-card ibexa-card--light">
<div class="card-body">
{{ parent() }}
Expand Down
8 changes: 4 additions & 4 deletions src/contracts/Event/ContentOnTheFlyEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
final class ContentOnTheFlyEvents
{
/** @var string */
public const CONTENT_CREATE = 'ibexa.content.on_the_fly.create';
public const CONTENT_CREATE = 'ibexa.content_on_the_fly.create';

/** @var string */
public const CONTENT_CREATE_PUBLISH = 'ezplatform.content_on_the_fly.create.publish';
public const CONTENT_CREATE_PUBLISH = 'ibexa.content_on_the_fly.create.publish';

/** @var string */
public const CONTENT_EDIT = 'ibexa.content.on_the_fly.edit';
public const CONTENT_EDIT = 'ibexa.content_on_the_fly.edit';

/** @var string */
public const CONTENT_EDIT_PUBLISH = 'ezplatform.content_on_the_fly.edit.publish';
public const CONTENT_EDIT_PUBLISH = 'ibexa.content_on_the_fly.edit.publish';
}

class_alias(ContentOnTheFlyEvents::class, 'EzSystems\EzPlatformAdminUi\Event\ContentOnTheFlyEvents');
8 changes: 4 additions & 4 deletions src/contracts/Event/UserOnTheFlyEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
final class UserOnTheFlyEvents
{
/** @var string */
public const USER_CREATE = 'ibexa.user.on_the_fly.create';
public const USER_CREATE = 'ibexa.user_on_the_fly.create';

/** @var string */
public const USER_CREATE_PUBLISH = 'ezplatform.user_on_the_fly.create.create';
public const USER_CREATE_PUBLISH = 'ibexa.user_on_the_fly.create.create';

/** @var string */
public const USER_EDIT = 'ibexa.user.on_the_fly.edit';
public const USER_EDIT = 'ibexa.user_on_the_fly.edit';

/** @var string */
public const USER_EDIT_PUBLISH = 'ezplatform.user_on_the_fly.edit.update';
public const USER_EDIT_PUBLISH = 'ibexa.user_on_the_fly.edit.update';
}

class_alias(UserOnTheFlyEvents::class, 'EzSystems\EzPlatformAdminUi\Event\UserOnTheFlyEvents');
2 changes: 1 addition & 1 deletion src/lib/Form/Processor/User/UserOnTheFlyProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function getSubscribedEvents()

public function processCreate(FormActionEvent $event)
{
$data = $data = $event->getData();
$data = $event->getData();

if (!$data instanceof UserCreateData) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/View/ContentTranslateSuccessView.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(Response $response)
parent::__construct('@ibexadesign/ui/no_content.html.twig');

$this->setResponse($response);
$this->setControllerReference(new ControllerReference('EzSystems\EzPlatformAdminUiBundle\Controller\ContentEditController::translationSuccessAction'));
$this->setControllerReference(new ControllerReference('Ibexa\Bundle\AdminUi\Controller\ContentEditController::translationSuccessAction'));
}
}

Expand Down

0 comments on commit 8601f6a

Please sign in to comment.