Skip to content

Commit

Permalink
Merge pull request #292 from mpysiak/SYL-4003-Bump-demo-to-2.0
Browse files Browse the repository at this point in the history
[Maintenance] Bump demo to 2.0
  • Loading branch information
GSadee authored Nov 5, 2024
2 parents 5b3dbd0 + 8189cba commit 1597130
Show file tree
Hide file tree
Showing 68 changed files with 1,962 additions and 6,858 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.1"]
symfony: ["^6.4"]
php: ["8.3"]
symfony: ["^7.1"]
node: ["20.x"]
mysql: ["8.0"]
mysql: ["8.4"]

env:
APP_ENV: test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/phpspec.yml

/drivers/
private/invoices/

/bin/*
!/bin/console
Expand Down
1 change: 0 additions & 1 deletion assets/admin/entry.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
import 'sylius/bundle/AdminBundle/Resources/private/entry';
1 change: 0 additions & 1 deletion assets/shop/entry.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
import 'sylius/bundle/ShopBundle/Resources/private/entry';
33 changes: 19 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
}
],
"require": {
"php": "^8.1",
"sylius/sylius": "1.14.x-dev as 1.13.99",
"php": "^8.2",
"sylius/sylius": "2.0.x-dev",
"symfony/flex": "^2.4",
"sylius/invoicing-plugin": "~0.25",
"sylius/refund-plugin": "^1.5",
"bugsnag/bugsnag-symfony": "^1.7",
"sylius/paypal-plugin": "^1.6"
"sylius/invoicing-plugin": "2.0.x-dev",
"bugsnag/bugsnag-symfony": "^1.7"
},
"require-dev": {
"behat/behat": "^3.14",
Expand All @@ -41,18 +39,18 @@
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"lakion/mink-debug-extension": "^2.0",
"lchrusciel/api-test-case": "^5.0",
"nyholm/psr7": "^1.8",
"phpspec/phpspec": "^7.0",
"phpunit/phpunit": "^9.5",
"robertfausk/behat-panther-extension": "^1.1",
"stripe/stripe-php": "^6.43",
"sylius-labs/coding-standard": "^4.3",
"symfony/browser-kit": "^6.4",
"symfony/debug-bundle": "^6.4",
"symfony/dotenv": "^6.4",
"symfony/intl": "^6.4",
"symfony/web-profiler-bundle": "^6.4"
"symfony/browser-kit": "^6.4 || ^7.1",
"symfony/debug-bundle": "^6.4 || ^7.1",
"symfony/dotenv": "^6.4 || ^7.1",
"symfony/intl": "^6.4 || ^7.1",
"symfony/web-profiler-bundle": "^6.4 || ^7.1"
},
"conflict": {
"bugsnag/bugsnag-symfony": "1.14.0"
Expand All @@ -77,6 +75,12 @@
"php bin/console doctrine:cache:clear-result",
"php bin/console --no-debug sylius:fixtures:load"
],
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
],
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
Expand All @@ -88,13 +92,14 @@
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false,
"symfony/flex": true
"symfony/flex": true,
"php-http/discovery": true
}
},
"extra": {
"symfony": {
"allow-contrib": true,
"require": "^6.4"
"require": "^7.1"
}
}
}
21 changes: 10 additions & 11 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true],
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true],
Expand All @@ -30,11 +29,6 @@
Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true],
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Expand All @@ -46,23 +40,28 @@
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true],
Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true],
Sylius\Behat\Application\SyliusTestPlugin\SyliusTestPlugin::class => ['test' => true, 'test_cached' => true],
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],
Knp\Bundle\SnappyBundle\KnpSnappyBundle::class => ['all' => true],
Sylius\InvoicingPlugin\SyliusInvoicingPlugin::class => ['all' => true],
Sylius\RefundPlugin\SyliusRefundPlugin::class => ['all' => true],
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
Bugsnag\BugsnagBundle\BugsnagBundle::class => ['all' => true],
Sylius\PayPalPlugin\SyliusPayPalPlugin::class => ['all' => true],
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Symfony\UX\Icons\UXIconsBundle::class => ['all' => true],
Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true],
Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true],
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true],
];
14 changes: 1 addition & 13 deletions config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }

- { resource: "@SyliusPayPalPlugin/Resources/config/config.yaml" }
- { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" }

parameters:
fixtures_dir: "%kernel.project_dir%/src/Resources/fixtures"
Expand All @@ -28,14 +24,6 @@ sylius_theme:
directories:
- "%kernel.project_dir%/themes"

sylius_ui:
events:
sylius.admin.login.form.content:
blocks:
test_credentials:
template: 'Admin/Security/Login/testCredentials.html.twig'
priority: 30

sylius_product:
resources:
product:
Expand Down
12 changes: 0 additions & 12 deletions config/packages/dev/jms_serializer.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ parameters:
doctrine:
dbal:
driver: 'pdo_mysql'
server_version: '5.7'
charset: UTF8

url: '%env(resolve:DATABASE_URL)%'
Expand All @@ -20,7 +19,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
12 changes: 0 additions & 12 deletions config/packages/fos_rest.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions config/packages/jms_serializer.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion config/packages/messenger.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
framework:
messenger:
default_bus: sylius_default.bus
default_bus: sylius.event_bus
10 changes: 0 additions & 10 deletions config/packages/prod/jms_serializer.yaml

This file was deleted.

41 changes: 23 additions & 18 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
security:
enable_authenticator_manager: true
providers:
sylius_admin_user_provider:
id: sylius.admin_user_provider.email_or_name_based
Expand All @@ -9,6 +8,7 @@ security:
id: sylius.shop_user_provider.email_or_name_based
sylius_api_shop_user_provider:
id: sylius.shop_user_provider.email_or_name_based

password_hashers:
Sylius\Component\User\Model\UserInterface: argon2i
firewalls:
Expand All @@ -17,6 +17,7 @@ security:
context: admin
pattern: "%sylius.security.admin_regex%"
provider: sylius_admin_user_provider
user_checker: security.user_checker.chain.admin
form_login:
provider: sylius_admin_user_provider
login_path: sylius_admin_login
Expand All @@ -38,26 +39,28 @@ security:
path: sylius_admin_logout
target: sylius_admin_login

new_api_admin_user:
pattern: "%sylius.security.new_api_admin_regex%/.*"
api_admin:
pattern: "%sylius.security.api_admin_regex%/.*"
provider: sylius_api_admin_user_provider
user_checker: security.user_checker.chain.api_admin
stateless: true
entry_point: jwt
json_login:
check_path: "%sylius.security.new_api_admin_route%/administrators/token"
check_path: "%sylius.security.api_admin_route%/administrators/token"
username_path: email
password_path: password
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
jwt: true

new_api_shop_user:
pattern: "%sylius.security.new_api_shop_regex%/.*"
api_shop:
pattern: "%sylius.security.api_shop_regex%/.*"
provider: sylius_api_shop_user_provider
user_checker: security.user_checker.chain.api_shop
stateless: true
entry_point: jwt
json_login:
check_path: "%sylius.security.new_api_shop_route%/customers/token"
check_path: "%sylius.security.api_shop_route%/customers/token"
username_path: email
password_path: password
success_handler: lexik_jwt_authentication.handler.authentication_success
Expand All @@ -69,6 +72,7 @@ security:
context: shop
pattern: "%sylius.security.shop_regex%"
provider: sylius_shop_user_provider
user_checker: security.user_checker.chain.shop
form_login:
success_handler: sylius.authentication.success_handler
failure_handler: sylius.authentication.failure_handler
Expand All @@ -82,6 +86,12 @@ security:
enable_csrf: true
csrf_parameter: _csrf_shop_security_token
csrf_token_id: shop_authenticate
json_login:
check_path: sylius_shop_json_login_check
username_path: _username
password_path: _password
success_handler: sylius.authentication.success_handler
failure_handler: sylius.authentication.failure_handler
remember_me:
secret: "%env(APP_SECRET)%"
name: APP_SHOP_REMEMBER_ME
Expand All @@ -101,11 +111,6 @@ security:
security: false

access_control:
- { path: "%sylius.security.admin_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] }
- { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS }
- { path: "%sylius.security.shop_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] }
- { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS }

- { path: "%sylius.security.admin_regex%/forgotten-password", role: PUBLIC_ACCESS }

- { path: "%sylius.security.admin_regex%/login", role: PUBLIC_ACCESS }
Expand All @@ -117,9 +122,9 @@ security:
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }

- { path: "%sylius.security.new_api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS }
- { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS }
- { path: "%sylius.security.new_api_admin_route%/administrators/token", role: PUBLIC_ACCESS }
- { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER }
- { path: "%sylius.security.new_api_shop_route%/customers/token", role: PUBLIC_ACCESS }
- { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS }
- { path: "%sylius.security.api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS }
- { path: "%sylius.security.api_admin_regex%/.*", role: ROLE_API_ACCESS }
- { path: "%sylius.security.api_admin_route%/administrators/token", role: PUBLIC_ACCESS }
- { path: "%sylius.security.api_shop_account_regex%/.*", role: ROLE_USER }
- { path: "%sylius.security.api_shop_route%/customers/token", role: PUBLIC_ACCESS }
- { path: "%sylius.security.api_shop_regex%/.*", role: PUBLIC_ACCESS }
2 changes: 0 additions & 2 deletions config/packages/sylius_refund.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions config/packages/sylius_twig_hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
sylius_twig_hooks:
hooks:
'sylius_shop.base.offcanvas':
info_box:
template: "info_box.html.twig"
priority: 100

'sylius_admin.security.login':
info_box:
template: "info_box.html.twig"
priority: 100

'sylius_admin.security.login.content':
info_box:
template: "admin_demo_credentials.html.twig"
priority: 150

'sylius_admin.common.index':
info_box:
template: "info_box.html.twig"
priority: 100

'sylius_shop.base#javascripts':
analytics:
template: "analytics.html.twig"
priority: 100

'sylius_shop.account.login.content.login_container':
analytics:
template: "shop_demo_credentials.html.twig"
priority: 150
Loading

0 comments on commit 1597130

Please sign in to comment.