Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-7044: Redirect after settings update #1173

Open
wants to merge 10 commits into
base: 4.6
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
{% block body_class %}ibexa-user-settings-update-view{% endblock %}

{% block header %}
{% set user_setting_update_sidebar_right = knp_menu_get('ezplatform_admin_ui.menu.user_setting_update.sidebar_right', [], {'user_setting': user_setting}) %}
{% set route = app.request.query.get('route')|default(null) %}
Steveb-p marked this conversation as resolved.
Show resolved Hide resolved
{% set route_parameters = app.request.query.get('routeParameters')|default([]) %}
Steveb-p marked this conversation as resolved.
Show resolved Hide resolved
{% set user_setting_update_sidebar_right = knp_menu_get('ezplatform_admin_ui.menu.user_setting_update.sidebar_right', [], {
'route': route,
'route_parameters': route_parameters,
'user_setting': user_setting,
}) %}

{% include '@ibexadesign/ui/edit_header.html.twig' with {
action_name: 'list.action_name'|trans({'%action%': title|lower})|desc('Editing %action%'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public function createStructure(array $options): ItemInterface
{
/** @var \Knp\Menu\ItemInterface|\Knp\Menu\ItemInterface[] $menu */
$menu = $this->factory->createItem('root');
$route = $options['route'] ?? 'ibexa.user_settings.list';
$routeParameters = $options['route_parameters'] ?? [];

$saveItem = $this->createMenuItem(
self::ITEM__SAVE,
Expand All @@ -69,7 +71,7 @@ public function createStructure(array $options): ItemInterface
'class' => 'ibexa-btn--trigger',
'data-click' => '#user_setting_update_update',
],
]
],
);

$saveItem->addChild(
Expand All @@ -90,7 +92,8 @@ public function createStructure(array $options): ItemInterface
self::ITEM__CANCEL => $this->createMenuItem(
self::ITEM__CANCEL,
[
'route' => 'ibexa.user_settings.list',
'route' => $route,
Steveb-p marked this conversation as resolved.
Show resolved Hide resolved
'routeParameters' => $routeParameters,
]
),
]);
Expand Down
Loading