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

Release 7.0.0 #203

Merged
merged 5 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,21 @@ on: [push, pull_request]
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 7.2 => 8.2
name: PHP Syntax check 8.1 => 8.3
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@master

- name: PHP syntax checker 7.3
uses: prestashop/github-action-php-lint/7.3@master

- name: PHP syntax checker 7.4
uses: prestashop/github-action-php-lint/7.4@master

- name: PHP syntax checker 8.0
uses: prestashop/github-action-php-lint/8.0@master

- name: PHP syntax checker 8.1
uses: prestashop/github-action-php-lint/8.1@master

- name: PHP syntax checker 8.2
uses: prestashop/github-action-php-lint/8.2@master

- name: PHP syntax checker 8.3
uses: prestashop/github-action-php-lint/8.3@master

# Check the PHP code follow the coding standards
php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -35,7 +26,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'

- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -63,7 +54,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'

- name: Checkout
uses: actions/[email protected]
Expand All @@ -86,4 +77,4 @@ jobs:

# Docker images prestashop/prestashop may be used, even if the shop remains uninstalled
- name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }})
run: ./tests/phpstan.sh ${{ matrix.presta-versions }}
run: ./tests/phpstan.sh ${{ matrix.presta-versions }} --error-format=github
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
!vendor/index.php
!vendor/.htaccess
/.php_cs.cache
.php-cs-fixer.cache
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
}
],
"require": {
"php": ">=7.2.5"
"php": ">=8.1.0"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"prestashop/php-dev-tools": "^4.3"
},
"autoload": {
Expand All @@ -28,7 +29,7 @@
"optimize-autoloader": true,
"prepend-autoloader": false,
"platform": {
"php": "7.2.5"
"php": "8.1.0"
}
},
"type": "prestashop-module"
Expand Down
66 changes: 62 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_linklist</name>
<displayName><![CDATA[Link List]]></displayName>
<version><![CDATA[6.0.7]]></version>
<version><![CDATA[7.0.0]]></version>
<description><![CDATA[Adds a block with several links.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down
143 changes: 143 additions & 0 deletions config/admin/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
services:
_defaults:
public: false
autowire: true
autoconfigure: true

PrestaShop\Module\LinkList\Controller\Admin\Improve\Design\LinkBlockController: ~

# Link block form handler
prestashop.module.link_block.form_handler:
class: 'PrestaShop\PrestaShop\Core\Form\FormHandler'
arguments:
$formBuilder: '@=service("form.factory").createBuilder()'
$hookDispatcher: '@prestashop.core.hook.dispatcher'
$formDataProvider: '@PrestaShop\Module\LinkList\Form\LinkBlockFormDataProvider'
$formTypes:
'link_block': 'PrestaShop\Module\LinkList\Form\Type\LinkBlockType'
$hookName: 'AdminLinkWidget'

# Link block form data provider
PrestaShop\Module\LinkList\Form\LinkBlockFormDataProvider:
arguments:
$repository: '@PrestaShop\Module\LinkList\Repository\LinkBlockRepository'
$cache: '@PrestaShop\Module\LinkList\Cache\LegacyLinkBlockCache'
$languages: '@=service("prestashop.adapter.legacy.context").getLanguages(false, service("prestashop.adapter.shop.context").getContextShopID())'
$shopContext: '@prestashop.adapter.shop.context'
$configuration: '@prestashop.adapter.legacy.configuration'

PrestaShop\Module\LinkList\Cache\LegacyLinkBlockCache: ~

# Form types
PrestaShop\Module\LinkList\Form\Type\LinkBlockType:
parent: 'form.type.translatable.aware'
arguments:
$hookChoices: '@=service("prestashop.module.link_block.choice_provider.hook").getChoices()'
$cmsPageChoices: '@=service("prestashop.module.link_block.choice_provider.cms_page").getChoices()'
$productPageChoices: '@=service("prestashop.module.link_block.choice_provider.product_page").getChoices()'
$staticPageChoices: '@=service("prestashop.module.link_block.choice_provider.static_page").getChoices()'
$categoryChoices: '@=service("prestashop.module.link_block.choice_provider.category").getChoices()'
$isMultiStoreUsed: '@=service("prestashop.adapter.feature.multistore").isUsed()'
tags:
- { name: form.type }

PrestaShop\Module\LinkList\Form\Type\CustomUrlType:
parent: 'form.type.translatable.aware'
tags:
- { name: form.type }

PrestaShop\Module\LinkList\Form\Type\TranslateCustomUrlType:
parent: 'form.type.translatable.aware'
public: true
arguments:
- "@=service('prestashop.adapter.legacy.context').getAvailableLanguages()"
- '@router.default'
- "@=service('prestashop.adapter.legacy.configuration').getBoolean('PS_BO_ALLOW_EMPLOYEE_FORM_LANG')"
- "@=service('prestashop.adapter.legacy.context').getContext().cookie.employee_form_lang"
- "@=service('prestashop.adapter.legacy.configuration').getInt('PS_LANG_DEFAULT')"
tags:
- { name: form.type }

# Grid data query builder
prestashop.module.link_block.grid.query_builder:
class: PrestaShop\Module\LinkList\Core\Grid\Query\LinkBlockQueryBuilder
arguments:
$connection: '@doctrine.dbal.default_connection'
$dbPrefix: '%database_prefix%'

# Grid Data Factory
prestashop.module.link_block.grid.data_factory:
class: '%prestashop.core.grid.data.factory.doctrine_grid_data_factory%'
arguments:
$gridQueryBuilder: '@prestashop.module.link_block.grid.query_builder'
$hookDispatcher: '@prestashop.core.hook.dispatcher'
$queryParser: '@prestashop.core.grid.query.doctrine_query_parser'
$gridId: 'link_block'

# Link block grid Factory
PrestaShop\Module\LinkList\Core\Grid\LinkBlockGridFactory:
arguments:
$translator: '@translator'
$hookDispatcher: '@prestashop.core.hook.dispatcher'
$dataFactory: '@prestashop.module.link_block.grid.data_factory'
$filterFormFactory: '@prestashop.core.grid.filter.form_factory'
$shopContext: '@prestashop.adapter.shop.context'

# Form choices providers
prestashop.module.link_block.choice_provider.hook:
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\HookChoiceProvider
arguments:
$connection: '@doctrine.dbal.default_connection'
$dbPrefix: '%database_prefix%'

prestashop.module.link_block.choice_provider.cms_category:
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\CMSCategoryChoiceProvider
arguments:
$connection: '@doctrine.dbal.default_connection'
$dbPrefix: '%database_prefix%'
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id'
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()'

prestashop.module.link_block.choice_provider.category:
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\CategoryChoiceProvider
arguments:
$connection: '@doctrine.dbal.default_connection'
$dbPrefix: '%database_prefix%'
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id'
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()'

prestashop.module.link_block.choice_provider.cms_page:
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\CMSPageChoiceProvider
arguments:
$connection: '@doctrine.dbal.default_connection'
$dbPrefix: '%database_prefix%'
$categories: '@=service("prestashop.module.link_block.choice_provider.cms_category").getChoices()'
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id'
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()'

prestashop.module.link_block.choice_provider.product_page:
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\PageChoiceProvider
arguments:
$connection: '@doctrine.dbal.default_connection'
$dbPrefix: '%database_prefix%'
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id'
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()'
$pageNames:
- 'prices-drop'
- 'new-products'
- 'best-sales'

prestashop.module.link_block.choice_provider.static_page:
class: PrestaShop\Module\LinkList\Form\ChoiceProvider\PageChoiceProvider
arguments:
$connection: '@doctrine.dbal.default_connection'
$dbPrefix: '%database_prefix%'
$idLang: '@=service("prestashop.adapter.legacy.context").getLanguage().id'
$shopIds: '@=service("prestashop.adapter.shop.context").getContextListShopID()'
$pageNames:
- 'contact'
- 'sitemap'
- 'stores'
- 'authentication'
- 'registration'
- 'my-account'
Loading
Loading