Skip to content

Commit

Permalink
Use layout templates with LayoutBuilder service instead of layout com…
Browse files Browse the repository at this point in the history
…ponents
  • Loading branch information
boherm authored and Morgan Pichat committed Oct 3, 2023
1 parent 1777f19 commit 0fa75a2
Show file tree
Hide file tree
Showing 13 changed files with 417 additions and 503 deletions.
1 change: 1 addition & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ twig:
'%prestashop_views%': PrestaShopCore
'%kernel.project_dir%/admin-dev/themes/new-theme': AdminNewTheme
globals:
ps: '@PrestaShopBundle\Twig\Layout\LayoutBuilder'
webpack_server: false
multistore_field_prefix: !php/const PrestaShopBundle\Service\Form\MultistoreCheckboxEnabler::MULTISTORE_FIELD_PREFIX
modify_all_shops_prefix: !php/const PrestaShopBundle\Form\Extension\ModifyAllShopsExtension::MODIFY_ALL_SHOPS_PREFIX
Expand Down
71 changes: 23 additions & 48 deletions phpstan-tmp-legacy-layout-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
parameters:
ignoreErrors:
-
message: "#^Class Employee is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/EmployeeDropdown.php

-
message: "#^Namespace Context is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
message: "#^Class Shop is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 2
path: src/PrestaShopBundle/Twig/Component/EmployeeDropdown.php
path: src/PrestaShopBundle/Twig/Component/Head.php

-
message: "#^Namespace Employee is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
message: "#^Namespace Context is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/EmployeeDropdown.php

-
message: "#^Namespace Media is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 2
path: src/PrestaShopBundle/Twig/Component/Head.php

-
message: "#^Namespace Tools is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
message: "#^Namespace Media is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 3
path: src/PrestaShopBundle/Twig/Component/Head.php

Expand All @@ -31,29 +21,34 @@ parameters:
path: src/PrestaShopBundle/Twig/Component/Head.php

-
message: "#^Class Shop is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 2
message: "#^Namespace Tools is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 3
path: src/PrestaShopBundle/Twig/Component/Head.php

-
message: "#^Class Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/MobileQuickAccess.php
count: 2
path: src/PrestaShopBundle/Twig/Component/MultistoreHeader.php

-
message: "#^Namespace Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/MobileQuickAccess.php
path: src/PrestaShopBundle/Twig/Component/MultistoreHeader.php

-
message: "#^Class Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
message: "#^Namespace Configuration is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 2
path: src/PrestaShopBundle/Twig/Component/MultistoreHeader.php
path: src/PrestaShopBundle/Twig/Component/NavBar.php

-
message: "#^Namespace Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/MultistoreHeader.php
message: "#^Namespace Dispatcher is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 2
path: src/PrestaShopBundle/Twig/Component/NavBar.php

-
message: "#^Namespace Tab is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 5
path: src/PrestaShopBundle/Twig/Component/NavBar.php

-
message: "#^Class Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
Expand Down Expand Up @@ -86,31 +81,11 @@ parameters:
path: src/PrestaShopBundle/Twig/Component/QuickAccess.php

-
message: "#^Class Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/SearchForm.php

-
message: "#^Namespace Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/SearchForm.php

-
message: "#^Namespace Configuration is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
message: "#^Namespace Shop is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 2
path: src/PrestaShopBundle/Twig/Component/NavBar.php
path: src/PrestaShopBundle/Twig/Layout/LayoutBuilder.php

-
message: "#^Namespace Dispatcher is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
message: "#^Namespace Tools is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 2
path: src/PrestaShopBundle/Twig/Component/NavBar.php

-
message: "#^Namespace Link is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 1
path: src/PrestaShopBundle/Twig/Component/NavBar.php

-
message: "#^Namespace Tab is forbidden, No legacy calls inside the prestashop bundle\\. Please create an interface and an adapter if you need to\\.$#"
count: 5
path: src/PrestaShopBundle/Twig/Component/NavBar.php
path: src/PrestaShopBundle/Twig/Layout/LayoutBuilder.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@

{% include "@AdminNewTheme/public/preload.html.twig" ignore missing with { 'admin_dir': '/admin-dev/themes/new-theme/public/' } %}

{# To keep retrocompatibility with olders modules and to get a good ordering of things, we need to render this hook in variable for later. #}
{% set displayBackOfficeHeaderRendered = renderhook('displayBackOfficeHeader') %}

{% for css_uri, css_media in this.cssFiles %}
<link href="{{ css_uri|e('html_attr') }}" rel="stylesheet" type="text/css" media="{{ css_media }}"/>
<link href="{{ css_uri }}" rel="stylesheet" type="text/css" media="{{ css_media }}"/>
{% endfor %}

{% if this.jsDef %}
Expand All @@ -53,8 +56,11 @@
</script>
{% endif %}

{% for js_uri in this.jsFiles %}
<script type="text/javascript" src="{{ js_uri|e('html_attr') }}"></script>
{% block headJavascripts %}{% endblock %}

{% for js_uri in this.jsFiles %}
<script type="text/javascript" src="{{ js_uri }}"></script>
{% endfor %}

{{ renderhook('displayBackOfficeHeader') }}
{# After some CSS/JS files inclusion (that can be added in 'displayBackOfficeHeader' hook), we need to display the html compiled that are returned for this hook. #}
{{ displayBackOfficeHeaderRendered|raw }}

This file was deleted.

0 comments on commit 0fa75a2

Please sign in to comment.