From 769d1033290d45d41151b8bdf665add81dbbcafd Mon Sep 17 00:00:00 2001 From: Tomasz Kryszan Date: Thu, 1 Dec 2022 15:41:36 +0100 Subject: [PATCH 1/3] IBX-3792: Fixed display meta tab https://issues.ibexa.co/browse/IBX-3792 --- .../ui/on_the_fly/create_on_the_fly.html.twig | 28 +++++++++++++++++++ .../ui/on_the_fly/edit_on_the_fly.html.twig | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig index 94498f5858..9ce93bbfa7 100644 --- a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig @@ -67,3 +67,31 @@ 'language': language }) }} {% endblock %} + +{% block anchor_menu %} + {% set content_edit_anchor_menu = knp_menu_get('ibexa.admin_ui.menu.content_edit.anchor_menu', [], { + 'content': content, + 'content_type': content_type, + 'location': location, + 'parent_location': parent_location, + 'language': language, + 'grouped_fields': grouped_fields, + }) %} + + {% embed '@ibexadesign/ui/anchor_navigation_menu.html.twig' with anchor_params %} + {% block navigation_menu_body %} + {{ knp_menu_render(content_edit_anchor_menu, { 'template': '@ibexadesign/ui/menu/anchor_menu.html.twig' }) }} + {% endblock %} + {% endembed %} +{% endblock %} + +{% block content_sections %} + {{ ibexa_render_component_group('content-edit-sections', { + 'form': form, + 'content': content, + 'content_type': content_type, + 'location': location, + 'parent_location': parent_location, + 'language': language + }) }} +{% endblock %} diff --git a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig index fe229352f8..ed4ad9efe1 100644 --- a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig @@ -70,3 +70,31 @@ 'language': language }) }} {% endblock %} + +{% block anchor_menu %} + {% set content_edit_anchor_menu = knp_menu_get('ibexa.admin_ui.menu.content_edit.anchor_menu', [], { + 'content': content, + 'content_type': content_type, + 'location': location, + 'parent_location': parent_location, + 'language': language, + 'grouped_fields': grouped_fields, + }) %} + + {% embed '@ibexadesign/ui/anchor_navigation_menu.html.twig' with anchor_params %} + {% block navigation_menu_body %} + {{ knp_menu_render(content_edit_anchor_menu, { 'template': '@ibexadesign/ui/menu/anchor_menu.html.twig' }) }} + {% endblock %} + {% endembed %} +{% endblock %} + +{% block content_sections %} + {{ ibexa_render_component_group('content-edit-sections', { + 'form': form, + 'content': content, + 'content_type': content_type, + 'location': location, + 'parent_location': parent_location, + 'language': language + }) }} +{% endblock %} From 7f6b1fbc4e8ad0ef9d25732ae1155fe3b6fe172b Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Fri, 2 Dec 2022 12:43:43 +0100 Subject: [PATCH 2/3] fixed JS errors --- .../public/js/scripts/admin.anchor.navigation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js b/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js index ca36015107..3cf1ec9d33 100644 --- a/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js +++ b/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js @@ -6,7 +6,7 @@ } const header = doc.querySelector('.ibexa-edit-header'); - const headerContainer = header.querySelector('.ibexa-edit-header__container'); + const headerContainer = header?.querySelector('.ibexa-edit-header__container'); const SECTION_ADJUST_MARGIN_TOP = 20; const formContainerNode = doc.querySelector('.ibexa-edit-content'); const getSectionGroupActiveItems = () => { @@ -117,7 +117,7 @@ if (!firstSection.isSameNode(lastSection) && lastSection.offsetHeight) { const lastSectionHeight = lastSection.offsetHeight; - const headerHeight = headerContainer.offsetHeight; + const headerHeight = headerContainer?.offsetHeight; const contentColumnHeight = contentColumn.offsetHeight; const additionalContentHeight = contentContainer.offsetHeight - sectionGroup.offsetHeight; const valueToCorrectHeightDiff = headerHeight + SECTION_ADJUST_MARGIN_TOP + additionalContentHeight; @@ -136,9 +136,9 @@ formContainerNode.addEventListener('scroll', () => { let firstVisibleSection = currentlyVisibleSections.find((section) => { const { top, height } = section.getBoundingClientRect(); - const headerBottomContainerHeight = header.offsetHeight - headerContainer.offsetHeight; + const headerBottomContainerHeight = header.offsetHeight - headerContainer?.offsetHeight; - return top + height >= headerContainer.offsetHeight + headerBottomContainerHeight + SECTION_ADJUST_MARGIN_TOP; + return top + height >= headerContainer?.offsetHeight + headerBottomContainerHeight + SECTION_ADJUST_MARGIN_TOP; }); if (!firstVisibleSection) { From 8f26ef470076d7500513971801372e6747477ad3 Mon Sep 17 00:00:00 2001 From: ciastektk Date: Mon, 5 Dec 2022 14:34:11 +0100 Subject: [PATCH 3/3] Update src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig Co-authored-by: Jakub Brzegowski --- .../themes/admin/ui/on_the_fly/create_on_the_fly.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig index 9ce93bbfa7..c6fb10d30f 100644 --- a/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig @@ -70,7 +70,7 @@ {% block anchor_menu %} {% set content_edit_anchor_menu = knp_menu_get('ibexa.admin_ui.menu.content_edit.anchor_menu', [], { - 'content': content, + content, 'content_type': content_type, 'location': location, 'parent_location': parent_location,