From d957e028229c679006a9b675325fe2ca6de92eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Thu, 16 Nov 2023 07:26:38 +0100 Subject: [PATCH 1/2] IBX-6997: Introduced user-menu components group --- src/bundle/Resources/config/services/components.yaml | 1 + .../Resources/config/services/components/layout.yaml | 12 ++++++++++++ .../Resources/views/themes/admin/ui/layout.html.twig | 5 +---- .../views/themes/admin/ui/user_menu.html.twig | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/bundle/Resources/config/services/components/layout.yaml create mode 100644 src/bundle/Resources/views/themes/admin/ui/user_menu.html.twig diff --git a/src/bundle/Resources/config/services/components.yaml b/src/bundle/Resources/config/services/components.yaml index 6de3bd5d79..1f59edac4b 100644 --- a/src/bundle/Resources/config/services/components.yaml +++ b/src/bundle/Resources/config/services/components.yaml @@ -1,6 +1,7 @@ imports: - { resource: components/content/edit.yaml } - { resource: components/content_type/edit.yaml } + - { resource: components/layout.yaml } services: _defaults: diff --git a/src/bundle/Resources/config/services/components/layout.yaml b/src/bundle/Resources/config/services/components/layout.yaml new file mode 100644 index 0000000000..e2404db65e --- /dev/null +++ b/src/bundle/Resources/config/services/components/layout.yaml @@ -0,0 +1,12 @@ +services: + _defaults: + autowire: true + autoconfigure: false + public: false + + ibexa.admin_ui.component.user_menu: + class: Ibexa\AdminUi\Component\TwigComponent + arguments: + $template: '@@ibexadesign/ui/user_menu.html.twig' + tags: + - { name: ibexa.admin_ui.component, group: user-menu } diff --git a/src/bundle/Resources/views/themes/admin/ui/layout.html.twig b/src/bundle/Resources/views/themes/admin/ui/layout.html.twig index 09e45451e5..fc642574c4 100644 --- a/src/bundle/Resources/views/themes/admin/ui/layout.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/layout.html.twig @@ -134,10 +134,7 @@
{% block user_menu %} - {{ knp_menu_render('ezplatform_admin_ui.menu.user', { - 'depth': 1, - 'template': '@ibexadesign/ui/menu/user.html.twig' - }) }} + {{ ibexa_render_component_group('user-menu') }} {% endblock %}
diff --git a/src/bundle/Resources/views/themes/admin/ui/user_menu.html.twig b/src/bundle/Resources/views/themes/admin/ui/user_menu.html.twig new file mode 100644 index 0000000000..d731dd77b7 --- /dev/null +++ b/src/bundle/Resources/views/themes/admin/ui/user_menu.html.twig @@ -0,0 +1,4 @@ +{{ knp_menu_render('ezplatform_admin_ui.menu.user', { + 'depth': 1, + 'template': '@ibexadesign/ui/menu/user.html.twig' +}) }} From 59a96a76f7ef620e9b28db12205ad406d8a9009d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Thu, 16 Nov 2023 07:28:03 +0100 Subject: [PATCH 2/2] Moved Ibexa\AdminUi\Component\Search\GlobalSearchTwigComponent definition to components/layout.yaml --- src/bundle/Resources/config/services.yaml | 1 - src/bundle/Resources/config/services/components/layout.yaml | 6 ++++++ src/bundle/Resources/config/services/search.yaml | 6 ------ 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 src/bundle/Resources/config/services/search.yaml diff --git a/src/bundle/Resources/config/services.yaml b/src/bundle/Resources/config/services.yaml index cf44a0a7da..3b8b489144 100644 --- a/src/bundle/Resources/config/services.yaml +++ b/src/bundle/Resources/config/services.yaml @@ -26,7 +26,6 @@ imports: - { resource: services/forms.yaml } - { resource: services/strategies.yaml } - { resource: services/query_types.yaml } - - { resource: services/search.yaml } - { resource: services/role_form_mappers.yaml } - { resource: services/fieldtype_form_mappers.yaml } - { resource: services/action_dispatchers.yaml } diff --git a/src/bundle/Resources/config/services/components/layout.yaml b/src/bundle/Resources/config/services/components/layout.yaml index e2404db65e..890079d56c 100644 --- a/src/bundle/Resources/config/services/components/layout.yaml +++ b/src/bundle/Resources/config/services/components/layout.yaml @@ -4,6 +4,12 @@ services: autoconfigure: false public: false + Ibexa\AdminUi\Component\Search\GlobalSearchTwigComponent: + autowire: true + public: false + tags: + - { name: ibexa.admin_ui.component, group: global-search } + ibexa.admin_ui.component.user_menu: class: Ibexa\AdminUi\Component\TwigComponent arguments: diff --git a/src/bundle/Resources/config/services/search.yaml b/src/bundle/Resources/config/services/search.yaml deleted file mode 100644 index d38341f8c9..0000000000 --- a/src/bundle/Resources/config/services/search.yaml +++ /dev/null @@ -1,6 +0,0 @@ -services: - Ibexa\AdminUi\Component\Search\GlobalSearchTwigComponent: - autowire: true - public: false - tags: - - { name: ibexa.admin_ui.component, group: global-search }