diff --git a/assets/admin/entrypoint.js b/assets/admin/entrypoint.js new file mode 100644 index 00000000..a2e9ace0 --- /dev/null +++ b/assets/admin/entrypoint.js @@ -0,0 +1 @@ +import '../../vendor/sylius/refund-plugin/assets/entrypoint'; diff --git a/assets/shop/entry.js b/assets/shop/entry.js deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/admin/entry.js b/assets/shop/entrypoint.js similarity index 100% rename from assets/admin/entry.js rename to assets/shop/entrypoint.js diff --git a/composer.json b/composer.json index c325b2cc..08b5e051 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "php": "^8.2", "sylius/invoicing-plugin": "2.0.x-dev", "sylius/paypal-plugin": "2.0.x-dev", + "sylius/refund-plugin": "2.0.x-dev", "sylius/sylius": "2.0.x-dev", "symfony/flex": "^2.4" }, diff --git a/config/bundles.php b/config/bundles.php index 175279ea..7c915f0d 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -66,4 +66,5 @@ FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true], FOS\RestBundle\FOSRestBundle::class => ['all' => true], Sylius\PayPalPlugin\SyliusPayPalPlugin::class => ['all' => true], + Sylius\RefundPlugin\SyliusRefundPlugin::class => ['all' => true], ]; diff --git a/config/packages/_sylius.yaml b/config/packages/_sylius.yaml index 2491c7e9..4b4e252f 100644 --- a/config/packages/_sylius.yaml +++ b/config/packages/_sylius.yaml @@ -30,3 +30,19 @@ sylius_product: product: classes: model: App\Entity\Product\Product + +sylius_twig_hooks: + hooks: + 'sylius_admin.base#stylesheets': + app_styles: + template: 'admin/stylesheets.html.twig' + 'sylius_admin.base#javascripts': + app_javascripts: + template: 'admin/javascripts.html.twig' + + 'sylius_shop.base#stylesheets': + app_styles: + template: 'shop/stylesheets.html.twig' + 'sylius_shop.base#javascripts': + app_javascripts: + template: 'shop/javascripts.html.twig' diff --git a/config/packages/sylius_refund.yaml b/config/packages/sylius_refund.yaml new file mode 100644 index 00000000..ee42ca1f --- /dev/null +++ b/config/packages/sylius_refund.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: "@SyliusRefundPlugin/config/app/config.yml" } diff --git a/config/packages/webpack_encore.yaml b/config/packages/webpack_encore.yaml index f3fc1242..f758b06c 100644 --- a/config/packages/webpack_encore.yaml +++ b/config/packages/webpack_encore.yaml @@ -3,5 +3,7 @@ webpack_encore: builds: shop: '%kernel.project_dir%/public/build/shop' admin: '%kernel.project_dir%/public/build/admin' + app.admin: '%kernel.project_dir%/public/build/app/admin' + app.shop: '%kernel.project_dir%/public/build/app/shop' script_attributes: defer: true diff --git a/config/routes/sylius_refund.yaml b/config/routes/sylius_refund.yaml new file mode 100644 index 00000000..5a8d73d3 --- /dev/null +++ b/config/routes/sylius_refund.yaml @@ -0,0 +1,2 @@ +sylius_refund: + resource: "@SyliusRefundPlugin/config/routing.yml" diff --git a/symfony.lock b/symfony.lock index eb90a185..96666d0c 100644 --- a/symfony.lock +++ b/symfony.lock @@ -546,6 +546,19 @@ "sylius/paypal-plugin": { "version": "2.0.x-dev" }, + "sylius/refund-plugin": { + "version": "2.0", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "0.4", + "ref": "a3f813f608c6f04bd7d0b4cefd73a96bf378c390" + }, + "files": [ + "config/packages/sylius_refund.yaml", + "config/routes/sylius_refund.yaml" + ] + }, "sylius/registry": { "version": "v1.4.1" }, diff --git a/templates/admin/javascripts.html.twig b/templates/admin/javascripts.html.twig new file mode 100644 index 00000000..f6071973 --- /dev/null +++ b/templates/admin/javascripts.html.twig @@ -0,0 +1 @@ +{{ encore_entry_script_tags('app-admin-entry', null, 'app.admin') }} diff --git a/templates/admin/stylesheets.html.twig b/templates/admin/stylesheets.html.twig new file mode 100644 index 00000000..dc98d751 --- /dev/null +++ b/templates/admin/stylesheets.html.twig @@ -0,0 +1 @@ +{{ encore_entry_link_tags('app-admin-entry', null, 'app.admin') }} diff --git a/templates/shop/javascripts.html.twig b/templates/shop/javascripts.html.twig new file mode 100644 index 00000000..a659c2c1 --- /dev/null +++ b/templates/shop/javascripts.html.twig @@ -0,0 +1 @@ +{{ encore_entry_script_tags('app-shop-entry', null, 'app.shop') }} diff --git a/templates/shop/stylesheets.html.twig b/templates/shop/stylesheets.html.twig new file mode 100644 index 00000000..b439fca1 --- /dev/null +++ b/templates/shop/stylesheets.html.twig @@ -0,0 +1 @@ +{{ encore_entry_link_tags('app-shop-entry', null, 'app.shop') }} diff --git a/webpack.config.js b/webpack.config.js index 1e7f94c7..5bbadcb0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -14,7 +14,7 @@ const shopConfig = SyliusShop.getWebpackConfig(path.resolve(__dirname)); Encore .setOutputPath('public/build/app/shop') .setPublicPath('/build/app/shop') - .addEntry('app-shop-entry', './assets/shop/entry.js') + .addEntry('app-shop-entry', './assets/shop/entrypoint.js') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction()) @@ -32,7 +32,7 @@ Encore.reset(); Encore .setOutputPath('public/build/app/admin') .setPublicPath('/build/app/admin') - .addEntry('app-admin-entry', './assets/admin/entry.js') + .addEntry('app-admin-entry', './assets/admin/entrypoint.js') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction())