diff --git a/README.md b/README.md index 7fa9f6082..82f27f6d3 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [![](https://bitbag.io/wp-content/uploads/2021/01/CMS.png)](https://bitbag.io/contact-us/?utm_source=github&utm_medium=referral&utm_campaign=plugins_cms) -# BitBag SyliusCMSPlugin +# Sylius CMS Plugin ---- diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 51094240f..dcd239384 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -14,11 +14,11 @@ and [Templates](doc/templates.md) docs. * Reordered forms/elements for functionality consistency. * Updated import functionality to work with the new structure. * Updated fixtures to work with the new structure -* Removed `bitbag_cms_render_product_pages` twig extension. +* Removed `sylius_cms_render_product_pages` twig extension. * Removed support for rendering twig functions in WYSIWYG editor. * Added twig extensions: - * `bitbag_cms_render_collection` - * `bitbag_cms_render_content_elements` + * `sylius_cms_render_collection` + * `sylius_cms_render_content_elements` ## Briefly about Content Elements diff --git a/UPGRADE.md b/UPGRADE.md index 0e3db3428..b04679a0c 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -19,7 +19,7 @@ structure using `bin/console doctrine:migrations:diff && bin/console doctrine:mi use raw content in [WYSIWYG editor](doc/wysiwyg.md) * Chanel awareness has been added to pages, blocks, FAQs, sections and media. That being said, many repository methods changed their signatures. In case you customized them in your src, check -new signatures in interfaces under [BitBag\SyliusCmsPlugin\Repository](src/Repository) namespace +new signatures in interfaces under [Sylius\CmsPlugin\Repository](src/Repository) namespace * WYSIWYG editor has been introduced. You will need to import it in your AppKernel and install its assets. For more, check the [installation guide](doc/installation.md) * Sitemap support was added, you will need to enable extra bundle in your AppKernel. Read more diff --git a/behat.yml.dist b/behat.yml.dist index 6c02a541e..b3bfe96cc 100755 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -47,7 +47,7 @@ default: FriendsOfBehat\SymfonyExtension: bootstrap: tests/Application/config/bootstrap.php kernel: - class: Tests\BitBag\SyliusCmsPlugin\Application\Kernel + class: Tests\Sylius\CmsPlugin\Application\Kernel FriendsOfBehat\VariadicExtension: ~ diff --git a/composer.json b/composer.json index 6f32f2416..4d334066f 100644 --- a/composer.json +++ b/composer.json @@ -9,11 +9,10 @@ "description": "CMS plugin for Sylius applications.", "license": "MIT", "require": { - "php": "^8.0", + "php": "^8.1", "sylius/sylius": "^1.12.0 || ^1.13.0", "league/csv": "^9.1", "friendsofsymfony/ckeditor-bundle": "^2.0", - "instaclick/php-webdriver": "^1.4", "symfony/webpack-encore-bundle": "^1.12" }, "require-dev": { @@ -31,6 +30,7 @@ "friends-of-behat/suite-settings-extension": "^1.0", "friends-of-behat/symfony-extension": "^2.1", "friends-of-behat/variadic-extension": "^1.3", + "instaclick/php-webdriver": "^1.4", "lchrusciel/api-test-case": "^4.1 || ^5.0", "matthiasnoback/symfony-config-test": "^5.1", "phpspec/phpspec": "^7.2", @@ -51,26 +51,19 @@ "symfony/runtime": "^5.4 || ^6.4", "symfony/web-profiler-bundle": "^5.4 || ^6.4" }, - "conflict": { - "symfony/symfony": "4.1.8", - "symfony/browser-kit": "4.1.8", - "symfony/dom-crawler": "4.1.8", - "symfony/routing": "4.1.8", - "symfony/doctrine-bridge": "4.4.16" - }, "suggest": { - "stefandoorn/sitemap-plugin": "^2.0@alpha" + "stefandoorn/sitemap-plugin": "^2.2" }, "prefer-stable": true, "autoload": { "psr-4": { - "BitBag\\SyliusCmsPlugin\\": "src/", - "Tests\\BitBag\\SyliusCmsPlugin\\": "tests/" + "Sylius\\CmsPlugin\\": "src/", + "Tests\\Sylius\\CmsPlugin\\": "tests/" } }, "autoload-dev": { "psr-4": { - "spec\\BitBag\\SyliusCmsPlugin\\": "spec/" + "spec\\Sylius\\CmsPlugin\\": "spec/" }, "classmap": ["tests/Application/Kernel.php"] }, diff --git a/doc/01.1-webpack-config.md b/doc/01.1-webpack-config.md index 8f2858c77..5252c5524 100644 --- a/doc/01.1-webpack-config.md +++ b/doc/01.1-webpack-config.md @@ -1,4 +1,4 @@ -# BitBag SyliusCmsPlugin +# SyliusCmsPlugin - [⬅️ Back](./installation.md) @@ -13,10 +13,10 @@ ```js // webpack.config.js -const [ bitbagCmsShop, bitbagCmsAdmin ] = require('./vendor/bitbag/cms-plugin/webpack.config.js') +const [ cmsShop, cmsAdmin ] = require('./vendor/bitbag/cms-plugin/webpack.config.js') ... -module.exports = [..., bitbagCmsShop, bitbagCmsAdmin]; +module.exports = [..., cmsShop, cmsAdmin]; ``` 2. Add new packages in `./config/packages/assets.yaml` @@ -29,9 +29,9 @@ framework: packages: # ... cms_shop: - json_manifest_path: '%kernel.project_dir%/public/build/bitbag/cms/shop/manifest.json' + json_manifest_path: '%kernel.project_dir%/public/build/cms/shop/manifest.json' cms_admin: - json_manifest_path: '%kernel.project_dir%/public/build/bitbag/cms/admin/manifest.json' + json_manifest_path: '%kernel.project_dir%/public/build/cms/admin/manifest.json' ``` 3. Add new build paths in `./config/packages/webpack_encore.yml` @@ -42,24 +42,24 @@ framework: webpack_encore: builds: # ... - cms_shop: '%kernel.project_dir%/public/build/bitbag/cms/shop' - cms_admin: '%kernel.project_dir%/public/build/bitbag/cms/admin' + cms_shop: '%kernel.project_dir%/public/build/cms/shop' + cms_admin: '%kernel.project_dir%/public/build/cms/admin' ``` 4. Add encore functions to your templates ```twig {# @SyliusShopBundle/_scripts.html.twig #} -{{ encore_entry_script_tags('bitbag-cms-shop', null, 'cms_shop') }} +{{ encore_entry_script_tags('sylius-cms-shop', null, 'cms_shop') }} {# @SyliusShopBundle/_styles.html.twig #} -{{ encore_entry_link_tags('bitbag-cms-shop', null, 'cms_shop') }} +{{ encore_entry_link_tags('sylius-cms-shop', null, 'cms_shop') }} {# @SyliusAdminBundle/_scripts.html.twig #} -{{ encore_entry_script_tags('bitbag-cms-admin', null, 'cms_admin') }} +{{ encore_entry_script_tags('sylius-cms-admin', null, 'cms_admin') }} {# @SyliusAdminBundle/_styles.html.twig #} -{{ encore_entry_link_tags('bitbag-cms-admin', null, 'cms_admin') }} +{{ encore_entry_link_tags('sylius-cms-admin', null, 'cms_admin') }} ``` 5. Run `yarn encore dev` or `yarn encore production` diff --git a/doc/01.2-webpack-entry.md b/doc/01.2-webpack-entry.md index 1b05a90af..f9f3bac48 100644 --- a/doc/01.2-webpack-entry.md +++ b/doc/01.2-webpack-entry.md @@ -1,4 +1,4 @@ -# BitBag SyliusCmsPlugin +# SyliusCmsPlugin - [⬅️ Back](./installation.md) @@ -14,26 +14,26 @@ // ./webpack.config.js // Shop config - .addEntry('bitbag-cms-shop', 'vendor/bitbag/cms-plugin/src/Resources/assets/shop/entry.js') + .addEntry('sylius-cms-shop', 'vendor/bitbag/cms-plugin/src/Resources/assets/shop/entry.js') // Admin config - .addEntry('bitbag-cms-admin', 'vendor/bitbag/cms-plugin/src/Resources/assets/admin/entry.js') + .addEntry('sylius-cms-admin', 'vendor/bitbag/cms-plugin/src/Resources/assets/admin/entry.js') ``` 2. Add encore functions to your templates ```twig {# @SyliusShopBundle/_scripts.html.twig #} -{{ encore_entry_script_tags('bitbag-cms-shop', null, 'shop') }} +{{ encore_entry_script_tags('sylius-cms-shop', null, 'shop') }} {# @SyliusShopBundle/_styles.html.twig #} -{{ encore_entry_link_tags('bitbag-cms-shop', null, 'shop') }} +{{ encore_entry_link_tags('sylius-cms-shop', null, 'shop') }} {# @SyliusAdminBundle/_scripts.html.twig #} -{{ encore_entry_script_tags('bitbag-cms-admin', null, 'admin') }} +{{ encore_entry_script_tags('sylius-cms-admin', null, 'admin') }} {# @SyliusAdminBundle/_styles.html.twig #} -{{ encore_entry_link_tags('bitbag-cms-admin', null, 'admin') }} +{{ encore_entry_link_tags('sylius-cms-admin', null, 'admin') }} ``` 3. Run `yarn encore dev` or `yarn encore production` diff --git a/doc/01.3-import-entry.md b/doc/01.3-import-entry.md index b9682057b..35d9b0140 100644 --- a/doc/01.3-import-entry.md +++ b/doc/01.3-import-entry.md @@ -1,4 +1,4 @@ -# BitBag SyliusCmsPlugin +# SyliusCmsPlugin - [⬅️ Back](./installation.md) diff --git a/doc/01.4-custom-solution.md b/doc/01.4-custom-solution.md index c8289ce29..a232831f4 100644 --- a/doc/01.4-custom-solution.md +++ b/doc/01.4-custom-solution.md @@ -1,4 +1,4 @@ -# BitBag SyliusCmsPlugin +# SyliusCmsPlugin - [⬅️ Back](./installation.md) diff --git a/doc/01.5-non-webpack.md b/doc/01.5-non-webpack.md index b20d41b1c..174faab67 100644 --- a/doc/01.5-non-webpack.md +++ b/doc/01.5-non-webpack.md @@ -1,4 +1,4 @@ -# BitBag SyliusCmsPlugin +# SyliusCmsPlugin - [⬅️ Back](./installation.md) @@ -20,21 +20,21 @@ $ bin/console assets:install ```twig {# @SyliusAdminBundle/_scripts.html.twig #} {% include '@SyliusUi/_javascripts.html.twig' with { - 'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-admin.js' + 'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-admin.js' } %} {# @SyliusAdminBundle/_styles.html.twig #} {% include '@SyliusUi/_stylesheets.html.twig' with { - 'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-admin.css' + 'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-admin.css' } %} {# @SyliusShopBundle/_scripts.html.twig #} {% include '@SyliusUi/_javascripts.html.twig' with { - 'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-shop.js' + 'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-shop.js' } %} {# @SyliusShopBundle/_styles.html.twig #} {% include '@SyliusUi/_stylesheets.html.twig' with { - 'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-shop.css' + 'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-shop.css' } %} ``` diff --git a/doc/blocks.md b/doc/blocks.md index 56fd4379e..bd421f810 100644 --- a/doc/blocks.md +++ b/doc/blocks.md @@ -7,7 +7,7 @@ Blocks can be placed on the homepage, product page, or any other page of your st ### Rendering the block -In the admin panel, you can create block resources. It could be rendered in your twig templates using `bitbag_cms_render_block([block_code])` helper extension. +In the admin panel, you can create block resources. It could be rendered in your twig templates using `sylius_cms_render_block([block_code])` helper extension. For instance, let's assume you created a block with `homepage_intro` code and want to render it on store homepage. In your `app/Resources/views/SyliusShopBundle/Homepage/index.html.twig` file add the Twig filter like this: @@ -16,17 +16,17 @@ In your `app/Resources/views/SyliusShopBundle/Homepage/index.html.twig` file add {% block content %} -{{ bitbag_cms_render_block('homepage_intro') }} +{{ sylius_cms_render_block('homepage_intro') }} {% endblock %} ``` -`{{ bitbag_cms_render_block([block_code]) }}` function can also take two additional parameters: `template` and `context`. +`{{ sylius_cms_render_block([block_code]) }}` function can also take two additional parameters: `template` and `context`. `template` allows you to render a block with a custom template. For instance: ```twig -{{ bitbag_cms_render_block('homepage_intro', '@App/Some/Template/_path.html.twig') }} +{{ sylius_cms_render_block('homepage_intro', '@App/Some/Template/_path.html.twig') }} ``` `context` allows you to pass additional variables to the block template. It can be one of three types: @@ -37,9 +37,9 @@ In your `app/Resources/views/SyliusShopBundle/Homepage/index.html.twig` file add For instance: ```twig -{{ bitbag_cms_render_block('homepage_intro', null, {'some_variable': 'some_value'}) }} -{{ bitbag_cms_render_block('homepage_intro', null, product) }} -{{ bitbag_cms_render_block('homepage_intro', null, taxon) }} +{{ sylius_cms_render_block('homepage_intro', null, {'some_variable': 'some_value'}) }} +{{ sylius_cms_render_block('homepage_intro', null, product) }} +{{ sylius_cms_render_block('homepage_intro', null, taxon) }} ``` When you pass `ProductInterface` or `TaxonInterface` as a context, the block will be rendered only if it is assigned to the given product or taxon @@ -52,5 +52,5 @@ in the admin panel. If you don't know how to override templates yet, read [Sylius template customization guide](http://docs.sylius.org/en/latest/customization/template.html). -Even if you can pass template argument to render block resource, you can change the global templates under `app/templates/bundles/BitBagSyliusCmsPlugin/Shop/Block` location. +Even if you can pass template argument to render block resource, you can change the global templates under `app/templates/bundles/SyliusCmsPlugin/Shop/Block` location. Available templates you can override can be found under [this location](../src/Resources/views/Shop/Block). diff --git a/doc/collections.md b/doc/collections.md index bbf01a6af..9f37fc3f3 100644 --- a/doc/collections.md +++ b/doc/collections.md @@ -10,20 +10,20 @@ Or you might want to group all of your specific blocks together in a collection ### Rendering the collection In the admin panel, you can create collection resources. -It could be rendered in your twig templates using `bitbag_cms_render_collection([collection_code])` helper extension. +It could be rendered in your twig templates using `sylius_cms_render_collection([collection_code])` helper extension. -`{{ bitbag_cms_render_collection([collection_code]) }}` function can also take two additional parameters: `countToRender` and `template`. +`{{ sylius_cms_render_collection([collection_code]) }}` function can also take two additional parameters: `countToRender` and `template`. `countToRender` allows you to render a specific number of items from the collection. For instance: ```twig -{{ bitbag_cms_render_collection('homepage_blocks', 3) }} +{{ sylius_cms_render_collection('homepage_blocks', 3) }} ``` `template` allows you to render a collection with a custom template. For instance: ```twig -{{ bitbag_cms_render_collection('homepage_blocks', null, '@App/Some/Template/_path.html.twig') }} +{{ sylius_cms_render_collection('homepage_blocks', null, '@App/Some/Template/_path.html.twig') }} ``` By default, collection items are sorted by object ID parameter. If you want to change it, you can use decorator strategy. @@ -35,5 +35,5 @@ You can read more about it [here](https://symfony.com/doc/current/service_contai If you don't know how to override templates yet, read [Sylius template customization guide](http://docs.sylius.org/en/latest/customization/template.html). -Even if you can pass template argument to render collection resource, you can change the global templates under `app/templates/bundles/BitBagSyliusCmsPlugin/Shop/Collection` location. +Even if you can pass template argument to render collection resource, you can change the global templates under `app/templates/bundles/SyliusCmsPlugin/Shop/Collection` location. Available templates you can override can be found under [this location](../src/Resources/views/Shop/Collection). diff --git a/doc/content_elements.md b/doc/content_elements.md index 6d31c8842..468a3dea0 100644 --- a/doc/content_elements.md +++ b/doc/content_elements.md @@ -17,8 +17,8 @@ Currently, there are 11 predefined content elements available: - **[Pages collection](content_elements/pages_collection.md)** - a collection of pages - **[Spacer](content_elements/spacer.md)** - a simple spacer with a defined height in pixels -Instead of rendering block or page, you can render just content elements in your twig templates using `bitbag_cms_render_content_elements([page|block])` helper extension, -where `page` or `block` is an instance of `BitBag\SyliusCmsPlugin\Entity\PageInterface` or `BitBag\SyliusCmsPlugin\Entity\BlockInterface`. +Instead of rendering block or page, you can render just content elements in your twig templates using `sylius_cms_render_content_elements([page|block])` helper extension, +where `page` or `block` is an instance of `Sylius\CmsPlugin\Entity\PageInterface` or `Sylius\CmsPlugin\Entity\BlockInterface`. ## Customization @@ -29,7 +29,7 @@ Each of the content elements has its own template that you can override. If you don't know how to override templates yet, read [Sylius template customization guide](http://docs.sylius.org/en/latest/customization/template.html). -You can create a template under `app/templates/bundles/BitBagSyliusCmsPlugin/Shop/ContentElement` location. +You can create a template under `app/templates/bundles/SyliusCmsPlugin/Shop/ContentElement` location. Available templates you can override can be found under [this location](../src/Resources/views/Shop/ContentElement). ### Creating a new content element @@ -48,7 +48,7 @@ final class TextContentElementType extends AbstractType { $builder ->add(self::TYPE, TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.type.' . self::TYPE, + 'label' => 'sylius_cms.ui.content_elements.type.' . self::TYPE, ]) ; } @@ -59,21 +59,21 @@ final class TextContentElementType extends AbstractType ```yaml parameters: - bitbag_sylius_cms_plugin.content_elements.type.text: !php/const 'YourNamespace\Form\Type\ContentElements\TextContentElementType::TYPE' + sylius_cms.content_elements.type.text: !php/const 'YourNamespace\Form\Type\ContentElements\TextContentElementType::TYPE' ``` 3. Define form type in service container under `config/services.yml` with correct tags: ```yaml services: - bitbag_sylius_cms_plugin.form.type.content_element.text: + sylius_cms.form.type.content_element.text: class: YourNamespace\Form\Type\ContentElements\TextContentElementType tags: - - { name: 'bitbag_sylius_cms_plugin.content_elements.type', key: '%bitbag_sylius_cms_plugin.content_elements.type.text%' } + - { name: 'sylius_cms.content_elements.type', key: '%sylius_cms.content_elements.type.text%' } - { name: 'form.type' } ``` -4. Create a new renderer class under `src/Renderer/ContentElement` location. Implement `BitBag\SyliusCmsPlugin\Renderer\ContentElement\ContentElementRendererInterface` interface. +4. Create a new renderer class under `src/Renderer/ContentElement` location. Implement `Sylius\CmsPlugin\Renderer\ContentElement\ContentElementRendererInterface` interface. For example, you can create a new renderer called `TextContentElementRenderer`: ```php @@ -92,7 +92,7 @@ final class TextContentElementRenderer implements ContentElementRendererInterfac { $text = $contentConfiguration->getConfiguration()['text']; - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ 'content_element' => '@YourNamespace/Shop/ContentElement/_text.html.twig', 'text' => $text, ]); @@ -104,15 +104,15 @@ final class TextContentElementRenderer implements ContentElementRendererInterfac ```yaml services: - bitbag_sylius_cms_plugin.renderer.content_element.text: + sylius_cms.renderer.content_element.text: class: YourNamespace\Renderer\ContentElement\TextContentElementRenderer arguments: - '@twig' tags: - - { name: 'bitbag_sylius_cms_plugin.renderer.content_element' } + - { name: 'sylius_cms.renderer.content_element' } ``` -6. Finally, create a new template under `templates/bundles/BitBagSyliusCmsPlugin/Shop/ContentElement` location. +6. Finally, create a new template under `templates/bundles/SyliusCmsPlugin/Shop/ContentElement` location. For example, you can create a new template called `_text.html.twig`: ```twig diff --git a/doc/customization.md b/doc/customization.md index e5e398d9c..f73654d61 100644 --- a/doc/customization.md +++ b/doc/customization.md @@ -9,34 +9,34 @@ You can customize this plugin using: In order to check what services are available with this plugin, run the following command: ```bash -$ bin/console debug:container bitbag_sylius_cms_plugin +$ bin/console debug:container sylius_cms ``` **Note:** -*All forms are prefixed with 'bitbag_sylius_cms_plugin.form.*'* +*All forms are prefixed with 'sylius_cms.form.*'* If you want to check what routes are available with this plugin, use: ```bash -$ bin/console debug:router | grep bitbag_sylius_cms_plugin +$ bin/console debug:router | grep sylius_cms ``` To check parameters available with the plugin, execute: ```bash -$ bin/console debug:container --parameters | grep bitbag +$ bin/console debug:container --parameters | grep sylius_cms ``` ## How to disable localised URLs? -Customise vendor routing in the file `app/Resources/BitBagSyliusCmsPlugin/config/routing.yml` (create if not exist). +Customise vendor routing in the file `app/Resources/SyliusCmsPlugin/config/routing.yml` (create if not exist). Add: ``` -bitbag_sylius_cms_plugin_admin: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin.yml" +sylius_cms_admin: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin.yml" prefix: /admin -bitbag_sylius_cms_plugin_shop: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop.yml" +sylius_cms_shop: + resource: "@SyliusCmsPlugin/Resources/config/routing/shop.yml" prefix: / sylius_sitemap: diff --git a/doc/fixtures.md b/doc/fixtures.md index 5b3d2c191..c4cc0a82f 100644 --- a/doc/fixtures.md +++ b/doc/fixtures.md @@ -9,4 +9,4 @@ read [this documentation page](http://docs.sylius.com/en/1.2/book/architecture/f ## General usage -As you can see in [here](../tests/Application/config/packages/bitbag_sylius_cms_plugin.yml), cms fixtures are configured to be run under `default` suite. It means that after installing plugin all you need to do is run `bin/console sylius:fixtures:load` and all of cms fixtures will load as well. +As you can see in [here](../tests/Application/config/packages/sylius_cms.yml), cms fixtures are configured to be run under `default` suite. It means that after installing plugin all you need to do is run `bin/console sylius:fixtures:load` and all of cms fixtures will load as well. diff --git a/doc/importing-resources.md b/doc/importing-resources.md index 3e80977e5..0e8d0e696 100644 --- a/doc/importing-resources.md +++ b/doc/importing-resources.md @@ -38,13 +38,13 @@ As previously mentioned, in order to import a data, you need to pick specific re In order to import data via command, execute: ```bash -$ bin/console bitbag:import:csv [resource code] [path/to/your/csv/file.csv] +$ bin/console cms:import:csv [resource code] [path/to/your/csv/file.csv] ``` For instance, if you wish to import a page, run: ```bash -$ bin/console bitbag:import:csv page ~/Documents/pages.csv +$ bin/console cms:import:csv page ~/Documents/pages.csv ``` ## Importing via admin panel @@ -63,7 +63,7 @@ the resolver needs to create a new resource or update an existing one: ```yaml app.resolver.resource.product: - class: BitBag\SyliusCmsPlugin\Resolver\ResourceResolver + class: Sylius\CmsPlugin\Resolver\ResourceResolver arguments: - "@sylius.repository.product" - "@sylius.factory.product" @@ -79,7 +79,7 @@ declare(strict_types=1); namespace AppBundle\Importer; -use BitBag\SyliusCmsPlugin\Importer\ImporterInterface; +use Sylius\CmsPlugin\Importer\ImporterInterface; interface ProductImporterInterface extends ImporterInterface { @@ -99,8 +99,8 @@ declare(strict_types=1); namespace AppBundle\Importer; -use BitBag\SyliusCmsPlugin\Importer\AbstractImporter; -use BitBag\SyliusCmsPlugin\Resolver\ResourceResolverInterface; +use Sylius\CmsPlugin\Importer\AbstractImporter; +use Sylius\CmsPlugin\Resolver\ResourceResolverInterface; use Doctrine\ORM\EntityManagerInterface; use Sylius\Component\Locale\Context\LocaleContextInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -180,12 +180,12 @@ final class ProductImporter extends AbstractImporter implements ProductImporterI - "@validator" - "@doctrine.orm.entity_manager" tags: - - { name: bitbag.cmsplugin.importer } + - { name: cms_plugin.importer } ``` 5. :tada: -Now you can use the `$ bin/console bitbag:import:csv product /path/to/products.csv/file` command to upload your products. +Now you can use the `$ bin/console cms:import:csv product /path/to/products.csv/file` command to upload your products. Read the below section to enable the import from UI feature. @@ -212,7 +212,7 @@ sylius_grid: ### Overriding the importer grid template -Create an `_importForm.html.twig` file under `app/Resources/BitBagSyliusCmsPlugin/views/Grid/Form` location. Take a look at +Create an `_importForm.html.twig` file under `app/Resources/SyliusCmsPlugin/views/Grid/Form` location. Take a look at the default [_importForm.html.twig](../src/Resources/views/Grid/Form/_importForm.html.twig) file. ### Example diff --git a/doc/installation.md b/doc/installation.md index 69694055a..6ae5939f9 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -4,36 +4,35 @@ 1. *We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.* ```bash -$ composer require bitbag/cms-plugin --no-scripts +composer require bitbag/cms-plugin --no-scripts ``` -2. Add plugin dependencies to your `config/bundles.php` file: +2. Add plugin dependencies to your `config/bundles.php` file (if not added automatically): ```php return [ ... FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], // WYSIWYG editor - BitBag\SyliusCmsPlugin\BitBagSyliusCmsPlugin::class => ['all' => true], + Sylius\CmsPlugin\SyliusCmsPlugin::class => ['all' => true], ]; ``` -The first line above (FOSCKEditorBundle) might have been already added during composer require command. -Install WYSIWYG editor ([FOS CKEditor](https://symfony.com/doc/master/bundles/FOSCKEditorBundle/usage/ckeditor.html)) +3. Install WYSIWYG editor ([FOS CKEditor](https://symfony.com/doc/master/bundles/FOSCKEditorBundle/usage/ckeditor.html)) ```bash -$ bin/console ckeditor:install +bin/console ckeditor:install ``` **Note.** If you have an issue with the ckeditor not running, please try to install it using the `4.22.1` tag: ```bash -$ bin/console ckeditor:install --tag=4.22.1 +bin/console ckeditor:install --tag=4.22.1 ``` For more information regardin `4.22.1` tag please visit the #485 issue. -Since FOSCKEditorBundle 2.0, to make Twig render the WYSIWYG editor, you must add some configuration under the `twig.form_themes` config key: +#### If you are not using Symfony Flex, you need to add the following configuration under the `twig.form_themes` config key: ```yaml # Symfony 2/3: app/config/config.yml @@ -42,69 +41,38 @@ Since FOSCKEditorBundle 2.0, to make Twig render the WYSIWYG editor, you must ad twig: form_themes: - '@FOSCKEditor/Form/ckeditor_widget.html.twig' - - '@BitBagSyliusCmsPlugin/Form/ckeditor_widget.html.twig' + - '@SyliusCmsPlugin/Form/ckeditor_widget.html.twig' ``` -3. Import required config in your `config/packages/_sylius.yaml` file: +4. If you are not using Symfony Flex, import add following configs: ```yaml # config/packages/_sylius.yaml imports: ... - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/config.yml" } -``` - -4. Import routing in your `config/routes.yaml` file: + - { resource: "@SyliusCmsPlugin/Resources/config/config.yml" } -```yaml # config/routes.yaml ... -bitbag_sylius_cms_plugin: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing.yml" -``` -If You have installed https://github.com/stefandoorn/sitemap-plugin according to its installation instructions -import optional sitemap providers: -```yaml -# config/services.yaml -... -imports: -... - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/services/sitemap_provider.yml" } -``` - -and plugin dependency to your `config/bundles.php` file: -```php -return [ - ... - - SitemapPlugin\SitemapPlugin::class => ['all' => true], // Sitemap support -]; -``` - -you will probably need to change the extension of the imported file in - -```yaml -# config/packages/sitemap_plugin.yaml - - imports: - - { resource: "@SitemapPlugin/Resources/config/config.yaml" } +sylius_cms: + resource: "@SyliusCmsPlugin/Resources/config/routing.yml" ``` 5. Finish the installation by updating the database schema and installing assets: ```bash -$ bin/console cache:clear +bin/console cache:clear # If you used migrations in your project... -$ bin/console doctrine:migrations:migrate +bin/console doctrine:migrations:migrate # ... or if you use doctrine schema tool. -$ bin/cosole doctrine:schema:update --dump-sql # and --force switch when you're ready :) +bin/cosole doctrine:schema:update --dump-sql # and --force switch when you're ready :) -$ bin/console assets:install --symlink -$ bin/console sylius:theme:assets:install --symlink +bin/console assets:install --symlink +bin/console sylius:theme:assets:install --symlink ``` Note. In some cases the `--symlink` option [may trow some errors](https://github.com/Sylius/SyliusThemeBundle/issues/91). If you consider running the commands without `--symlink` option, please keep in mind to run them on every potential plugin update. @@ -123,39 +91,19 @@ We recommend you to use Webpack (Encore), for which we have prepared four differ However, if you are not using Webpack, here are instructions on how to add optimized and compressed assets directly to your project templates: -- [Non webpack solution](./01.5-non-webpack.md) - -7. Passing required "backend" values to "frontend" - -In order to make plugin finally work you need to declare "route", in admin _scripts.html.twig you can pass: - -``` - -``` - -Any other approach, that will allow cms pages to read this value in js, under "route" key, will work. +- [Non webpack solution](./01.5-non-webpack.md) ## Testing & running the plugin ```bash -$ composer install -$ cd tests/Application -``` -Copy file `package.json.~1.XX.0.dist` to `package.json` where `~1.XX.0` is the Sylius version you are using. - -```bash -$ cp package.json.~1.12.0.dist package.json -``` - -```bash -$ yarn install -$ yarn encore dev -$ APP_ENV=test bin/console assets:install -$ APP_ENV=test bin/console doctrine:schema:create -$ APP_ENV=test symfony server:start --port=8080 -d -$ cd ../.. -$ open http://localhost:8080 -$ vendor/bin/behat -$ vendor/bin/phpspec run +composer install +cd tests/Application +yarn install +yarn encore dev +APP_ENV=test bin/console assets:install +APP_ENV=test bin/console doctrine:schema:create +APP_ENV=test symfony server:start --port=8080 -d +cd ../.. +open http://localhost:8080 +vendor/bin/behat +vendor/bin/phpspec run ``` diff --git a/doc/media.md b/doc/media.md index afd4696ad..ebd781ae2 100644 --- a/doc/media.md +++ b/doc/media.md @@ -15,34 +15,34 @@ You can render media in two ways: By rendering a media code template: ```twig -{{ bitbag_cms_render_media('media_code') }} +{{ sylius_cms_render_media('media_code') }} ``` Function above can also take an additional parameter: `template`. ```twig -{{ bitbag_cms_render_media('media_code', '@App/templates/example.html.twig')}} +{{ sylius_cms_render_media('media_code', '@App/templates/example.html.twig')}} ``` Rendering a media code directly: ```twig -{{ render(path('bitbag_sylius_cms_plugin_shop_media_render', {'code' : 'file', 'template' : '@App/Some/Template/_path.html.twig'})) }} +{{ render(path('sylius_cms_shop_media_render', {'code' : 'file', 'template' : '@App/Some/Template/_path.html.twig'})) }} ``` ## Media provider -You can add your own media provider by adding a service with a tag named `bitbag_sylius_cms_plugin.media_provider`: +You can add your own media provider by adding a service with a tag named `sylius_cms.media_provider`: ```twig app.media_provider.audio: - class: BitBag\SyliusCmsPlugin\MediaProvider\GenericProvider + class: Sylius\CmsPlugin\MediaProvider\GenericProvider arguments: - - "@bitbag_sylius_cms_plugin.media_uploader" + - "@sylius_cms.media_uploader" - "@templating.engine.twig" - - "@@BitBagSyliusCmsPlugin/Shop/Media/Show/audio.html.twig" + - "@@SyliusCmsPlugin/Shop/Media/Show/audio.html.twig" - "media/audio" tags: - - { name: bitbag_sylius_cms_plugin.media_provider, type: audio, label: bitbag_sylius_cms_plugin.ui.audio_provider } + - { name: sylius_cms.media_provider, type: audio, label: sylius_cms.ui.audio_provider } ``` ## Customization @@ -50,5 +50,5 @@ app.media_provider.audio: If you don't know how to override templates yet, read [Sylius template customization guide](http://docs.sylius.org/en/latest/customization/template.html). -Even if you can pass template argument to render media resource, you can change the global templates under `app/templates/bundles/BitBagSyliusCmsPlugin/Shop/Media` location. +Even if you can pass template argument to render media resource, you can change the global templates under `app/templates/bundles/SyliusCmsPlugin/Shop/Media` location. Available templates you can override can be found under [this location](../src/Resources/views/Shop/Media). diff --git a/doc/pages.md b/doc/pages.md index 7558f07cd..8c407cd5b 100644 --- a/doc/pages.md +++ b/doc/pages.md @@ -19,13 +19,13 @@ Once you created a page in the admin panel, you can render page in two ways: By rendering a page link template: ```twig -{{ render(path('bitbag_sylius_cms_plugin_shop_page_show_link_by_code', {'code' : 'about', 'template' : '@BitBagSyliusCmsPlugin/Shop/Page/Show/_link.html.twig'})) }} +{{ render(path('sylius_cms_shop_page_show_link_by_code', {'code' : 'about', 'template' : '@SyliusCmsPlugin/Shop/Page/Show/_link.html.twig'})) }} ``` Or rendering a page link directly: ```twig -{{ render(path('bitbag_sylius_cms_plugin_shop_page_show', {'slug' : 'about'})) }} +{{ render(path('sylius_cms_shop_page_show', {'slug' : 'about'})) }} ``` ### Visiting the page @@ -39,5 +39,5 @@ Page URL is generated based on the page slug. Full link looks like this: `domain If you don't know how to override templates yet, read [Sylius template customization guide](http://docs.sylius.org/en/latest/customization/template.html). -You can create a template under `app/templates/bundles/BitBagSyliusCmsPlugin/Shop/Page` location. +You can create a template under `app/templates/bundles/SyliusCmsPlugin/Shop/Page` location. Available templates you can override can be found under [this location](../src/Resources/views/Shop/Page). diff --git a/doc/sitemap.md b/doc/sitemap.md deleted file mode 100644 index c3c90f812..000000000 --- a/doc/sitemap.md +++ /dev/null @@ -1,11 +0,0 @@ -# Sitemap - -This plugin suggests to install the Sylius sitemap plugin. The plugin is not installed automatically, but to install run: - -```bash - $ composer require stefandoorn/sitemap-plugin ^2.0@alpha -``` - -It's already configured after installation and contains a page & section provider. - -For more information, read the original [SitemapPlugin documentation](https://github.com/stefandoorn/sitemap-plugin). diff --git a/doc/use_case.md b/doc/use_case.md index 110bb54d7..734141e96 100644 --- a/doc/use_case.md +++ b/doc/use_case.md @@ -1,6 +1,6 @@ # What is and how to use Sylius CMS Plugin -BitBag Sylius CMS Plugin is a plugin developed for Sylius, +CMS Plugin is a plugin developed for Sylius, a popular open-source e-commerce system based on Symfony. The plugin enhances Sylius with advanced content management capabilities, allowing the creation, editing, and publication of dynamic CMS (Content Management System) pages within an e-commerce store. @@ -12,7 +12,7 @@ This empowers businesses to easily adapt their store's content to meet current n ## What Sylius CMS Plugin provides us with -When using the BitBag Sylius CMS Plugin, administrators gain access to various tiles within the admin panel, each serving a specific purpose. +When using the Sylius CMS Plugin, administrators gain access to various tiles within the admin panel, each serving a specific purpose. These tiles include Collections, Templates, Pages, Blocks and Media. ## Brief overview of what each tile offers @@ -80,7 +80,7 @@ More information about Media you can get [here](use_case_media.md). ## Summary -In summary, the BitBag Sylius CMS Plugin provides administrators with a range of tiles in the admin panel, +In summary, the Sylius CMS Plugin provides administrators with a range of tiles in the admin panel, including [Collections](use_case_collections.md), [Templates](use_case_templates.md), [Pages](use_case_pages.md), [Blocks](use_case_blocks.md), [Media](use_case_media.md). These tiles offer functionalities for managing CMS segments. diff --git a/doc/use_case_blocks.md b/doc/use_case_blocks.md index 22632cda7..bda630961 100644 --- a/doc/use_case_blocks.md +++ b/doc/use_case_blocks.md @@ -1,6 +1,6 @@ # Blocks -With the BitBag SyliusCmsPlugin, administrators can create and manage blocks built from content elements. +With the SyliusCmsPlugin, administrators can create and manage blocks built from content elements. This allows for customized content presentation, showcasing product features, promotions, and relevant information. diff --git a/doc/use_case_collections.md b/doc/use_case_collections.md index 3b9f728ba..4b5b97185 100644 --- a/doc/use_case_collections.md +++ b/doc/use_case_collections.md @@ -3,7 +3,7 @@ With collections, you can organize your blocks, pages and media under specific categories. For instance, you can create a Blog collection and display pages under it. -Collections in the BitBag SyliusCmsPlugin serve as containers where various elements, such as content blocks, CMS pages, +Collections in the Sylius CMS Plugin serve as containers where various elements, such as content blocks, CMS pages, and media, can be placed. These collections allow administrators to organize and manage the layout and presentation of content on pages. The ability to place blocks, pages, and media within collections provides full control over the appearance and structure of CMS pages, diff --git a/doc/use_case_media.md b/doc/use_case_media.md index 9dc64808f..9197014a8 100644 --- a/doc/use_case_media.md +++ b/doc/use_case_media.md @@ -2,7 +2,7 @@ In this plugin, media represents digital assets, for instance, an image, a video, or a simple PDF file. -The BitBag SyliusCmsPlugin enables administrators to add and display various types of media, such as images, videos, and files, in desired locations throughout the website. +The Sylius CMS Plugin enables administrators to add and display various types of media, such as images, videos, and files, in desired locations throughout the website. This functionality allows for the seamless integration of media elements using HTML tags, providing a visually engaging experience for users. diff --git a/doc/use_case_pages.md b/doc/use_case_pages.md index c8dd627ae..bb17773c9 100644 --- a/doc/use_case_pages.md +++ b/doc/use_case_pages.md @@ -2,7 +2,7 @@ Pages represent a customizable web page, you can adjust them to your needs in the admin panel. -With the BitBag SyliusCmsPlugin, administrators can create page content using content elements section. +With the Sylius CMS Plugin, administrators can create page content using content elements section. Additionally, administrators can set teaser image, title and content to be displayed on the pages collection listing. diff --git a/features/admin/adding_media.feature b/features/admin/adding_media.feature index d5463584d..0ee4fe3c5 100644 --- a/features/admin/adding_media.feature +++ b/features/admin/adding_media.feature @@ -13,7 +13,6 @@ Feature: Adding new media When I go to the create media page And I fill the code with "image" And I fill the name with "Image" - And I fill the link content with "Main image" And I upload the "aston_martin_db_11.jpg" image And I add it Then I should be notified that new media has been created diff --git a/features/admin/managing_blocks.feature b/features/admin/managing_blocks.feature index 311e55aac..78aaf6d43 100644 --- a/features/admin/managing_blocks.feature +++ b/features/admin/managing_blocks.feature @@ -46,8 +46,8 @@ Feature: Managing cms blocks @ui Scenario: Disabling block - Given there is an existing block with "bitbag_quote" code - When I go to the update "bitbag_quote" block page + Given there is an existing block with "sylius_quote" code + When I go to the update "sylius_quote" block page And I fill the name with "BitBag quote" if the name field is empty And I disable it And I update it diff --git a/phpspec.yml.dist b/phpspec.yml.dist index 510348697..767848352 100755 --- a/phpspec.yml.dist +++ b/phpspec.yml.dist @@ -1,4 +1,4 @@ suites: main: - namespace: BitBag\SyliusCmsPlugin - psr4_prefix: BitBag\SyliusCmsPlugin + namespace: Sylius\CmsPlugin + psr4_prefix: Sylius\CmsPlugin diff --git a/phpunit.xml.dist b/phpunit.xml.dist index aa1bc1a44..29597412f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,13 +6,13 @@ colors="true" bootstrap="tests/Application/config/bootstrap.php"> - + tests - + diff --git a/public/build/cms/admin/entrypoints.json b/public/build/cms/admin/entrypoints.json new file mode 100644 index 000000000..d9e189cf2 --- /dev/null +++ b/public/build/cms/admin/entrypoints.json @@ -0,0 +1,12 @@ +{ + "entrypoints": { + "sylius-cms-admin": { + "css": [ + "/build/cms/admin/sylius-cms-admin.css" + ], + "js": [ + "/build/cms/admin/sylius-cms-admin.js" + ] + } + } +} \ No newline at end of file diff --git a/public/build/cms/admin/manifest.json b/public/build/cms/admin/manifest.json new file mode 100644 index 000000000..3d79b2d55 --- /dev/null +++ b/public/build/cms/admin/manifest.json @@ -0,0 +1,4 @@ +{ + "build/cms/admin/sylius-cms-admin.css": "/build/cms/admin/sylius-cms-admin.css", + "build/cms/admin/sylius-cms-admin.js": "/build/cms/admin/sylius-cms-admin.js" +} \ No newline at end of file diff --git a/public/build/cms/admin/sylius-cms-admin.css b/public/build/cms/admin/sylius-cms-admin.css new file mode 100644 index 000000000..49fef1082 --- /dev/null +++ b/public/build/cms/admin/sylius-cms-admin.css @@ -0,0 +1 @@ +#cms-resource-preview-modal{height:100%}#cms-resource-preview-modal iframe{height:100vh;width:100%}#cms-resource-preview-modal .ui.header{padding-bottom:0}.cms-import .ui.action.input input[type=file]{display:none}.cms-import .ui.action.input input[type=text]{width:auto}.media-list{grid-gap:20px;display:grid;grid-template-columns:repeat(6,150px);margin:0 auto}.media-list__item{align-items:flex-start;display:flex;flex-direction:column;justify-content:space-between;max-width:150px;position:relative!important}.media-list__item__label,.media-list__item__label>strong{word-wrap:break-word!important;white-space:-moz-pre-wrap!important;white-space:-webkit-pre-wrap!important;white-space:-pre-wrap!important;white-space:-o-pre-wrap!important;white-space:pre-wrap!important;white-space:normal!important;word-break:break-all!important}.media-list__item__label>strong{display:block!important}.media-list__item__input{bottom:10px;position:absolute!important;right:10px;z-index:99}.media-list__item__input:hover{cursor:pointer}.media-list__item__img{height:150px!important;width:150px!important}.btn{display:inline-block!important;font-size:1.4em!important}.btn:hover{cursor:pointer}.page-number{font-size:1.4em!important}.btn-delete{color:#db2828;cursor:pointer;font-weight:700;height:20px;position:absolute;right:30px;width:20px;z-index:5}.btn-delete.is-hidden{opacity:.2;pointer-events:none}.cms-media-autocomplete .dropdown.icon{pointer-events:none}.cms-media-autocomplete .search{cursor:pointer!important}.bb-collection-item{margin-bottom:1em}.bb-collection-item-delete{margin-top:5px!important}.cke_notifications_area{display:none}.help-text{font-size:12px;margin-top:-10px;opacity:.5} \ No newline at end of file diff --git a/public/build/cms/admin/sylius-cms-admin.js b/public/build/cms/admin/sylius-cms-admin.js new file mode 100644 index 000000000..e1bee5273 --- /dev/null +++ b/public/build/cms/admin/sylius-cms-admin.js @@ -0,0 +1,2 @@ +/*! For license information please see sylius-cms-admin.js.LICENSE.txt */ +(()=>{var t={461:()=>{$(document).ready((function(){$(".bitbag-media-autocomplete, .sylius-autocomplete").each((function(t,e){$(e).autoComplete()}));var t="#sylius_cms_page_contentElements",e=$(t).length?t:"#sylius_cms_block_contentElements";$(e).length&&($(document).on("collection-form-add",(function(){$(".bitbag-media-autocomplete, .sylius-autocomplete").each((function(t,e){void 0===$._data($(e).get(0),"events")&&$(e).autoComplete()})),$("".concat(e,' [data-form-collection="item"]')).each((function(t,e){$(document).loadContentConfiguration(e)}))})),$.fn.extend({loadContentConfiguration:function(t){t.querySelector("".concat(e,' select[name*="type"]')).onchange=function(){var t=this.parentElement,e=document.createElement("div"),r=this.selectedOptions[0];e.innerHTML=r.getAttribute("data-configuration");var n=t.nextElementSibling;t.parentElement.replaceChild(e,n);var o=n.querySelector("input");o||(o=n.querySelector("textarea"));var i=o.getAttribute("name"),a=e.querySelectorAll("input");a.length||(a=e.querySelectorAll("textarea")),a.forEach((function(t){var r=t.getAttribute("name");r&&(r=i.replace(i.substring(i.indexOf("[configuration]")+15),r.substring(r.indexOf("configuration")+13)),$(t).attr("name",r),$(e).find(".bitbag-media-autocomplete").autoComplete(),$(e).find(".sylius-autocomplete").autoComplete())}))}}}),$("".concat(e,' [data-form-collection="item"]')).each((function(t,e){$(document).loadContentConfiguration(e)})),$(document).loadContentConfiguration(document.querySelector("".concat(e,' [data-form-collection="item"]'))))}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(()=>{"use strict";r(461);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{textField:"data-bb-cms-text",fileField:"data-bb-cms-file"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.textField=document.querySelector("[".concat(e.textField,"]")),this.fileField=document.querySelector("[".concat(e.fileField,"]"))},n=[{key:"init",value:function(){if("object"!==t(this.config))throw new Error("Bitbag CMS Plugin - HandleCsvUpload class config is not a valid object");this._handleFields()}},{key:"_handleFields",value:function(){this._handleTextField(),this._handleFileField()}},{key:"_handleTextField",value:function(){var t=this;this.textField.addEventListener("click",(function(){t.fileField.click()}))}},{key:"_handleFileField",value:function(){var t=this;this.fileField.addEventListener("change",(function(e){t.textField.value=e.target.files[0].name}))}}],n&&e(r.prototype,n),o&&e(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();const i=function(t,e,r){var n=new CustomEvent("".concat("bb",".").concat(e),{detail:r});return t.dispatchEvent(n),t};function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function S(){}var _={};f(_,c,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,c)&&(_=L);var x=S.prototype=b.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=d(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function c(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)}))}}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{wrappersIndicator:"data-bb-cms-wrapper",lockFieldIndicator:"data-bb-cms-toggle-slug",bbTarget:"sylius_cms_page",nameField:"sylius_cms_page_name"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wrappers=document.querySelectorAll("[".concat(e.wrappersIndicator,"]")),this.lockFieldIndicator="[".concat(e.lockFieldIndicator,"]"),this.bbTarget=e.bbTarget,this.config=e,this.nameField=document.getElementById("".concat(e.nameField))},e=[{key:"init",value:function(){if("object"!==l(this.config))throw new Error("Bitbag CMS Plugin - HandleSlugUpdate class config is not a valid object");if("string"!=typeof this.lockFieldIndicator||"string"!=typeof this.bbTarget)throw new Error("Bitbag CMS Plugin - HandleSlugUpdate class config key values are not valid strings");if(!this.nameField)throw new Error("Bitbag CMS Plugin - HandleSlugUpdate name field not found");this._handleFields()}},{key:"_handleFields",value:function(){var t=this;this.wrappers.forEach((function(e){var r=e.dataset.locale,n=e.querySelector("#".concat(t.bbTarget,"_translations_").concat(r,"_slug"));if(n||(n=e.querySelector("#".concat(t.bbTarget,"_slug"))),n){var o;t.nameField.addEventListener("input",(function(e){e.preventDefault(),n.readOnly||(clearTimeout(o),o=setTimeout((function(){t._updateSlug(n,t.nameField.value)}),1e3))}));var i=e.querySelector(t.lockFieldIndicator);i&&i.addEventListener("click",(function(e){e.preventDefault(),t._toggleSlugModification(n,i)}))}}))}},{key:"_updateSlug",value:(o=u(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i(e,"cms.slug.update.start"),e.parentNode.classList.add("loading"),t.next=4,this._getValidSlug(e.dataset.url,r);case 4:e.value=t.sent,e.parentNode.classList.remove("loading"),i(e,"cms.slug.update.end");case 7:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"_getValidSlug",value:(n=u(a().mark((function t(e,r){var n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(e,"?name=").concat(encodeURIComponent(r)));case 3:return n=t.sent,t.next=6,n.json();case 6:return o=t.sent,t.abrupt("return",o.slug);case 10:t.prev=10,t.t0=t.catch(0),console.error("BitBag CMS Plugin - HandleSlugUpdate class error : ".concat(t.t0));case 13:case"end":return t.stop()}}),t,null,[[0,10]])}))),function(t,e){return n.apply(this,arguments)})},{key:"_toggleSlugModification",value:function(t,e){t.readOnly=!t.readOnly;var r=e.querySelector("i");r.classList.toggle("lock"),r.classList.toggle("unlock")}}],e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function S(){}var _={};l(_,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,a)&&(_=L);var x=S.prototype=b.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==m(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function p(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function y(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{previewButton:"data-bb-cms-preview-btn",previewModal:"data-bb-cms-preview-modal",channelSwitch:"data-bb-cms-channel",localeSwitch:"data-bb-cms-locale"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.button=document.querySelector("[".concat(e.previewButton,"]")),this.modal=document.querySelector("[".concat(e.previewModal,"]")),this.modalSelector=e.previewModal,this.channelSelector=e.channelSwitch,this.localeSelector=e.localeSwitch},e=[{key:"init",value:function(){if("object"!==m(this.config))throw new Error("Bitbag CMS Plugin - HandlePreview class config is not a valid object");if("string"!=typeof this.localeSelector||"string"!=typeof this.channelSelector||"string"!=typeof this.modalSelector)throw new Error("Bitbag CMS Plugin - HandlePreview class config key values are not valid strings");this._resourcePreview()}},{key:"_$_CKEDITOR_MODAL_SHOW",value:function(){return $("[".concat(this.modalSelector,"]")).modal("show")}},{key:"_$_CKEDITOR_UPDATE_INSTANCES",value:function(){y(CKEDITOR.instances).forEach((function(t){return t.updateElement()}))}},{key:"_resourcePreview",value:function(){var t=this;this.button.addEventListener("click",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()})),document.querySelector("[".concat(this.channelSelector,"]")).addEventListener("change",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()})),document.querySelector("[".concat(this.localeSelector,"]")).addEventListener("change",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()}))}},{key:"_createPreview",value:(n=d().mark((function t(){var e,r,n,o,a,c,u,l,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.modal.querySelector(".ui.loadable").classList.add("loading"),this.modal.disabled=!0,e=document.querySelector("[".concat(this.channelSelector,"]")).value,r=document.querySelector("[".concat(this.localeSelector,"]")).value,n=this.button.dataset.url,o=this.button.closest("form"),a={method:"POST",body:new FormData(o)},t.prev=7,i(this.modal,"cms.create.preview.start"),t.next=11,fetch("".concat(n,"?_channel_code=").concat(e,"&_locale=").concat(r),a);case 11:return c=t.sent,t.next=14,c.text();case 14:u=t.sent,l=new Blob([u],{type:"text/html",charset:"utf-8"}),s=window.URL.createObjectURL(l),this.modal.querySelector("iframe").src=s,i(this.modal,"cms.create.preview.completed",u),t.next=25;break;case 21:t.prev=21,t.t0=t.catch(7),console.error("BitBag CMS Plugin - HandlePreview class error : ".concat(t.t0)),i(this.modal,"cms.create.preview.error",t.t0);case 25:return t.prev=25,this.modal.querySelector(".ui.loadable").classList.remove("loading"),this.modal.disabled=!1,i(this.modal,"cms.create.preview.end"),t.finish(25);case 30:case"end":return t.stop()}}),t,this,[[7,21,25,30]])})),o=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){p(i,r,o,a,c,"next",t)}function c(t){p(i,r,o,a,c,"throw",t)}a(void 0)}))},function(){return o.apply(this,arguments)})}],e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function S(){S=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(F([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==k(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{bbMediaContainer:"data-bb-cms-autocomplete",choiceName:"data-bb-cms-choice-name",choiceValue:"data-bb-cms-choice-value",criteriaType:"data-bb-cms-criteria-type",criteriaName:"data-bb-cms-criteria-name",editUrl:"data-bb-cms-load-edit-url",nameMessage:"data-bb-cms-name-message",deleteButton:"data-bb-cms-delete-selected",choosenPreview:"data-bb-cms-selected-image",selectMenu:"data-bb-cms-selection-menu",selectInput:"data-bb-cms-image-select",placeholder:"data-bb-cms-placeholder",limit:30};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.mediaContainers=document.querySelectorAll("[".concat(e.bbMediaContainer,"]")),this.deleteButton="[".concat(e.deleteButton,"]"),this.selectMenu="[".concat(e.selectMenu,"]"),this.selectInput="[".concat(e.selectInput,"]"),this.placeholder="[".concat(e.placeholder,"]")},e=[{key:"init",value:function(){var t=this;if("object"!==k(this.config))throw new Error("Bitbag CMS Plugin - HandleAutoComplete class config is not a valid object");this.mediaContainers.forEach((function(e){t._handleSavedValue(e),t._handleImageChoice(e),t._handleResetBtn(e)}))}},{key:"_handleResetBtn",value:function(t){var e=this,r=t.querySelector(this.deleteButton);""!==t.querySelector("input[type=hidden]").value?(r.classList.remove("is-hidden"),r.addEventListener("click",(function(){e._resetValues(t)}))):r.classList.add("is-hidden")}},{key:"_handleImageChoice",value:function(t){var e,r=this;t.querySelector(this.selectInput).addEventListener("click",(function(e){e.preventDefault(),r._getMediaImages(t)})),t.querySelector(this.selectInput).addEventListener("input",(function(n){n.preventDefault(),clearTimeout(e),e=setTimeout((function(){r._getMediaImages(t,n.target.value)}),500)})),t.querySelector("input[type=hidden]").addEventListener("change",(function(e){e.preventDefault(),r._handleResetBtn(t)}))}},{key:"_handleSavedValue",value:(o=x(S().mark((function t(e){var r,n,o,a,c,u,l;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!==e.querySelector("input[type=hidden]").value){t.next=2;break}return t.abrupt("return");case 2:return r="".concat(e.dataset.bbCmsLoadEditUrl,"?").concat(e.querySelector("input[type=hidden]").value.split(",").filter(String).map((function(t){return"code[]=".concat(t)})).join("&")),t.prev=3,i(e,"cms.media.saved.reload.start"),e.classList.add("loading"),t.next=8,fetch(r);case 8:return n=t.sent,t.next=11,n.json();case 11:o=t.sent,this._addToSelectMenu(o,e),a=[],null!==(c=e.querySelector(this.selectMenu))&&(a=c.children),u=_(a);try{for(u.s();!(l=u.n()).done;)l.value.click()}catch(t){u.e(t)}finally{u.f()}i(e,"cms.media.saved.reload.completed",o),t.next=25;break;case 21:t.prev=21,t.t0=t.catch(3),console.error("BitBag CMS Plugin - HandleAutoComplete class error : ".concat(t.t0)),i(e,"cms.media.saved.reload.error",t.t0);case 25:return t.prev=25,e.classList.remove("loading"),i(e,"cms.media.saved.reload.end"),t.finish(25);case 29:case"end":return t.stop()}}),t,this,[[3,21,25,29]])}))),function(t){return o.apply(this,arguments)})},{key:"_getMediaImages",value:(n=x(S().mark((function t(e){var r,n,o,a,c,u,l,s,f=arguments;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=f.length>1&&void 0!==f[1]&&f[1],n=e.dataset.bbCmsUrl,o=e.dataset.bbCmsCriteriaType,a=r?"&criteria[search][value]=".concat(r):"",c="".concat(n,"&limit=").concat(this.config.limit,"&criteria[search][type]=").concat(o,"&criteria[search][value]=").concat(a),t.prev=5,i(e,"cms.media.display.start"),e.classList.add("loading"),t.next=10,fetch(c);case 10:return u=t.sent,t.next=13,u.json();case 13:l=t.sent,s=l._embedded.items,this._addToSelectMenu(s,e),i(e,"cms.media.display.completed",l),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(5),console.error("BitBag CMS Plugin - HandleAutoComplete class error : ".concat(t.t0)),i(e,"cms.media.display.error",t.t0);case 23:return t.prev=23,e.classList.remove("loading"),i(e,"cms.media.display.end"),t.finish(23);case 27:case"end":return t.stop()}}),t,this,[[5,19,23,27]])}))),function(t){return n.apply(this,arguments)})},{key:"_resetValues",value:function(t){i(t,"cms.media.reset.start"),t.querySelector("input[type=hidden]").value="",t.querySelector(this.selectMenu).innerHTML="",t.querySelector(this.placeholder).innerHTML="",i(t,"cms.media.reset.end")}},{key:"_addToSelectMenu",value:function(t,e){var r=this;i(e,"cms.media.display.update.start");var n=e.querySelector(this.selectMenu);n.innerHTML="",null!==t&&t.forEach((function(t){n.insertAdjacentHTML("beforeend",r._itemTemplate(t.path,t.code.trim()))})),i(e,"cms.media.display.update.end")}},{key:"_itemTemplate",value:function(t,e){return'
').concat(e,"
")}}],e&&j(t.prototype,e),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function C(t,e){for(var r=0;r0&&(new h).init(),document.querySelectorAll("[data-bb-cms-preview-btn]").length>0&&(new w).init(),document.querySelector('[data-bb-target="cms-handle-autocomplete"]')&&(new P).init(),document.querySelector(".collection-type-items")&&(new F).init(),document.querySelector("[data-bb-cms-load-template]")&&(new N).init()})()})(); \ No newline at end of file diff --git a/src/Resources/public/build/bitbag-cms-admin.js.LICENSE.txt b/public/build/cms/admin/sylius-cms-admin.js.LICENSE.txt similarity index 100% rename from src/Resources/public/build/bitbag-cms-admin.js.LICENSE.txt rename to public/build/cms/admin/sylius-cms-admin.js.LICENSE.txt diff --git a/public/build/cms/shop/entrypoints.json b/public/build/cms/shop/entrypoints.json new file mode 100644 index 000000000..583631555 --- /dev/null +++ b/public/build/cms/shop/entrypoints.json @@ -0,0 +1,12 @@ +{ + "entrypoints": { + "sylius-cms-shop": { + "css": [ + "/build/cms/shop/sylius-cms-shop.css" + ], + "js": [ + "/build/cms/shop/sylius-cms-shop.js" + ] + } + } +} \ No newline at end of file diff --git a/public/build/cms/shop/manifest.json b/public/build/cms/shop/manifest.json new file mode 100644 index 000000000..11b62d10f --- /dev/null +++ b/public/build/cms/shop/manifest.json @@ -0,0 +1,4 @@ +{ + "build/cms/shop/sylius-cms-shop.css": "/build/cms/shop/sylius-cms-shop.css", + "build/cms/shop/sylius-cms-shop.js": "/build/cms/shop/sylius-cms-shop.js" +} \ No newline at end of file diff --git a/public/build/cms/shop/sylius-cms-shop.css b/public/build/cms/shop/sylius-cms-shop.css new file mode 100644 index 000000000..fa24c6ec9 --- /dev/null +++ b/public/build/cms/shop/sylius-cms-shop.css @@ -0,0 +1 @@ +.cms-block{margin-bottom:20px}.cms-block img{max-width:100%}.carousel-wrapper{position:relative}.carousel-wrapper .carousel{margin:0 -1em}.carousel-wrapper .carousel-nav .carousel-left{left:30px}.carousel-wrapper .carousel-nav .carousel-right{right:30px}.carousel-wrapper .carousel-nav .carousel-left,.carousel-wrapper .carousel-nav .carousel-right{position:absolute;top:50%;transform:translateY(-50%)}.carousel-wrapper .carousel-item{padding:5px 1em}.teaser__content{margin-top:10px}.teaser__description{margin-top:5px}.teaser__read-more{display:block;margin-top:20px}[class^=cms_content_element__]:not(:last-child){margin-bottom:1rem} \ No newline at end of file diff --git a/src/Resources/public/build/bitbag-cms-shop.js b/public/build/cms/shop/sylius-cms-shop.js similarity index 100% rename from src/Resources/public/build/bitbag-cms-shop.js rename to public/build/cms/shop/sylius-cms-shop.js diff --git a/spec/Assigner/ChannelsAssignerSpec.php b/spec/Assigner/ChannelsAssignerSpec.php index f1bf42b79..5fc38fc80 100644 --- a/spec/Assigner/ChannelsAssignerSpec.php +++ b/spec/Assigner/ChannelsAssignerSpec.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace spec\BitBag\SyliusCmsPlugin\Assigner; +namespace spec\Sylius\CmsPlugin\Assigner; -use BitBag\SyliusCmsPlugin\Assigner\ChannelsAssigner; -use BitBag\SyliusCmsPlugin\Assigner\ChannelsAssignerInterface; use PhpSpec\ObjectBehavior; +use Sylius\CmsPlugin\Assigner\ChannelsAssigner; +use Sylius\CmsPlugin\Assigner\ChannelsAssignerInterface; use Sylius\Component\Channel\Model\ChannelsAwareInterface; use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; use Sylius\Component\Core\Model\ChannelInterface; @@ -34,8 +34,7 @@ public function it_assigns_channels( ChannelInterface $posChannel, ChannelsAwareInterface $channelsAware, ): void { - $channelRepository->findOneBy(['code' => 'web'])->willReturn($webChannel); - $channelRepository->findOneBy(['code' => 'pos'])->willReturn($posChannel); + $channelRepository->findBy(['code' => ['web', 'pos']])->willReturn([$webChannel, $posChannel]); $channelsAware->addChannel($webChannel)->shouldBeCalled(); $channelsAware->addChannel($posChannel)->shouldBeCalled(); diff --git a/spec/Assigner/CollectionsAssignerSpec.php b/spec/Assigner/CollectionsAssignerSpec.php index 90e74df3c..0e95b878e 100644 --- a/spec/Assigner/CollectionsAssignerSpec.php +++ b/spec/Assigner/CollectionsAssignerSpec.php @@ -1,21 +1,15 @@ findOneBy(['code' => 'about'])->willReturn($aboutCollection); - $collectionRepository->findOneBy(['code' => 'blog'])->willReturn($blogCollection); + $collectionRepository->findBy(['code' => ['about', 'blog']])->willReturn([$aboutCollection, $blogCollection]); $collectionsAware->addCollection($aboutCollection)->shouldBeCalled(); $collectionsAware->addCollection($blogCollection)->shouldBeCalled(); diff --git a/spec/Assigner/LocalesAssignerSpec.php b/spec/Assigner/LocalesAssignerSpec.php index db38072b3..7e2da73fb 100644 --- a/spec/Assigner/LocalesAssignerSpec.php +++ b/spec/Assigner/LocalesAssignerSpec.php @@ -1,19 +1,13 @@ getCode()->willReturn('en_US'); $locale2->getCode()->willReturn('fr_FR'); - $localeRepository->findAll()->willReturn([$locale1, $locale2]); + $localeRepository->findBy(['code' => ['en_US', 'fr_FR']])->willReturn([$locale1, $locale2]); $localesAware->addLocale($locale1)->shouldBeCalled(); $localesAware->addLocale($locale2)->shouldBeCalled(); diff --git a/spec/Assigner/ProductsAssignerSpec.php b/spec/Assigner/ProductsAssignerSpec.php index 0e50991ef..e79e07ee3 100644 --- a/spec/Assigner/ProductsAssignerSpec.php +++ b/spec/Assigner/ProductsAssignerSpec.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace spec\BitBag\SyliusCmsPlugin\Assigner; +namespace spec\Sylius\CmsPlugin\Assigner; -use BitBag\SyliusCmsPlugin\Assigner\ProductsAssigner; -use BitBag\SyliusCmsPlugin\Assigner\ProductsAssignerInterface; -use BitBag\SyliusCmsPlugin\Entity\ProductsAwareInterface; use PhpSpec\ObjectBehavior; +use Sylius\CmsPlugin\Assigner\ProductsAssigner; +use Sylius\CmsPlugin\Assigner\ProductsAssignerInterface; +use Sylius\CmsPlugin\Entity\ProductsAwareInterface; use Sylius\Component\Core\Model\ProductInterface; use Sylius\Component\Core\Repository\ProductRepositoryInterface; @@ -34,8 +34,7 @@ public function it_assigns_products( ProductInterface $tshirtProduct, ProductsAwareInterface $productsAware, ): void { - $productRepository->findOneBy(['code' => 'mug'])->willReturn($mugProduct); - $productRepository->findOneBy(['code' => 't-shirt'])->willReturn($tshirtProduct); + $productRepository->findBy(['code' => ['mug', 't-shirt']])->willReturn([$mugProduct, $tshirtProduct]); $productsAware->addProduct($mugProduct)->shouldBeCalled(); $productsAware->addProduct($tshirtProduct)->shouldBeCalled(); diff --git a/spec/Assigner/ProductsInTaxonsAssignerSpec.php b/spec/Assigner/ProductsInTaxonsAssignerSpec.php index 6b59106d6..4b98ad9ce 100644 --- a/spec/Assigner/ProductsInTaxonsAssignerSpec.php +++ b/spec/Assigner/ProductsInTaxonsAssignerSpec.php @@ -1,19 +1,13 @@ getCode()->willReturn('taxon_code_1'); $taxon2->getCode()->willReturn('taxon_code_2'); - $taxonRepository->findOneBy(['code' => 'taxon_code_1'])->willReturn($taxon1); - $taxonRepository->findOneBy(['code' => 'taxon_code_2'])->willReturn($taxon2); + $taxonRepository->findBy(['code' => ['taxon_code_1', 'taxon_code_2']])->willReturn([$taxon1, $taxon2]); $productsInTaxonsAware->addProductsInTaxon($taxon1)->shouldBeCalled(); $productsInTaxonsAware->addProductsInTaxon($taxon2)->shouldBeCalled(); diff --git a/spec/Assigner/TaxonsAssignerSpec.php b/spec/Assigner/TaxonsAssignerSpec.php index 092ab8818..b8933ff98 100644 --- a/spec/Assigner/TaxonsAssignerSpec.php +++ b/spec/Assigner/TaxonsAssignerSpec.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace spec\BitBag\SyliusCmsPlugin\Assigner; +namespace spec\Sylius\CmsPlugin\Assigner; -use BitBag\SyliusCmsPlugin\Assigner\TaxonsAssigner; -use BitBag\SyliusCmsPlugin\Assigner\TaxonsAssignerInterface; -use BitBag\SyliusCmsPlugin\Entity\TaxonAwareInterface; use PhpSpec\ObjectBehavior; +use Sylius\CmsPlugin\Assigner\TaxonsAssigner; +use Sylius\CmsPlugin\Assigner\TaxonsAssignerInterface; +use Sylius\CmsPlugin\Entity\TaxonAwareInterface; use Sylius\Component\Core\Model\TaxonInterface; use Sylius\Component\Taxonomy\Repository\TaxonRepositoryInterface; @@ -34,8 +34,7 @@ public function it_assigns_taxons( TaxonInterface $stickersTaxon, TaxonAwareInterface $taxonsAware, ): void { - $taxonRepository->findOneBy(['code' => 'mugs'])->willReturn($mugsTaxon); - $taxonRepository->findOneBy(['code' => 'stickers'])->willReturn($stickersTaxon); + $taxonRepository->findBy(['code' => ['mugs', 'stickers']])->willReturn([$mugsTaxon, $stickersTaxon]); $taxonsAware->addTaxon($mugsTaxon)->shouldBeCalled(); $taxonsAware->addTaxon($stickersTaxon)->shouldBeCalled(); diff --git a/spec/Controller/Action/Admin/UploadEditorImageActionSpec.php b/spec/Controller/Action/Admin/UploadEditorImageActionSpec.php index 8eb4b8088..23ab783fc 100644 --- a/spec/Controller/Action/Admin/UploadEditorImageActionSpec.php +++ b/spec/Controller/Action/Admin/UploadEditorImageActionSpec.php @@ -1,21 +1,15 @@ resolve($block, null)->shouldBeCalled(); $importerProductsInTaxonsResolver->resolve($block, null)->shouldBeCalled(); - $validator->validate($block, null, ['bitbag'])->willReturn(new ConstraintViolationList()); + $validator->validate($block, null, ['cms'])->willReturn(new ConstraintViolationList()); $blockRepository->add($block)->shouldBeCalled(); diff --git a/spec/Importer/MediaImporterSpec.php b/spec/Importer/MediaImporterSpec.php index cb47011dd..14df2cda1 100644 --- a/spec/Importer/MediaImporterSpec.php +++ b/spec/Importer/MediaImporterSpec.php @@ -1,20 +1,14 @@ shouldHaveType(\BitBag\SyliusCmsPlugin\Importer\MediaImporter::class); - $this->shouldImplement(\BitBag\SyliusCmsPlugin\Importer\MediaImporterInterface::class); + $this->shouldHaveType(\Sylius\CmsPlugin\Importer\MediaImporter::class); + $this->shouldImplement(\Sylius\CmsPlugin\Importer\MediaImporterInterface::class); } public function it_imports_media( @@ -66,7 +60,7 @@ public function it_imports_media( $importerCollectionsResolver->resolve($media, null)->shouldBeCalled(); - $validator->validate($media, null, ['bitbag'])->willReturn(new ConstraintViolationList()); + $validator->validate($media, null, ['cms'])->willReturn(new ConstraintViolationList()); $mediaRepository->add($media)->shouldBeCalled(); diff --git a/spec/Importer/PageImporterSpec.php b/spec/Importer/PageImporterSpec.php index f7a583d8a..6be306720 100644 --- a/spec/Importer/PageImporterSpec.php +++ b/spec/Importer/PageImporterSpec.php @@ -1,21 +1,15 @@ shouldHaveType(\BitBag\SyliusCmsPlugin\Importer\PageImporter::class); - $this->shouldImplement(\BitBag\SyliusCmsPlugin\Importer\PageImporterInterface::class); + $this->shouldHaveType(\Sylius\CmsPlugin\Importer\PageImporter::class); + $this->shouldImplement(\Sylius\CmsPlugin\Importer\PageImporterInterface::class); } public function it_imports_page_no_url( @@ -86,7 +80,7 @@ public function it_imports_page_no_url( $importerCollectionsResolver->resolve($page, 'collections')->shouldBeCalled(); $importerChannelsResolver->resolve($page, 'channels')->shouldBeCalled(); - $validator->validate($page, null, ['bitbag'])->willReturn(new ConstraintViolationList()); + $validator->validate($page, null, ['cms'])->willReturn(new ConstraintViolationList()); $entityManager->persist($page)->shouldBeCalled(); $entityManager->flush()->shouldBeCalled(); diff --git a/spec/MediaProvider/FilenameHelperSpec.php b/spec/MediaProvider/FilenameHelperSpec.php index dd9312bbe..80bdba551 100644 --- a/spec/MediaProvider/FilenameHelperSpec.php +++ b/spec/MediaProvider/FilenameHelperSpec.php @@ -1,18 +1,11 @@ getMenu()->willReturn($menu); - $menu->addChild('bitbag_cms')->willReturn($cmsRootMenuItem); - $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.cms')->willReturn($cmsRootMenuItem); + $menu->addChild('sylius_cms')->willReturn($cmsRootMenuItem); + $cmsRootMenuItem->setLabel('sylius_cms.ui.cms')->willReturn($cmsRootMenuItem); $cmsRootMenuItem - ->addChild('blocks', ['route' => 'bitbag_sylius_cms_plugin_admin_block_index']) + ->addChild('blocks', ['route' => 'sylius_cms_admin_block_index']) ->willReturn($cmsRootMenuItem) ; - $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.blocks')->willReturn($cmsRootMenuItem); + $cmsRootMenuItem->setLabel('sylius_cms.ui.blocks')->willReturn($cmsRootMenuItem); $cmsRootMenuItem->setLabelAttribute('icon', 'block layout')->shouldBeCalled(); $cmsRootMenuItem - ->addChild('pages', ['route' => 'bitbag_sylius_cms_plugin_admin_page_index']) + ->addChild('pages', ['route' => 'sylius_cms_admin_page_index']) ->willReturn($cmsRootMenuItem) ; - $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.pages')->willReturn($cmsRootMenuItem); + $cmsRootMenuItem->setLabel('sylius_cms.ui.pages')->willReturn($cmsRootMenuItem); $cmsRootMenuItem->setLabelAttribute('icon', 'sticky note')->shouldBeCalled(); $cmsRootMenuItem - ->addChild('collections', ['route' => 'bitbag_sylius_cms_plugin_admin_collection_index']) + ->addChild('collections', ['route' => 'sylius_cms_admin_collection_index']) ->willReturn($cmsRootMenuItem) ; - $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.collections')->willReturn($cmsRootMenuItem); + $cmsRootMenuItem->setLabel('sylius_cms.ui.collections')->willReturn($cmsRootMenuItem); $cmsRootMenuItem->setLabelAttribute('icon', 'grid layout')->shouldBeCalled(); $cmsRootMenuItem - ->addChild('templates', ['route' => 'bitbag_sylius_cms_plugin_admin_template_index']) + ->addChild('templates', ['route' => 'sylius_cms_admin_template_index']) ->willReturn($cmsRootMenuItem) ; - $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.templates')->willReturn($cmsRootMenuItem); + $cmsRootMenuItem->setLabel('sylius_cms.ui.templates')->willReturn($cmsRootMenuItem); $cmsRootMenuItem->setLabelAttribute('icon', 'clone')->shouldBeCalled(); $cmsRootMenuItem - ->addChild('media', ['route' => 'bitbag_sylius_cms_plugin_admin_media_index']) + ->addChild('media', ['route' => 'sylius_cms_admin_media_index']) ->willReturn($cmsRootMenuItem) ; - $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.media')->willReturn($cmsRootMenuItem); + $cmsRootMenuItem->setLabel('sylius_cms.ui.media')->willReturn($cmsRootMenuItem); $cmsRootMenuItem->setLabelAttribute('icon', 'file')->shouldBeCalled(); $menu->getChildren()->willReturn(['marketing' => $cmsRootMenuItem]); - $menu->getChild('bitbag_cms')->willReturn($cmsRootMenuItem); + $menu->getChild('sylius_cms')->willReturn($cmsRootMenuItem); - $menu->setChildren(['marketing' => $cmsRootMenuItem, 'bitbag_cms' => $cmsRootMenuItem])->willReturn($menu); + $menu->setChildren(['marketing' => $cmsRootMenuItem, 'sylius_cms' => $cmsRootMenuItem])->willReturn($menu); $this->buildMenu($menuBuilderEvent); } diff --git a/spec/Menu/MenuReorderSpec.php b/spec/Menu/MenuReorderSpec.php index 6dc38e50b..b992e9166 100644 --- a/spec/Menu/MenuReorderSpec.php +++ b/spec/Menu/MenuReorderSpec.php @@ -1,20 +1,14 @@ 'Sample Heading', ]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_heading.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_heading.html.twig', 'heading_type' => 'h1', 'heading_content' => 'Sample Heading', ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElement/MultipleMediaContentElementRendererSpec.php b/spec/Renderer/ContentElement/MultipleMediaContentElementRendererSpec.php index eb5950d34..f9549ed10 100644 --- a/spec/Renderer/ContentElement/MultipleMediaContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/MultipleMediaContentElementRendererSpec.php @@ -1,23 +1,17 @@ renderMedia('code1')->willReturn('rendered media 1'); $renderMediaRuntime->renderMedia('code2')->willReturn('rendered media 2'); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_multiple_media.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_multiple_media.html.twig', 'media' => [ [ 'renderedContent' => 'rendered media 1', diff --git a/spec/Renderer/ContentElement/PagesCollectionContentElementRendererSpec.php b/spec/Renderer/ContentElement/PagesCollectionContentElementRendererSpec.php index 96bca9fea..17909029d 100644 --- a/spec/Renderer/ContentElement/PagesCollectionContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/PagesCollectionContentElementRendererSpec.php @@ -1,23 +1,17 @@ getPages()->willReturn($pagesCollection); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_pages_collection.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_pages_collection.html.twig', 'collection' => $pagesCollection, ])->willReturn('rendered_output'); diff --git a/spec/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRendererSpec.php b/spec/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRendererSpec.php index 04f5e98ba..9b106e50f 100644 --- a/spec/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRendererSpec.php @@ -1,20 +1,14 @@ findOneBy(['code' => 'taxon_code'])->willReturn($taxon); $productRepository->findByTaxon($taxon)->willReturn([$product1, $product2]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', 'products' => [$product1, $product2], ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElement/ProductsCarouselContentElementRendererSpec.php b/spec/Renderer/ContentElement/ProductsCarouselContentElementRendererSpec.php index b9081653d..ac6654263 100644 --- a/spec/Renderer/ContentElement/ProductsCarouselContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/ProductsCarouselContentElementRendererSpec.php @@ -1,20 +1,14 @@ findBy(['code' => ['code1', 'code2']])->willReturn([$product1, $product2]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', 'products' => [$product1, $product2], ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElement/ProductsGridByTaxonContentElementRendererSpec.php b/spec/Renderer/ContentElement/ProductsGridByTaxonContentElementRendererSpec.php index 55575bb87..b8d388b3d 100644 --- a/spec/Renderer/ContentElement/ProductsGridByTaxonContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/ProductsGridByTaxonContentElementRendererSpec.php @@ -1,20 +1,14 @@ findOneBy(['code' => 'taxon_code'])->willReturn($taxon); $productRepository->findByTaxon($taxon)->willReturn([$product1, $product2]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', 'products' => [$product1, $product2], ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElement/ProductsGridContentElementRendererSpec.php b/spec/Renderer/ContentElement/ProductsGridContentElementRendererSpec.php index 049cc2269..d093c2d3c 100644 --- a/spec/Renderer/ContentElement/ProductsGridContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/ProductsGridContentElementRendererSpec.php @@ -1,20 +1,14 @@ findBy(['code' => ['code1', 'code2']])->willReturn([$product1, $product2]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', 'products' => [$product1, $product2], ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElement/SingleMediaContentElementRendererSpec.php b/spec/Renderer/ContentElement/SingleMediaContentElementRendererSpec.php index 896feffea..28e18edc8 100644 --- a/spec/Renderer/ContentElement/SingleMediaContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/SingleMediaContentElementRendererSpec.php @@ -1,23 +1,17 @@ renderMedia('media_code')->willReturn('rendered media'); $mediaRepository->findOneBy(['code' => 'media_code'])->willReturn($media); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_single_media.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_single_media.html.twig', 'media' => [ 'renderedContent' => 'rendered media', 'entity' => $media, diff --git a/spec/Renderer/ContentElement/SpacerContentElementRendererSpec.php b/spec/Renderer/ContentElement/SpacerContentElementRendererSpec.php index 435378ec8..a7972e219 100644 --- a/spec/Renderer/ContentElement/SpacerContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/SpacerContentElementRendererSpec.php @@ -1,20 +1,14 @@ '40', ]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_spacer.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_spacer.html.twig', 'spacer_height' => '40', ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElement/TaxonsListContentElementRendererSpec.php b/spec/Renderer/ContentElement/TaxonsListContentElementRendererSpec.php index 2f6d2dcc1..3fc7cc173 100644 --- a/spec/Renderer/ContentElement/TaxonsListContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/TaxonsListContentElementRendererSpec.php @@ -1,20 +1,14 @@ findBy(['code' => ['code1', 'code2']])->willReturn([$taxon1, $taxon2]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_taxons_list.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_taxons_list.html.twig', 'taxons' => [$taxon1, $taxon2], ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElement/TextareaContentElementRendererSpec.php b/spec/Renderer/ContentElement/TextareaContentElementRendererSpec.php index c0ae8f376..ef5844853 100644 --- a/spec/Renderer/ContentElement/TextareaContentElementRendererSpec.php +++ b/spec/Renderer/ContentElement/TextareaContentElementRendererSpec.php @@ -1,20 +1,14 @@ 'Textarea content', ]); - $twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_textarea.html.twig', + $twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_textarea.html.twig', 'content' => 'Textarea content', ])->willReturn('rendered template'); diff --git a/spec/Renderer/ContentElementRendererStrategySpec.php b/spec/Renderer/ContentElementRendererStrategySpec.php index 8b9d93de1..568ca110f 100644 --- a/spec/Renderer/ContentElementRendererStrategySpec.php +++ b/spec/Renderer/ContentElementRendererStrategySpec.php @@ -1,24 +1,18 @@ getName()->willReturn('Page Name'); $urlGenerator->generate( - 'bitbag_sylius_cms_plugin_shop_page_show', + 'sylius_cms_shop_page_show', ['slug' => 'page-slug'], UrlGeneratorInterface::ABSOLUTE_URL, )->willReturn('http://example.com/page-slug'); $twig->render( - '@BitBagSyliusCmsPlugin/Shop/Page/link.html.twig', + '@SyliusCmsPlugin/Shop/Page/link.html.twig', [ 'link' => 'http://example.com/page-slug', 'name' => 'Page Name', @@ -70,7 +64,7 @@ public function it_renders_page_link_with_custom_template( $page->getName()->willReturn('Page Name'); $urlGenerator->generate( - 'bitbag_sylius_cms_plugin_shop_page_show', + 'sylius_cms_shop_page_show', ['slug' => 'page-slug'], UrlGeneratorInterface::ABSOLUTE_URL, )->willReturn('http://example.com/page-slug'); diff --git a/spec/Resolver/BlockResourceResolverSpec.php b/spec/Resolver/BlockResourceResolverSpec.php index b70282c39..45d77c9e7 100755 --- a/spec/Resolver/BlockResourceResolverSpec.php +++ b/spec/Resolver/BlockResourceResolverSpec.php @@ -1,22 +1,16 @@ beConstructedWith($twigEnvironment, ['bitbag_cms_render_block']); + $this->beConstructedWith($twigEnvironment, ['sylius_cms_render_block']); } public function it_is_initializable(): void @@ -32,14 +32,14 @@ public function it_parses_string_function( Environment $twigEnvironment, RenderBlockRuntimeInterface $renderBlockRuntime, ): void { - $twigFunctionName = 'bitbag_cms_render_block'; + $twigFunctionName = 'sylius_cms_render_block'; $twigEnvironment->getFunctions()->willReturn([ $twigFunctionName => new TwigFunction($twigFunctionName, [$renderBlockRuntime->getWrappedObject(), 'renderBlock']), ]); - $input = "Let's render! {{ bitbag_cms_render_block('intro', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig') }}"; + $input = "Let's render! {{ sylius_cms_render_block('intro', '@SyliusCmsPlugin/Shop/Block/show.html.twig') }}"; - $renderBlockRuntime->renderBlock('intro', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig')->shouldBeCalled(); + $renderBlockRuntime->renderBlock('intro', '@SyliusCmsPlugin/Shop/Block/show.html.twig')->shouldBeCalled(); $this->parse($input); } @@ -48,16 +48,16 @@ public function it_parses_string_functions( Environment $twigEnvironment, RenderBlockRuntimeInterface $renderBlockRuntime, ): void { - $twigFunctionName = 'bitbag_cms_render_block'; + $twigFunctionName = 'sylius_cms_render_block'; $twigEnvironment->getFunctions()->willReturn([ $twigFunctionName => new TwigFunction($twigFunctionName, [$renderBlockRuntime->getWrappedObject(), 'renderBlock']), ]); - $input = "Let's render! {{ bitbag_cms_render_block('intro', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig') }} - Let's render twice! {{ bitbag_cms_render_block('intro1', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig') }}"; + $input = "Let's render! {{ sylius_cms_render_block('intro', '@SyliusCmsPlugin/Shop/Block/show.html.twig') }} + Let's render twice! {{ sylius_cms_render_block('intro1', '@SyliusCmsPlugin/Shop/Block/show.html.twig') }}"; - $renderBlockRuntime->renderBlock('intro', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig')->shouldBeCalled(); - $renderBlockRuntime->renderBlock('intro1', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig')->shouldBeCalled(); + $renderBlockRuntime->renderBlock('intro', '@SyliusCmsPlugin/Shop/Block/show.html.twig')->shouldBeCalled(); + $renderBlockRuntime->renderBlock('intro1', '@SyliusCmsPlugin/Shop/Block/show.html.twig')->shouldBeCalled(); $this->parse($input); } diff --git a/spec/Twig/Runtime/RenderBlockRuntimeSpec.php b/spec/Twig/Runtime/RenderBlockRuntimeSpec.php index 6440085d2..f59b06686 100644 --- a/spec/Twig/Runtime/RenderBlockRuntimeSpec.php +++ b/spec/Twig/Runtime/RenderBlockRuntimeSpec.php @@ -1,23 +1,15 @@ findOrLog('code')->willReturn($block); $contentElementRendererStrategy->render($block)->willReturn('rendered content'); - $templatingEngine->render('@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig', [ + $templatingEngine->render('@SyliusCmsPlugin/Shop/Block/show.html.twig', [ 'content' => 'rendered content', 'context' => null, ])->willReturn('rendered block'); diff --git a/spec/Twig/Runtime/RenderContentElementsRuntimeSpec.php b/spec/Twig/Runtime/RenderContentElementsRuntimeSpec.php index 483bb47cb..c5c3eea89 100644 --- a/spec/Twig/Runtime/RenderContentElementsRuntimeSpec.php +++ b/spec/Twig/Runtime/RenderContentElementsRuntimeSpec.php @@ -1,22 +1,14 @@ findOrLog('bitbag')->willReturn($media); + $mediaResourceResolver->findOrLog('sylius_cms')->willReturn($media); $provider->render($media, null)->willReturn('content'); $mediaProviderResolver->resolveProvider($media)->willReturn($provider); - $this->renderMedia('bitbag')->shouldReturn('content'); + $this->renderMedia('sylius_cms')->shouldReturn('content'); } } diff --git a/spec/Twig/Runtime/RenderPageLinkRuntimeSpec.php b/spec/Twig/Runtime/RenderPageLinkRuntimeSpec.php index 40b1b4100..c2240ca7a 100644 --- a/spec/Twig/Runtime/RenderPageLinkRuntimeSpec.php +++ b/spec/Twig/Runtime/RenderPageLinkRuntimeSpec.php @@ -1,22 +1,14 @@ findOneEnabledByCode($code)->willReturn($page); $page->getSlug()->willReturn($slug); - $router->generate('bitbag_sylius_cms_plugin_shop_page_show', ['slug' => $slug])->willReturn('link'); + $router->generate('sylius_cms_shop_page_show', ['slug' => $slug])->willReturn('link'); $this->getLinkForCode($code, $options)->shouldReturn('link'); } diff --git a/src/Assigner/ChannelsAssigner.php b/src/Assigner/ChannelsAssigner.php index ababfc15b..c911fca89 100644 --- a/src/Assigner/ChannelsAssigner.php +++ b/src/Assigner/ChannelsAssigner.php @@ -1,14 +1,8 @@ channelRepository->findOneBy(['code' => $channelCode]); + $channels = $this->channelRepository->findBy(['code' => $channelsCodes]); + Assert::allIsInstanceOf($channels, ChannelInterface::class); - Assert::notNull($channel, sprintf('Channel with %s code not found.', $channelCode)); + foreach ($channels as $channel) { $channelsAware->addChannel($channel); } } diff --git a/src/Assigner/ChannelsAssignerInterface.php b/src/Assigner/ChannelsAssignerInterface.php index 4bc3c7731..d44118350 100644 --- a/src/Assigner/ChannelsAssignerInterface.php +++ b/src/Assigner/ChannelsAssignerInterface.php @@ -1,14 +1,8 @@ collectionRepository->findOneBy(['code' => $collectionCode]); + $collections = $this->collectionRepository->findBy(['code' => $collectionsCodes]); + Assert::allIsInstanceOf($collections, CollectionInterface::class); - Assert::notNull($collection, sprintf('Collection with %s code not found.', $collectionCode)); + foreach ($collections as $collection) { $collectionsAware->addCollection($collection); } } diff --git a/src/Assigner/CollectionsAssignerInterface.php b/src/Assigner/CollectionsAssignerInterface.php index 7ad276981..a48e7af97 100644 --- a/src/Assigner/CollectionsAssignerInterface.php +++ b/src/Assigner/CollectionsAssignerInterface.php @@ -1,16 +1,10 @@ localeRepository->findAll(); + $locales = $this->localeRepository->findBy(['code' => $localesCodes]); + Assert::allIsInstanceOf($locales, LocaleInterface::class); - /** @var LocaleInterface $locale */ foreach ($locales as $locale) { - if (in_array($locale->getCode(), $localesCodes, true)) { - $localesAware->addLocale($locale); - } + $localesAware->addLocale($locale); } } } diff --git a/src/Assigner/LocalesAssignerInterface.php b/src/Assigner/LocalesAssignerInterface.php index a189e7776..5d5a3645e 100644 --- a/src/Assigner/LocalesAssignerInterface.php +++ b/src/Assigner/LocalesAssignerInterface.php @@ -1,16 +1,10 @@ productRepository->findOneBy(['code' => $productCode]); + $products = $this->productRepository->findBy(['code' => $productsCodes]); + Assert::allIsInstanceOf($products, ProductInterface::class); - Assert::notNull($product, sprintf('Product with %s code not found.', $productCode)); + foreach ($products as $product) { $productsAware->addProduct($product); } } diff --git a/src/Assigner/ProductsAssignerInterface.php b/src/Assigner/ProductsAssignerInterface.php index b3fb31b89..333cd6383 100644 --- a/src/Assigner/ProductsAssignerInterface.php +++ b/src/Assigner/ProductsAssignerInterface.php @@ -1,16 +1,10 @@ taxonRepository->findOneBy(['code' => $taxonCode]); + $taxons = $this->taxonRepository->findBy(['code' => $taxonCodes]); + Assert::allIsInstanceOf($taxons, TaxonInterface::class); - Assert::notNull($taxon, sprintf('Taxon with %s code not found.', $taxonCode)); + foreach ($taxons as $taxon) { $productsInTaxonsAware->addProductsInTaxon($taxon); } } diff --git a/src/Assigner/ProductsInTaxonsAssignerInterface.php b/src/Assigner/ProductsInTaxonsAssignerInterface.php index 569fc3833..4bf692b76 100644 --- a/src/Assigner/ProductsInTaxonsAssignerInterface.php +++ b/src/Assigner/ProductsInTaxonsAssignerInterface.php @@ -1,16 +1,10 @@ taxonRepository->findOneBy(['code' => $taxonCode]); + $taxons = $this->taxonRepository->findBy(['code' => $taxonCodes]); + Assert::allIsInstanceOf($taxons, TaxonInterface::class); - Assert::notNull($taxon, sprintf('Taxon with %s code not found.', $taxonCode)); + foreach ($taxons as $taxon) { $taxonAware->addTaxon($taxon); } } diff --git a/src/Assigner/TaxonsAssignerInterface.php b/src/Assigner/TaxonsAssignerInterface.php index 3a903587a..736082580 100644 --- a/src/Assigner/TaxonsAssignerInterface.php +++ b/src/Assigner/TaxonsAssignerInterface.php @@ -1,16 +1,10 @@ addCompilerPass(new ImporterCompilerPass()); - $container->addCompilerPass(new MediaProviderPass()); - $container->addCompilerPass(new AuthenticationManagerPolyfillPass()); - } -} diff --git a/src/Command/ImportFromCsvCommand.php b/src/Console/Command/ImportFromCsvCommand.php similarity index 74% rename from src/Command/ImportFromCsvCommand.php rename to src/Console/Command/ImportFromCsvCommand.php index b4008fa28..f5d3f28e0 100644 --- a/src/Command/ImportFromCsvCommand.php +++ b/src/Console/Command/ImportFromCsvCommand.php @@ -1,16 +1,10 @@ setName('bitbag:import:csv') + ->setName('cms:import:csv') ->setDescription('Imports a resource') ->setHelp('This command allows you to import resources from CSV. It takes file path and resource name as parameter.') ->addArgument('resource', InputArgument::REQUIRED, 'Importer resource name.') diff --git a/src/Controller/Action/Admin/ImportDataAction.php b/src/Controller/Action/Admin/ImportDataAction.php index e9164a177..ea21e8512 100644 --- a/src/Controller/Action/Admin/ImportDataAction.php +++ b/src/Controller/Action/Admin/ImportDataAction.php @@ -1,19 +1,13 @@ importProcessor->process($resourceName, $file->getPathname()); - $flashBag->set('success', $this->translator->trans('bitbag_sylius_cms_plugin.ui.successfully_imported')); + $flashBag->set('success', $this->translator->trans('sylius_cms.ui.successfully_imported')); } catch (ImportFailedException $exception) { $flashBag->set('error', $exception->getMessage()); } @@ -66,7 +60,7 @@ public function __invoke(Request $request): Response return new RedirectResponse($referer); } - return new Response($this->twig->render('@BitBagSyliusCmsPlugin/Grid/Form/_importForm.html.twig', [ + return new Response($this->twig->render('@SyliusCmsPlugin/Grid/Form/_importForm.html.twig', [ 'form' => $form->createView(), ])); } diff --git a/src/Controller/Action/Admin/ProductSearchAction.php b/src/Controller/Action/Admin/ProductSearchAction.php index feb882ef6..e8fff2e69 100644 --- a/src/Controller/Action/Admin/ProductSearchAction.php +++ b/src/Controller/Action/Admin/ProductSearchAction.php @@ -1,14 +1,8 @@ templateRepository->find($id); + if (null === $template) { + return new JsonResponse([ + 'status' => 'error', + 'message' => 'Template not found', + ]); + } + + return new JsonResponse([ + 'status' => 'success', + 'content' => $template->getContentElements(), + ]); + } +} diff --git a/src/Controller/Action/Admin/UploadEditorImageAction.php b/src/Controller/Action/Admin/UploadEditorImageAction.php index 462fe130a..84a6e7c71 100644 --- a/src/Controller/Action/Admin/UploadEditorImageAction.php +++ b/src/Controller/Action/Admin/UploadEditorImageAction.php @@ -1,18 +1,12 @@ get('code'); /** @var BlockResourceResolverInterface $blockResourceResolver */ - $blockResourceResolver = $this->get('bitbag_sylius_cms_plugin.resolver.block_resource'); + $blockResourceResolver = $this->get('sylius_cms.resolver.block_resource'); $block = $blockResourceResolver->findOrLog($code); if (null === $block) { diff --git a/src/Controller/Helper/FormErrorsFlashHelper.php b/src/Controller/Helper/FormErrorsFlashHelper.php index ab03bedc8..5ec6ef61f 100644 --- a/src/Controller/Helper/FormErrorsFlashHelper.php +++ b/src/Controller/Helper/FormErrorsFlashHelper.php @@ -1,14 +1,8 @@ getMessage(); } - $message = $this->translator->trans('bitbag_sylius_cms_plugin.ui.form_was_submitted_with_errors') . ' ' . rtrim(implode(' ', $errors)); + $message = $this->translator->trans('sylius_cms.ui.form_was_submitted_with_errors') . ' ' . rtrim(implode(' ', $errors)); $session = $this->requestStack->getSession()->getFlashBag(); $session->set('error', $message); diff --git a/src/Controller/Helper/FormErrorsFlashHelperInterface.php b/src/Controller/Helper/FormErrorsFlashHelperInterface.php index 99aa53283..e12a85c10 100644 --- a/src/Controller/Helper/FormErrorsFlashHelperInterface.php +++ b/src/Controller/Helper/FormErrorsFlashHelperInterface.php @@ -1,14 +1,8 @@ getDoctrine()->getRepository(TemplateInterface::class)->find($id); - if (null === $template) { - return new JsonResponse([ - 'status' => 'error', - 'message' => 'Template not found', - ]); - } - - return new JsonResponse([ - 'status' => 'success', - 'content' => $template->getContentElements(), - ]); - } -} diff --git a/src/DependencyInjection/BitBagSyliusCmsExtension.php b/src/DependencyInjection/BitBagSyliusCmsExtension.php deleted file mode 100755 index f22888356..000000000 --- a/src/DependencyInjection/BitBagSyliusCmsExtension.php +++ /dev/null @@ -1,45 +0,0 @@ -prependDoctrineMigrations($container); - } - - protected function getMigrationsNamespace(): string - { - return 'BitBag\SyliusCmsPlugin\Migrations'; - } - - protected function getMigrationsDirectory(): string - { - return '@BitBagSyliusCmsPlugin/Migrations'; - } - - protected function getNamespacesOfMigrationsExecutedBefore(): array - { - return ['Sylius\Bundle\CoreBundle\Migrations']; - } -} diff --git a/src/DependencyInjection/Compiler/AuthenticationManagerPolyfillPass.php b/src/DependencyInjection/Compiler/AuthenticationManagerPolyfillPass.php deleted file mode 100644 index 239ad5fde..000000000 --- a/src/DependencyInjection/Compiler/AuthenticationManagerPolyfillPass.php +++ /dev/null @@ -1,21 +0,0 @@ -has('security.authentication_manager') && - true === $container->has('security.authentication.manager') - ) { - $container->setAlias('security.authentication_manager', 'security.authentication.manager'); - } - } -} diff --git a/src/DependencyInjection/Compiler/ImporterCompilerPass.php b/src/DependencyInjection/Compiler/ImporterCompilerPass.php index 7379c5ded..53b2645a3 100644 --- a/src/DependencyInjection/Compiler/ImporterCompilerPass.php +++ b/src/DependencyInjection/Compiler/ImporterCompilerPass.php @@ -1,27 +1,21 @@ has('bitbag_sylius_cms_plugin.importer.chain')) { + if (!$container->has('sylius_cms.importer.chain')) { return; } @@ -31,7 +25,7 @@ public function process(ContainerBuilder $container): void ; $taggedServices = $container->findTaggedServiceIds(self::TAG_ID); - $definition = $container->findDefinition('bitbag_sylius_cms_plugin.importer.chain'); + $definition = $container->findDefinition('sylius_cms.importer.chain'); foreach ($taggedServices as $id => $tags) { $definition->addMethodCall('addImporter', [new Reference($id)]); diff --git a/src/DependencyInjection/Compiler/MediaProviderPass.php b/src/DependencyInjection/Compiler/MediaProviderPass.php index 846ca1542..80c375fa0 100644 --- a/src/DependencyInjection/Compiler/MediaProviderPass.php +++ b/src/DependencyInjection/Compiler/MediaProviderPass.php @@ -1,14 +1,8 @@ hasDefinition('bitbag_sylius_cms_plugin.registry.media_provider')) { + if (!$container->hasDefinition('sylius_cms.registry.media_provider')) { return; } - $providerRegistry = $container->getDefinition('bitbag_sylius_cms_plugin.registry.media_provider'); + $providerRegistry = $container->getDefinition('sylius_cms.registry.media_provider'); $providers = []; - foreach ($container->findTaggedServiceIds('bitbag_sylius_cms_plugin.media_provider') as $id => $attributes) { + foreach ($container->findTaggedServiceIds('sylius_cms.media_provider') as $id => $attributes) { if (!isset($attributes[0]['type'], $attributes[0]['label'])) { throw new \InvalidArgumentException('Tagged media provider needs to have `type` and `label` attribute.'); } @@ -40,6 +34,6 @@ public function process(ContainerBuilder $container): void ksort($providers); - $container->setParameter('bitbag_sylius_cms_plugin.media_providers', $providers); + $container->setParameter('sylius_cms.media_providers', $providers); } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php new file mode 100644 index 000000000..9f30f0f0d --- /dev/null +++ b/src/DependencyInjection/Configuration.php @@ -0,0 +1,199 @@ +getRootNode(); + + $this->addResourcesSection($rootNode); + + return $treeBuilder; + } + + private function addResourcesSection(ArrayNodeDefinition $node): void + { + $node + ->children() + ->arrayNode('resources') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('block') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(Block::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(BlockInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(BlockController::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->defaultValue(BlockRepository::class)->cannotBeEmpty()->end() + ->scalarNode('form')->defaultValue(BlockType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('collection') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(Collection::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(CollectionInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->defaultValue(CollectionRepository::class)->cannotBeEmpty()->end() + ->scalarNode('form')->defaultValue(CollectionType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('content_configuration') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(ContentConfiguration::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(ContentConfigurationInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->defaultValue(ContentConfigurationRepository::class)->cannotBeEmpty()->end() + ->scalarNode('form')->defaultValue(ContentConfigurationType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('media') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(Media::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(MediaInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(MediaController::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->defaultValue(MediaRepository::class)->cannotBeEmpty()->end() + ->scalarNode('form')->defaultValue(MediaType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->arrayNode('translation') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(MediaTranslation::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(MediaTranslationInterface::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('page') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(Page::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(PageInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(PageController::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->defaultValue(PageRepository::class)->cannotBeEmpty()->end() + ->scalarNode('form')->defaultValue(PageType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->arrayNode('translation') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(PageTranslation::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(PageTranslationInterface::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('template') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(Template::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(TemplateInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->defaultValue(TemplateRepository::class)->cannotBeEmpty()->end() + ->scalarNode('form')->defaultValue(TemplateType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ; + } +} diff --git a/src/DependencyInjection/SyliusCmsExtension.php b/src/DependencyInjection/SyliusCmsExtension.php new file mode 100755 index 000000000..e90431477 --- /dev/null +++ b/src/DependencyInjection/SyliusCmsExtension.php @@ -0,0 +1,53 @@ +getCurrentConfiguration($container); + + $this->registerResources('sylius_cms', 'doctrine/orm', $config['resources'], $container); + + $this->prependDoctrineMigrations($container); + } + + protected function getMigrationsNamespace(): string + { + return 'Sylius\CmsPlugin\Migrations'; + } + + protected function getMigrationsDirectory(): string + { + return '@SyliusCmsPlugin/Migrations'; + } + + protected function getNamespacesOfMigrationsExecutedBefore(): array + { + return ['Sylius\Bundle\CoreBundle\Migrations']; + } + + private function getCurrentConfiguration(ContainerBuilder $container): array + { + /** @var ConfigurationInterface $configuration */ + $configuration = $this->getConfiguration([], $container); + $configs = $container->getExtensionConfig($this->getAlias()); + + return $this->processConfiguration($configuration, $configs); + } +} diff --git a/src/Doctrine/ORM/Extension/EnabledAndAvailableExtension.php b/src/Doctrine/ORM/Extension/EnabledAndAvailableExtension.php new file mode 100644 index 000000000..6f69d8c66 --- /dev/null +++ b/src/Doctrine/ORM/Extension/EnabledAndAvailableExtension.php @@ -0,0 +1,69 @@ +addEnabledAndChannelCondition($queryBuilder, $queryNameGenerator, $resourceClass); + } + + public function applyToItem( + QueryBuilder $queryBuilder, + QueryNameGeneratorInterface $queryNameGenerator, + string $resourceClass, + array $identifiers, + Operation $operation = null, + array $context = [], + ): void { + $this->addEnabledAndChannelCondition($queryBuilder, $queryNameGenerator, $resourceClass); + } + + private function addEnabledAndChannelCondition(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass): void + { + $rootAlias = $queryBuilder->getRootAliases()[0]; + + $user = $this->userContext->getUser(); + if (null !== $user && in_array('ROLE_API_ACCESS', $user->getRoles(), true)) { + return; + } + + if (in_array(ToggleableInterface::class, (array) class_implements($resourceClass), true)) { + $queryBuilder + ->andWhere(sprintf('%s.enabled = :enabled', $rootAlias)) + ->setParameter('enabled', true); + } + + if (in_array(ChannelsAwareInterface::class, (array) class_implements($resourceClass), true)) { + $channelAlias = $queryNameGenerator->generateJoinAlias('channel'); + $queryBuilder + ->innerJoin(sprintf('%s.channels', $rootAlias), $channelAlias) + ->andWhere(sprintf('%s.code = :channel', $channelAlias)) + ->setParameter('channel', $this->channelContext->getChannel()->getCode()); + } + } +} diff --git a/src/Entity/Block.php b/src/Entity/Block.php index 0b2c67dd0..a84129313 100755 --- a/src/Entity/Block.php +++ b/src/Entity/Block.php @@ -1,22 +1,16 @@ setDefaults([ - 'resource' => 'bitbag_sylius_cms_plugin.template', + 'resource' => 'sylius_cms.template', 'choice_name' => 'name', 'choice_value' => 'id', ]); diff --git a/src/Form/Type/BlockAutocompleteChoiceType.php b/src/Form/Type/BlockAutocompleteChoiceType.php index f99a4a6fc..3dc7139a7 100644 --- a/src/Form/Type/BlockAutocompleteChoiceType.php +++ b/src/Form/Type/BlockAutocompleteChoiceType.php @@ -1,14 +1,8 @@ setDefaults([ - 'resource' => 'bitbag_sylius_cms_plugin.block', + 'resource' => 'sylius_cms.block', 'choice_name' => 'name', 'choice_value' => 'code', ]); @@ -38,7 +32,7 @@ public function buildView( public function getBlockPrefix(): string { - return 'bitbag_block_autocomplete_choice'; + return 'sylius_block_autocomplete_choice'; } public function getParent(): string diff --git a/src/Form/Type/BlockType.php b/src/Form/Type/BlockType.php index 6713a45cf..b32acf3be 100755 --- a/src/Form/Type/BlockType.php +++ b/src/Form/Type/BlockType.php @@ -1,20 +1,14 @@ add('code', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.code', + 'label' => 'sylius_cms.ui.code', 'disabled' => null !== $block->getCode(), ]) ->add('name', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.name', + 'label' => 'sylius_cms.ui.name', ]) ->add('collections', CollectionAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.collections', + 'label' => 'sylius_cms.ui.collections', 'multiple' => true, ]) ->add('enabled', CheckboxType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.enabled', + 'label' => 'sylius_cms.ui.enabled', ]) ->add('channels', ChannelChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.channels', + 'label' => 'sylius_cms.ui.channels', 'required' => false, 'multiple' => true, 'expanded' => true, @@ -58,19 +52,19 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'required' => false, ]) ->add('products', ProductAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.display_for_products.label', + 'label' => 'sylius_cms.ui.display_for_products.label', 'multiple' => true, - 'help' => 'bitbag_sylius_cms_plugin.ui.display_for_products.help', + 'help' => 'sylius_cms.ui.display_for_products.help', ]) ->add('productsInTaxons', TaxonAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.display_for_products_in_taxons.label', + 'label' => 'sylius_cms.ui.display_for_products_in_taxons.label', 'multiple' => true, - 'help' => 'bitbag_sylius_cms_plugin.ui.display_for_products_in_taxons.help', + 'help' => 'sylius_cms.ui.display_for_products_in_taxons.help', ]) ->add('taxons', TaxonAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.display_for_taxons.label', + 'label' => 'sylius_cms.ui.display_for_taxons.label', 'multiple' => true, - 'help' => 'bitbag_sylius_cms_plugin.ui.display_for_taxons.help', + 'help' => 'sylius_cms.ui.display_for_taxons.help', ]) ->add('template', TemplateBlockAutocompleteChoiceType::class, [ 'label' => false, @@ -81,6 +75,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_block'; + return 'sylius_cms_block'; } } diff --git a/src/Form/Type/CollectionAutocompleteChoiceType.php b/src/Form/Type/CollectionAutocompleteChoiceType.php index 1ac306653..6d13254e9 100755 --- a/src/Form/Type/CollectionAutocompleteChoiceType.php +++ b/src/Form/Type/CollectionAutocompleteChoiceType.php @@ -1,14 +1,8 @@ setDefaults([ - 'resource' => 'bitbag_sylius_cms_plugin.collection', + 'resource' => 'sylius_cms.collection', 'choice_name' => 'name', 'choice_value' => 'code', ]); @@ -38,7 +32,7 @@ public function buildView( public function getBlockPrefix(): string { - return 'bitbag_collection_autocomplete_choice'; + return 'sylius_collection_autocomplete_choice'; } public function getParent(): string diff --git a/src/Form/Type/CollectionType.php b/src/Form/Type/CollectionType.php index 6478f89da..1a806737b 100755 --- a/src/Form/Type/CollectionType.php +++ b/src/Form/Type/CollectionType.php @@ -1,14 +1,8 @@ add('code', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.code', + 'label' => 'sylius_cms.ui.code', 'disabled' => null !== $builder->getData()->getCode(), ]) ->add('name', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.name', + 'label' => 'sylius_cms.ui.name', ]) ->add('type', ChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.type', + 'label' => 'sylius_cms.ui.type', 'choices' => [ - 'bitbag_sylius_cms_plugin.ui.page' => self::PAGE, - 'bitbag_sylius_cms_plugin.ui.block' => self::BLOCK, - 'bitbag_sylius_cms_plugin.ui.media' => self::MEDIA, + 'sylius_cms.ui.page' => self::PAGE, + 'sylius_cms.ui.block' => self::BLOCK, + 'sylius_cms.ui.media' => self::MEDIA, ], ]) ->add('pages', PageAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.pages', + 'label' => 'sylius_cms.ui.pages', 'multiple' => true, ]) ->add('blocks', BlockAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.blocks', + 'label' => 'sylius_cms.ui.blocks', 'multiple' => true, ]) ->add('media', MediaAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.media', + 'label' => 'sylius_cms.ui.media', 'multiple' => true, ]) ->addEventListener(FormEvents::PRE_SUBMIT, function (PreSubmitEvent $event): void { @@ -78,6 +72,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_collection'; + return 'sylius_cms_collection'; } } diff --git a/src/Form/Type/ContentConfigurationType.php b/src/Form/Type/ContentConfigurationType.php index ead59d4e8..ece655046 100644 --- a/src/Form/Type/ContentConfigurationType.php +++ b/src/Form/Type/ContentConfigurationType.php @@ -1,17 +1,11 @@ $formType) { $this->actionConfigurationTypes[$type] = $formType::class; - $this->actionTypes['bitbag_sylius_cms_plugin.ui.content_elements.type.' . $type] = $type; + $this->actionTypes['sylius_cms.ui.content_elements.type.' . $type] = $type; } } @@ -50,7 +44,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'choice_attr' => function (?string $type) use ($builder): array { return [ 'data-configuration' => $this->twig->render( - '@BitBagSyliusCmsPlugin/ContentConfiguration/_action.html.twig', + '@SyliusCmsPlugin/ContentConfiguration/_action.html.twig', [ 'field' => $builder->create( 'configuration', @@ -112,6 +106,6 @@ private function addConfigurationTypeToForm(FormEvent $event): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_configuration'; + return 'sylius_cms_content_configuration'; } } diff --git a/src/Form/Type/ContentElementType.php b/src/Form/Type/ContentElementType.php index 1be324c93..4d3091c56 100644 --- a/src/Form/Type/ContentElementType.php +++ b/src/Form/Type/ContentElementType.php @@ -1,14 +1,8 @@ contentElementTypes as $type => $formType) { - $this->contentElements['bitbag_sylius_cms_plugin.ui.content_elements.type.' . $type] = $type; + $this->contentElements['sylius_cms.ui.content_elements.type.' . $type] = $type; } } @@ -30,7 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('type', ChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.type', + 'label' => 'sylius_cms.ui.type', 'choices' => $this->contentElements, ]) ; diff --git a/src/Form/Type/ContentElements/HeadingContentElementType.php b/src/Form/Type/ContentElements/HeadingContentElementType.php index 49d2ef3f5..2eea9757f 100644 --- a/src/Form/Type/ContentElements/HeadingContentElementType.php +++ b/src/Form/Type/ContentElements/HeadingContentElementType.php @@ -1,14 +1,8 @@ add('heading_type', ChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.heading_type', + 'label' => 'sylius_cms.ui.content_elements.heading_type', 'choices' => [ 'H1' => 'h1', 'H2' => 'h2', @@ -36,13 +30,13 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'empty_data' => 'h1', ]) ->add(self::TYPE, TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.type.' . self::TYPE, + 'label' => 'sylius_cms.ui.content_elements.type.' . self::TYPE, ]) ; } public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ContentElements/MultipleMediaContentElementType.php b/src/Form/Type/ContentElements/MultipleMediaContentElementType.php index 4406258f6..0d5fcec9c 100644 --- a/src/Form/Type/ContentElements/MultipleMediaContentElementType.php +++ b/src/Form/Type/ContentElements/MultipleMediaContentElementType.php @@ -1,16 +1,10 @@ add(self::TYPE, MediaAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.type.' . self::TYPE, + 'label' => 'sylius_cms.ui.content_elements.type.' . self::TYPE, 'multiple' => true, ]) ; @@ -37,6 +31,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ContentElements/PagesCollectionContentElementType.php b/src/Form/Type/ContentElements/PagesCollectionContentElementType.php index a2ffc366f..410bb3ec3 100644 --- a/src/Form/Type/ContentElements/PagesCollectionContentElementType.php +++ b/src/Form/Type/ContentElements/PagesCollectionContentElementType.php @@ -1,18 +1,12 @@ add(self::TYPE, PageCollectionAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.type.' . self::TYPE, + 'label' => 'sylius_cms.ui.content_elements.type.' . self::TYPE, ]) ; @@ -45,6 +39,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ContentElements/ProductsCarouselByTaxonContentElementType.php b/src/Form/Type/ContentElements/ProductsCarouselByTaxonContentElementType.php index d39aa28fa..b3ff0b0c8 100644 --- a/src/Form/Type/ContentElements/ProductsCarouselByTaxonContentElementType.php +++ b/src/Form/Type/ContentElements/ProductsCarouselByTaxonContentElementType.php @@ -1,18 +1,12 @@ add(self::TYPE, TaxonAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.taxon', + 'label' => 'sylius_cms.ui.taxon', 'choice_value' => 'code', 'resource' => 'sylius.taxon', ]) @@ -47,6 +41,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ContentElements/ProductsCarouselContentElementType.php b/src/Form/Type/ContentElements/ProductsCarouselContentElementType.php index 990c54c95..e8ab722f1 100644 --- a/src/Form/Type/ContentElements/ProductsCarouselContentElementType.php +++ b/src/Form/Type/ContentElements/ProductsCarouselContentElementType.php @@ -1,14 +1,8 @@ add(self::TYPE, TaxonAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.taxon', + 'label' => 'sylius_cms.ui.taxon', 'choice_value' => 'code', 'resource' => 'sylius.taxon', ]) @@ -47,6 +41,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ContentElements/ProductsGridContentElementType.php b/src/Form/Type/ContentElements/ProductsGridContentElementType.php index a46743372..bcf15f037 100644 --- a/src/Form/Type/ContentElements/ProductsGridContentElementType.php +++ b/src/Form/Type/ContentElements/ProductsGridContentElementType.php @@ -1,14 +1,8 @@ add(self::TYPE, MediaAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.type.' . self::TYPE, + 'label' => 'sylius_cms.ui.content_elements.type.' . self::TYPE, ]) ; @@ -45,6 +39,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ContentElements/SpacerContentElementType.php b/src/Form/Type/ContentElements/SpacerContentElementType.php index adb0a5d19..ca2d45e34 100644 --- a/src/Form/Type/ContentElements/SpacerContentElementType.php +++ b/src/Form/Type/ContentElements/SpacerContentElementType.php @@ -1,14 +1,8 @@ add(self::TYPE, NumberType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.type.' . self::TYPE . '_height', + 'label' => 'sylius_cms.ui.content_elements.type.' . self::TYPE . '_height', 'attr' => [ 'min' => 0, ], @@ -33,6 +27,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ContentElements/TaxonsListContentElementType.php b/src/Form/Type/ContentElements/TaxonsListContentElementType.php index d3da4df7f..3ac14c567 100644 --- a/src/Form/Type/ContentElements/TaxonsListContentElementType.php +++ b/src/Form/Type/ContentElements/TaxonsListContentElementType.php @@ -1,14 +1,8 @@ add(self::TYPE, WysiwygType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.content_elements.type.' . self::TYPE, + 'label' => 'sylius_cms.ui.content_elements.type.' . self::TYPE, ]) ; } public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_content_elements_' . self::TYPE; + return 'sylius_cms_content_elements_' . self::TYPE; } } diff --git a/src/Form/Type/ImportType.php b/src/Form/Type/ImportType.php index 0c5651259..f1d4b2916 100644 --- a/src/Form/Type/ImportType.php +++ b/src/Form/Type/ImportType.php @@ -1,14 +1,8 @@ true, 'constraints' => [ new NotNull([ - 'message' => 'bitbag_sylius_cms_plugin.import.not_blank', + 'message' => 'sylius_cms.import.not_blank', ]), new File([ 'mimeTypes' => ['text/csv', 'text/plain'], - 'mimeTypesMessage' => 'bitbag_sylius_cms_plugin.import.invalid_format', + 'mimeTypesMessage' => 'sylius_cms.import.invalid_format', ]), ], ]); diff --git a/src/Form/Type/MediaAutocompleteChoiceType.php b/src/Form/Type/MediaAutocompleteChoiceType.php index 397cd5902..045511602 100644 --- a/src/Form/Type/MediaAutocompleteChoiceType.php +++ b/src/Form/Type/MediaAutocompleteChoiceType.php @@ -1,17 +1,11 @@ setDefaults([ - 'resource' => 'bitbag_sylius_cms_plugin.media', + 'resource' => 'sylius_cms.media', 'choice_name' => 'name', 'choice_value' => 'code', 'media_type' => [ @@ -45,7 +39,7 @@ public function buildView( public function getBlockPrefix(): string { - return 'bitbag_media_autocomplete_choice'; + return 'sylius_media_autocomplete_choice'; } public function getParent(): string diff --git a/src/Form/Type/MediaImageAutocompleteChoiceType.php b/src/Form/Type/MediaImageAutocompleteChoiceType.php index badf0cb17..2b7e67822 100644 --- a/src/Form/Type/MediaImageAutocompleteChoiceType.php +++ b/src/Form/Type/MediaImageAutocompleteChoiceType.php @@ -1,17 +1,11 @@ setDefaults([ - 'resource' => 'bitbag_sylius_cms_plugin.media', + 'resource' => 'sylius_cms.media', 'choice_name' => 'name', 'choice_value' => 'code', 'media_type' => [MediaInterface::IMAGE_TYPE], @@ -41,7 +35,7 @@ public function buildView( public function getBlockPrefix(): string { - return 'bitbag_media_autocomplete_choice'; + return 'sylius_media_autocomplete_choice'; } public function getParent(): string diff --git a/src/Form/Type/MediaType.php b/src/Form/Type/MediaType.php index d0fb16a8b..4cdc7a749 100644 --- a/src/Form/Type/MediaType.php +++ b/src/Form/Type/MediaType.php @@ -1,19 +1,13 @@ add('code', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.code', + 'label' => 'sylius_cms.ui.code', 'disabled' => null !== $data && null !== $data->getCode(), ]) ->add('name', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.name', + 'label' => 'sylius_cms.ui.name', ]) ->add('type', ChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.type', + 'label' => 'sylius_cms.ui.type', 'choices' => $this->providers, ]) ->add('file', FileType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.file', + 'label' => 'sylius_cms.ui.file', ]) ->add('collections', CollectionAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.collections', + 'label' => 'sylius_cms.ui.collections', 'multiple' => true, ]) ->add('enabled', CheckboxType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.enabled', + 'label' => 'sylius_cms.ui.enabled', ]) ->add('saveWithOriginalName', CheckboxType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.save_with_original_name', + 'label' => 'sylius_cms.ui.save_with_original_name', ]) ->add('channels', ChannelChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.channels', + 'label' => 'sylius_cms.ui.channels', 'required' => false, 'multiple' => true, 'expanded' => true, ]) ->add('path', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.path', + 'label' => 'sylius_cms.ui.path', 'disabled' => true, 'required' => false, ]) @@ -82,6 +76,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_media'; + return 'sylius_cms_media'; } } diff --git a/src/Form/Type/PageAutocompleteChoiceType.php b/src/Form/Type/PageAutocompleteChoiceType.php index b1fd7639b..86c27d7be 100644 --- a/src/Form/Type/PageAutocompleteChoiceType.php +++ b/src/Form/Type/PageAutocompleteChoiceType.php @@ -1,14 +1,8 @@ setDefaults([ - 'resource' => 'bitbag_sylius_cms_plugin.page', + 'resource' => 'sylius_cms.page', 'choice_name' => 'name', 'choice_value' => 'code', ]); @@ -38,7 +32,7 @@ public function buildView( public function getBlockPrefix(): string { - return 'bitbag_page_autocomplete_choice'; + return 'sylius_page_autocomplete_choice'; } public function getParent(): string diff --git a/src/Form/Type/PageCollectionAutocompleteChoiceType.php b/src/Form/Type/PageCollectionAutocompleteChoiceType.php index cb985025d..7f543b0ec 100755 --- a/src/Form/Type/PageCollectionAutocompleteChoiceType.php +++ b/src/Form/Type/PageCollectionAutocompleteChoiceType.php @@ -1,14 +1,8 @@ setDefaults([ - 'resource' => 'bitbag_sylius_cms_plugin.collection', + 'resource' => 'sylius_cms.collection', 'choice_name' => 'name', 'choice_value' => 'code', ]); @@ -38,7 +32,7 @@ public function buildView( public function getBlockPrefix(): string { - return 'bitbag_page_collection_autocomplete_choice'; + return 'sylius_page_collection_autocomplete_choice'; } public function getParent(): string diff --git a/src/Form/Type/PageType.php b/src/Form/Type/PageType.php index 9834f9256..100b702f8 100755 --- a/src/Form/Type/PageType.php +++ b/src/Form/Type/PageType.php @@ -1,19 +1,13 @@ add('code', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.code', + 'label' => 'sylius_cms.ui.code', 'disabled' => null !== $builder->getData()->getCode(), ]) ->add('name', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.name', + 'label' => 'sylius_cms.ui.name', ]) ->add('enabled', CheckboxType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.enabled', + 'label' => 'sylius_cms.ui.enabled', ]) ->add('translations', ResourceTranslationsType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.images', + 'label' => 'sylius_cms.ui.images', 'entry_type' => PageTranslationType::class, ]) ->add('collections', CollectionAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.collections', + 'label' => 'sylius_cms.ui.collections', 'multiple' => true, ]) ->add('channels', ChannelChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.channels', + 'label' => 'sylius_cms.ui.channels', 'required' => false, 'multiple' => true, 'expanded' => true, ]) ->add('publishAt', DateTimeType::class, [ 'input' => 'datetime_immutable', - 'label' => 'bitbag_sylius_cms_plugin.ui.publish_at', + 'label' => 'sylius_cms.ui.publish_at', 'date_widget' => 'single_text', 'time_widget' => 'single_text', 'required' => false, @@ -69,15 +63,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'mapped' => false, ]) ->add('teaserTitle', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.teaser.title', + 'label' => 'sylius_cms.ui.teaser.title', 'required' => false, ]) ->add('teaserContent', WysiwygType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.teaser.content', + 'label' => 'sylius_cms.ui.teaser.content', 'required' => false, ]) ->add('teaserImage', MediaImageAutocompleteChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.teaser.image', + 'label' => 'sylius_cms.ui.teaser.image', 'required' => false, ]) ; @@ -85,6 +79,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_page'; + return 'sylius_cms_page'; } } diff --git a/src/Form/Type/TemplateBlockAutocompleteChoiceType.php b/src/Form/Type/TemplateBlockAutocompleteChoiceType.php index c07373193..121bf2346 100644 --- a/src/Form/Type/TemplateBlockAutocompleteChoiceType.php +++ b/src/Form/Type/TemplateBlockAutocompleteChoiceType.php @@ -1,19 +1,13 @@ add('name', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.name', + 'label' => 'sylius_cms.ui.name', ]) ->add('type', ChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.type', + 'label' => 'sylius_cms.ui.type', 'choices' => [ - 'bitbag_sylius_cms_plugin.ui.page' => 'page', - 'bitbag_sylius_cms_plugin.ui.block' => 'block', + 'sylius_cms.ui.page' => 'page', + 'sylius_cms.ui.block' => 'block', ], ]) ->add('contentElements', CollectionType::class, [ @@ -44,6 +38,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_template'; + return 'sylius_cms_template'; } } diff --git a/src/Form/Type/Translation/MediaTranslationType.php b/src/Form/Type/Translation/MediaTranslationType.php index 5df403306..1dc707d04 100755 --- a/src/Form/Type/Translation/MediaTranslationType.php +++ b/src/Form/Type/Translation/MediaTranslationType.php @@ -1,17 +1,11 @@ add('alt', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.alt', + 'label' => 'sylius_cms.ui.alt', 'required' => false, ]) ->add('link', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.link', + 'label' => 'sylius_cms.ui.link', 'required' => false, ]) ->add('content', WysiwygType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.link_content', + 'label' => 'sylius_cms.ui.link_content', 'required' => false, ]) ; @@ -37,6 +31,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_media_translation'; + return 'sylius_cms_media_translation'; } } diff --git a/src/Form/Type/Translation/PageTranslationType.php b/src/Form/Type/Translation/PageTranslationType.php index e23c84e44..3960690a5 100755 --- a/src/Form/Type/Translation/PageTranslationType.php +++ b/src/Form/Type/Translation/PageTranslationType.php @@ -1,14 +1,8 @@ add('slug', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.slug', + 'label' => 'sylius_cms.ui.slug', ]) ->add('title', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.meta_title', + 'label' => 'sylius_cms.ui.meta_title', 'required' => false, ]) ->add('metaKeywords', TextareaType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.meta_keywords', + 'label' => 'sylius_cms.ui.meta_keywords', 'required' => false, ]) ->add('metaDescription', TextareaType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.meta_description', + 'label' => 'sylius_cms.ui.meta_description', 'required' => false, ]) ; @@ -40,6 +34,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function getBlockPrefix(): string { - return 'bitbag_sylius_cms_plugin_page_translation'; + return 'sylius_cms_page_translation'; } } diff --git a/src/Form/Type/WysiwygType.php b/src/Form/Type/WysiwygType.php index 6318c3d0a..d11c662aa 100644 --- a/src/Form/Type/WysiwygType.php +++ b/src/Form/Type/WysiwygType.php @@ -1,14 +1,8 @@ setDefaults([ - 'label' => 'bitbag_sylius_cms_plugin.ui.content', + 'label' => 'sylius_cms.ui.content', 'config' => [ - 'filebrowserUploadUrl' => $this->urlGenerator->generate('bitbag_sylius_cms_plugin_admin_upload_editor_image'), - 'bodyId' => 'bitbag-ckeditor', + 'filebrowserUploadUrl' => $this->urlGenerator->generate('sylius_cms_admin_upload_editor_image'), + 'bodyId' => 'cms-ckeditor', ], ]); } @@ -39,6 +33,6 @@ public function getParent(): string public function getBlockPrefix(): string { - return 'bitbag_wysiwyg'; + return 'sylius_wysiwyg'; } } diff --git a/src/Importer/AbstractImporter.php b/src/Importer/AbstractImporter.php index 50dc401cd..656f5964e 100755 --- a/src/Importer/AbstractImporter.php +++ b/src/Importer/AbstractImporter.php @@ -1,14 +1,8 @@ importerTaxonsResolver->resolve($block, $this->getColumnValue(self::TAXONS_COLUMN, $row)); $this->importerProductsInTaxonsResolver->resolve($block, $this->getColumnValue(self::PRODUCTS_IN_TAXONS_COLUMN, $row)); - $this->validateResource($block, ['bitbag']); + $this->validateResource($block, ['cms']); $this->blockRepository->add($block); } diff --git a/src/Importer/BlockImporterInterface.php b/src/Importer/BlockImporterInterface.php index fce4522af..9ea13e71e 100644 --- a/src/Importer/BlockImporterInterface.php +++ b/src/Importer/BlockImporterInterface.php @@ -1,14 +1,8 @@ importerCollectionsResolver->resolve($media, $this->getColumnValue(self::COLLECTIONS_COLUMN, $row)); - $this->validateResource($media, ['bitbag']); + $this->validateResource($media, ['cms']); $this->mediaRepository->add($media); } diff --git a/src/Importer/MediaImporterInterface.php b/src/Importer/MediaImporterInterface.php index 2d20980f5..79872ea4f 100644 --- a/src/Importer/MediaImporterInterface.php +++ b/src/Importer/MediaImporterInterface.php @@ -1,14 +1,8 @@ importerCollectionsResolver->resolve($page, $this->getColumnValue(self::COLLECTIONS_COLUMN, $row)); $this->importerChannelsResolver->resolve($page, $this->getColumnValue(self::CHANNELS_COLUMN, $row)); - $this->validateResource($page, ['bitbag']); + $this->validateResource($page, ['cms']); $this->entityManager->persist($page); $this->entityManager->flush(); diff --git a/src/Importer/PageImporterInterface.php b/src/Importer/PageImporterInterface.php index ec3da1320..ae6eaa795 100644 --- a/src/Importer/PageImporterInterface.php +++ b/src/Importer/PageImporterInterface.php @@ -1,14 +1,8 @@ getMenu(); $cmsRootMenuItem = $menu - ->addChild('bitbag_cms') - ->setLabel('bitbag_sylius_cms_plugin.ui.cms') + ->addChild('sylius_cms') + ->setLabel('sylius_cms.ui.cms') ; $cmsRootMenuItem ->addChild('collections', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_collection_index', + 'route' => 'sylius_cms_admin_collection_index', ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.collections') + ->setLabel('sylius_cms.ui.collections') ->setLabelAttribute('icon', 'grid layout') ; $cmsRootMenuItem ->addChild('templates', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_template_index', + 'route' => 'sylius_cms_admin_template_index', ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.templates') + ->setLabel('sylius_cms.ui.templates') ->setLabelAttribute('icon', 'clone') ; $cmsRootMenuItem ->addChild('pages', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_page_index', + 'route' => 'sylius_cms_admin_page_index', ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.pages') + ->setLabel('sylius_cms.ui.pages') ->setLabelAttribute('icon', 'sticky note') ; $cmsRootMenuItem ->addChild('blocks', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_block_index', + 'route' => 'sylius_cms_admin_block_index', ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.blocks') + ->setLabel('sylius_cms.ui.blocks') ->setLabelAttribute('icon', 'block layout') ; $cmsRootMenuItem ->addChild('media', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_media_index', + 'route' => 'sylius_cms_admin_media_index', ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.media') + ->setLabel('sylius_cms.ui.media') ->setLabelAttribute('icon', 'file') ; - $this->menuReorder->reorder($menu, 'bitbag_cms', 'marketing'); + $this->menuReorder->reorder($menu, 'sylius_cms', 'marketing'); } } diff --git a/src/Menu/MenuReorder.php b/src/Menu/MenuReorder.php index 283d37028..a57fa8c94 100644 --- a/src/Menu/MenuReorder.php +++ b/src/Menu/MenuReorder.php @@ -1,14 +1,8 @@ addSql('ALTER TABLE bitbag_cms_block_taxons DROP FOREIGN KEY FK_E324C6CEDE13F470'); + $this->addSql('ALTER TABLE bitbag_cms_block_taxons DROP FOREIGN KEY FK_E324C6CEE9ED820C'); + $this->addSql('ALTER TABLE bitbag_cms_faq_translation DROP FOREIGN KEY FK_8B30DD2E2C2AC5D3'); + $this->addSql('ALTER TABLE bitbag_cms_page_channels DROP FOREIGN KEY FK_DCA426972F5A1AA'); + $this->addSql('ALTER TABLE bitbag_cms_page_channels DROP FOREIGN KEY FK_DCA4269C4663E4'); + $this->addSql('ALTER TABLE bitbag_cms_block_channels DROP FOREIGN KEY FK_8417B07372F5A1AA'); + $this->addSql('ALTER TABLE bitbag_cms_block_channels DROP FOREIGN KEY FK_8417B073E9ED820C'); + $this->addSql('ALTER TABLE bitbag_cms_block_products_in_taxons DROP FOREIGN KEY FK_DAA9DD18E9ED820C'); + $this->addSql('ALTER TABLE bitbag_cms_block_products_in_taxons DROP FOREIGN KEY FK_DAA9DD18DE13F470'); + $this->addSql('ALTER TABLE bitbag_cms_media_products DROP FOREIGN KEY FK_91A7DAC24584665A'); + $this->addSql('ALTER TABLE bitbag_cms_media_products DROP FOREIGN KEY FK_91A7DAC2EA9FDD75'); + $this->addSql('ALTER TABLE bitbag_cms_section_pages DROP FOREIGN KEY FK_C96225EEC4663E4'); + $this->addSql('ALTER TABLE bitbag_cms_section_pages DROP FOREIGN KEY FK_C96225EED823E37A'); + $this->addSql('ALTER TABLE bitbag_cms_media_translation DROP FOREIGN KEY FK_1FEC58972C2AC5D3'); + $this->addSql('ALTER TABLE bitbag_cms_page_translation DROP FOREIGN KEY FK_FDD074A62C2AC5D3'); + $this->addSql('ALTER TABLE bitbag_cms_section_blocks DROP FOREIGN KEY FK_A9D9C974D823E37A'); + $this->addSql('ALTER TABLE bitbag_cms_section_blocks DROP FOREIGN KEY FK_A9D9C974E9ED820C'); + $this->addSql('ALTER TABLE bitbag_cms_block_products DROP FOREIGN KEY FK_C4B9089F4584665A'); + $this->addSql('ALTER TABLE bitbag_cms_block_products DROP FOREIGN KEY FK_C4B9089FE9ED820C'); + $this->addSql('ALTER TABLE bitbag_cms_page DROP FOREIGN KEY FK_18F07F1BF56F16CF'); + $this->addSql('ALTER TABLE bitbag_cms_block_locales DROP FOREIGN KEY FK_E1F907BAE559DFD1'); + $this->addSql('ALTER TABLE bitbag_cms_block_locales DROP FOREIGN KEY FK_E1F907BAE9ED820C'); + $this->addSql('ALTER TABLE bitbag_cms_section_media DROP FOREIGN KEY FK_833A6197D823E37A'); + $this->addSql('ALTER TABLE bitbag_cms_section_media DROP FOREIGN KEY FK_833A6197EA9FDD75'); + $this->addSql('ALTER TABLE bitbag_cms_content_configuration DROP FOREIGN KEY FK_D899EFA7E9ED820C'); + $this->addSql('ALTER TABLE bitbag_cms_content_configuration DROP FOREIGN KEY FK_D899EFA7C4663E4'); + $this->addSql('ALTER TABLE bitbag_cms_media_channels DROP FOREIGN KEY FK_D109622E72F5A1AA'); + $this->addSql('ALTER TABLE bitbag_cms_media_channels DROP FOREIGN KEY FK_D109622EEA9FDD75'); + $this->addSql('ALTER TABLE bitbag_cms_faq_channels DROP FOREIGN KEY FK_FF6D59AC72F5A1AA'); + $this->addSql('ALTER TABLE bitbag_cms_faq_channels DROP FOREIGN KEY FK_FF6D59AC81BEC8C2'); + + $this->addSql('RENAME TABLE bitbag_cms_template TO sylius_cms_template'); + $this->addSql('RENAME TABLE bitbag_cms_media TO sylius_cms_media'); + $this->addSql('RENAME TABLE bitbag_cms_block TO sylius_cms_block'); + $this->addSql('RENAME TABLE bitbag_cms_block_taxons TO sylius_cms_block_taxons'); + $this->addSql('RENAME TABLE bitbag_cms_page_channels TO sylius_cms_page_channels'); + $this->addSql('RENAME TABLE bitbag_cms_block_channels TO sylius_cms_block_channels'); + $this->addSql('RENAME TABLE bitbag_cms_block_products_in_taxons TO sylius_cms_block_products_in_taxons'); + $this->addSql('RENAME TABLE bitbag_cms_section_pages TO sylius_cms_section_pages'); + $this->addSql('RENAME TABLE bitbag_cms_media_translation TO sylius_cms_media_translation'); + $this->addSql('RENAME TABLE bitbag_cms_page_translation TO sylius_cms_page_translation'); + $this->addSql('RENAME TABLE bitbag_cms_section_blocks TO sylius_cms_section_blocks'); + $this->addSql('RENAME TABLE bitbag_cms_block_products TO sylius_cms_block_products'); + $this->addSql('RENAME TABLE bitbag_cms_page TO sylius_cms_page'); + $this->addSql('RENAME TABLE bitbag_cms_section TO sylius_cms_section'); + $this->addSql('RENAME TABLE bitbag_cms_block_locales TO sylius_cms_block_locales'); + $this->addSql('RENAME TABLE bitbag_cms_section_media TO sylius_cms_section_media'); + $this->addSql('RENAME TABLE bitbag_cms_content_configuration TO sylius_cms_content_configuration'); + $this->addSql('RENAME TABLE bitbag_cms_media_channels TO sylius_cms_media_channels'); + + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602FE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE559DFD1 FOREIGN KEY (locale_id) REFERENCES sylius_locale (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C3E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C34584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03DE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEDE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id)'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B272EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B27272F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_translation ADD CONSTRAINT FK_AAAC4A922C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page ADD CONSTRAINT FK_2C2740B2F56F16CF FOREIGN KEY (teaser_image_id) REFERENCES sylius_cms_media (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7FC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_translation ADD CONSTRAINT FK_6D0D401B2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8C4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + + $this->addSql('DROP TABLE bitbag_cms_faq_translation'); + $this->addSql('DROP TABLE bitbag_cms_media_products'); + $this->addSql('DROP TABLE bitbag_cms_faq'); + $this->addSql('DROP TABLE bitbag_cms_faq_channels'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602FE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602F72F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE559DFD1'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C3E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C34584665A'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03DE13F470'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEDE13F470'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DC4663E4'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B272EA9FDD75'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B27272F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_media_translation DROP FOREIGN KEY FK_AAAC4A922C2AC5D3'); + $this->addSql('ALTER TABLE sylius_cms_page DROP FOREIGN KEY FK_2C2740B2F56F16CF'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7FC4663E4'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7F72F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_page_translation DROP FOREIGN KEY FK_6D0D401B2C2AC5D3'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8C4663E4'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81EA9FDD75'); + + $this->addSql('RENAME TABLE sylius_cms_template TO bitbag_cms_template'); + $this->addSql('RENAME TABLE sylius_cms_media TO bitbag_cms_media'); + $this->addSql('RENAME TABLE sylius_cms_block TO bitbag_cms_block'); + $this->addSql('RENAME TABLE sylius_cms_block_taxons TO bitbag_cms_block_taxons'); + $this->addSql('RENAME TABLE sylius_cms_page_channels TO bitbag_cms_page_channels'); + $this->addSql('RENAME TABLE sylius_cms_block_channels TO bitbag_cms_block_channels'); + $this->addSql('RENAME TABLE sylius_cms_block_products_in_taxons TO bitbag_cms_block_products_in_taxons'); + $this->addSql('RENAME TABLE sylius_cms_section_pages TO bitbag_cms_section_pages'); + $this->addSql('RENAME TABLE sylius_cms_media_translation TO bitbag_cms_media_translation'); + $this->addSql('RENAME TABLE sylius_cms_page_translation TO bitbag_cms_page_translation'); + $this->addSql('RENAME TABLE sylius_cms_section_blocks TO bitbag_cms_section_blocks'); + $this->addSql('RENAME TABLE sylius_cms_block_products TO bitbag_cms_block_products'); + $this->addSql('RENAME TABLE sylius_cms_page TO bitbag_cms_page'); + $this->addSql('RENAME TABLE sylius_cms_section TO bitbag_cms_section'); + $this->addSql('RENAME TABLE sylius_cms_block_locales TO bitbag_cms_block_locales'); + $this->addSql('RENAME TABLE sylius_cms_section_media TO bitbag_cms_section_media'); + $this->addSql('RENAME TABLE sylius_cms_content_configuration TO bitbag_cms_content_configuration'); + $this->addSql('RENAME TABLE sylius_cms_media_channels TO bitbag_cms_media_channels'); + + $this->addSql('ALTER TABLE bitbag_cms_block_taxons ADD CONSTRAINT FK_E324C6CEDE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_taxons ADD CONSTRAINT FK_E324C6CEE9ED820C FOREIGN KEY (block_id) REFERENCES bitbag_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_page_channels ADD CONSTRAINT FK_DCA426972F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_page_channels ADD CONSTRAINT FK_DCA4269C4663E4 FOREIGN KEY (page_id) REFERENCES bitbag_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_channels ADD CONSTRAINT FK_8417B07372F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_channels ADD CONSTRAINT FK_8417B073E9ED820C FOREIGN KEY (block_id) REFERENCES bitbag_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_products_in_taxons ADD CONSTRAINT FK_DAA9DD18E9ED820C FOREIGN KEY (block_id) REFERENCES bitbag_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_products_in_taxons ADD CONSTRAINT FK_DAA9DD18DE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_section_pages ADD CONSTRAINT FK_C96225EEC4663E4 FOREIGN KEY (page_id) REFERENCES bitbag_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_section_pages ADD CONSTRAINT FK_C96225EED823E37A FOREIGN KEY (section_id) REFERENCES bitbag_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_media_translation ADD CONSTRAINT FK_1FEC58972C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES bitbag_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_page_translation ADD CONSTRAINT FK_FDD074A62C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES bitbag_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_section_blocks ADD CONSTRAINT FK_A9D9C974D823E37A FOREIGN KEY (section_id) REFERENCES bitbag_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_section_blocks ADD CONSTRAINT FK_A9D9C974E9ED820C FOREIGN KEY (block_id) REFERENCES bitbag_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_products ADD CONSTRAINT FK_C4B9089F4584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_products ADD CONSTRAINT FK_C4B9089FE9ED820C FOREIGN KEY (block_id) REFERENCES bitbag_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_page ADD CONSTRAINT FK_18F07F1BF56F16CF FOREIGN KEY (teaser_image_id) REFERENCES bitbag_cms_media (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE bitbag_cms_block_locales ADD CONSTRAINT FK_E1F907BAE559DFD1 FOREIGN KEY (locale_id) REFERENCES sylius_locale (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_block_locales ADD CONSTRAINT FK_E1F907BAE9ED820C FOREIGN KEY (block_id) REFERENCES bitbag_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_section_media ADD CONSTRAINT FK_833A6197D823E37A FOREIGN KEY (section_id) REFERENCES bitbag_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_section_media ADD CONSTRAINT FK_833A6197EA9FDD75 FOREIGN KEY (media_id) REFERENCES bitbag_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_content_configuration ADD CONSTRAINT FK_D899EFA7E9ED820C FOREIGN KEY (block_id) REFERENCES bitbag_cms_block (id)'); + $this->addSql('ALTER TABLE bitbag_cms_content_configuration ADD CONSTRAINT FK_D899EFA7C4663E4 FOREIGN KEY (page_id) REFERENCES bitbag_cms_page (id)'); + $this->addSql('ALTER TABLE bitbag_cms_media_channels ADD CONSTRAINT FK_D109622E72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_media_channels ADD CONSTRAINT FK_D109622EEA9FDD75 FOREIGN KEY (media_id) REFERENCES bitbag_cms_media (id) ON DELETE CASCADE'); + + $this->addSql('CREATE TABLE bitbag_cms_faq_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, question LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, answer LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, locale VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, INDEX IDX_8B30DD2E2C2AC5D3 (translatable_id), UNIQUE INDEX bitbag_cms_faq_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); + $this->addSql('CREATE TABLE bitbag_cms_media_products (media_id INT NOT NULL, product_id INT NOT NULL, INDEX IDX_91A7DAC2EA9FDD75 (media_id), INDEX IDX_91A7DAC24584665A (product_id), PRIMARY KEY(media_id, product_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); + $this->addSql('CREATE TABLE bitbag_cms_faq (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, position INT NOT NULL, enabled TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); + $this->addSql('CREATE TABLE bitbag_cms_faq_channels (faq_id INT NOT NULL, channel_id INT NOT NULL, INDEX IDX_FF6D59AC81BEC8C2 (faq_id), INDEX IDX_FF6D59AC72F5A1AA (channel_id), PRIMARY KEY(faq_id, channel_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); + + $this->addSql('ALTER TABLE bitbag_cms_faq_translation ADD CONSTRAINT FK_8B30DD2E2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES bitbag_cms_faq (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_media_products ADD CONSTRAINT FK_91A7DAC24584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_media_products ADD CONSTRAINT FK_91A7DAC2EA9FDD75 FOREIGN KEY (media_id) REFERENCES bitbag_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_faq_channels ADD CONSTRAINT FK_FF6D59AC72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE bitbag_cms_faq_channels ADD CONSTRAINT FK_FF6D59AC81BEC8C2 FOREIGN KEY (faq_id) REFERENCES bitbag_cms_faq (id) ON DELETE CASCADE'); + } +} diff --git a/src/Migrations/Version20240903103926.php b/src/Migrations/Version20240903103926.php new file mode 100644 index 000000000..5b466df32 --- /dev/null +++ b/src/Migrations/Version20240903103926.php @@ -0,0 +1,252 @@ +addSql('DROP INDEX uniq_321c84cf77153098 ON sylius_cms_block'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_9D2248BC77153098 ON sylius_cms_block (code)'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602F72F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602FE9ED820C'); + $this->addSql('DROP INDEX idx_8417b073e9ed820c ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_7026602FE9ED820C ON sylius_cms_block_channels (block_id)'); + $this->addSql('DROP INDEX idx_8417b07372f5a1aa ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_7026602F72F5A1AA ON sylius_cms_block_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602FE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE559DFD1'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE9ED820C'); + $this->addSql('DROP INDEX idx_e1f907bae9ed820c ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_49C0AACE9ED820C ON sylius_cms_block_locales (block_id)'); + $this->addSql('DROP INDEX idx_e1f907bae559dfd1 ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_49C0AACE559DFD1 ON sylius_cms_block_locales (locale_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE559DFD1 FOREIGN KEY (locale_id) REFERENCES sylius_locale (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C3E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C34584665A'); + $this->addSql('DROP INDEX idx_c4b9089fe9ed820c ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_3088D8C3E9ED820C ON sylius_cms_block_products (block_id)'); + $this->addSql('DROP INDEX idx_c4b9089f4584665a ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_3088D8C34584665A ON sylius_cms_block_products (product_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C3E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C34584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03DE13F470'); + $this->addSql('DROP INDEX idx_e324c6cee9ed820c ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_5397DD03E9ED820C ON sylius_cms_block_taxons (block_id)'); + $this->addSql('DROP INDEX idx_e324c6cede13f470 ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_5397DD03DE13F470 ON sylius_cms_block_taxons (taxon_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03DE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEDE13F470'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEE9ED820C'); + $this->addSql('DROP INDEX idx_daa9dd18e9ed820c ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_B4D0B7CEE9ED820C ON sylius_cms_block_products_in_taxons (block_id)'); + $this->addSql('DROP INDEX idx_daa9dd18de13f470 ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_B4D0B7CEDE13F470 ON sylius_cms_block_products_in_taxons (taxon_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEDE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DC4663E4'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DE9ED820C'); + $this->addSql('DROP INDEX idx_d899efa7e9ed820c ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_BB97608DE9ED820C ON sylius_cms_content_configuration (block_id)'); + $this->addSql('DROP INDEX idx_d899efa7c4663e4 ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_BB97608DC4663E4 ON sylius_cms_content_configuration (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id)'); + $this->addSql('DROP INDEX uniq_db2bb2e177153098 ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_74157E9277153098 ON sylius_cms_media (code)'); + $this->addSql('DROP INDEX uniq_db2bb2e1b548b0f ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_74157E92B548B0F ON sylius_cms_media (path)'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B27272F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B272EA9FDD75'); + $this->addSql('DROP INDEX idx_d109622eea9fdd75 ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_2538B272EA9FDD75 ON sylius_cms_media_channels (media_id)'); + $this->addSql('DROP INDEX idx_d109622e72f5a1aa ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_2538B27272F5A1AA ON sylius_cms_media_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B27272F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B272EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_translation DROP FOREIGN KEY FK_AAAC4A922C2AC5D3'); + $this->addSql('DROP INDEX idx_1fec58972c2ac5d3 ON sylius_cms_media_translation'); + $this->addSql('CREATE INDEX IDX_AAAC4A922C2AC5D3 ON sylius_cms_media_translation (translatable_id)'); + $this->addSql('DROP INDEX bitbag_cms_media_translation_uniq_trans ON sylius_cms_media_translation'); + $this->addSql('CREATE UNIQUE INDEX sylius_cms_media_translation_uniq_trans ON sylius_cms_media_translation (translatable_id, locale)'); + $this->addSql('ALTER TABLE sylius_cms_media_translation ADD CONSTRAINT FK_AAAC4A922C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page DROP FOREIGN KEY FK_2C2740B2F56F16CF'); + $this->addSql('DROP INDEX uniq_18f07f1b77153098 ON sylius_cms_page'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_2C2740B277153098 ON sylius_cms_page (code)'); + $this->addSql('DROP INDEX idx_18f07f1bf56f16cf ON sylius_cms_page'); + $this->addSql('CREATE INDEX IDX_2C2740B2F56F16CF ON sylius_cms_page (teaser_image_id)'); + $this->addSql('ALTER TABLE sylius_cms_page ADD CONSTRAINT FK_2C2740B2F56F16CF FOREIGN KEY (teaser_image_id) REFERENCES sylius_cms_media (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7F72F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7FC4663E4'); + $this->addSql('DROP INDEX idx_dca4269c4663e4 ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_E8AF4F7FC4663E4 ON sylius_cms_page_channels (page_id)'); + $this->addSql('DROP INDEX idx_dca426972f5a1aa ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_E8AF4F7F72F5A1AA ON sylius_cms_page_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7FC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_translation DROP FOREIGN KEY FK_6D0D401B2C2AC5D3'); + $this->addSql('DROP INDEX idx_fdd074a62c2ac5d3 ON sylius_cms_page_translation'); + $this->addSql('CREATE INDEX IDX_6D0D401B2C2AC5D3 ON sylius_cms_page_translation (translatable_id)'); + $this->addSql('DROP INDEX bitbag_cms_page_translation_uniq_trans ON sylius_cms_page_translation'); + $this->addSql('CREATE UNIQUE INDEX sylius_cms_page_translation_uniq_trans ON sylius_cms_page_translation (translatable_id, locale)'); + $this->addSql('ALTER TABLE sylius_cms_page_translation ADD CONSTRAINT FK_6D0D401B2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('DROP INDEX uniq_421d079777153098 ON sylius_cms_section'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_D4DD0C0777153098 ON sylius_cms_section (code)'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8C4663E4'); + $this->addSql('DROP INDEX idx_c96225eed823e37a ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_2C0728F8D823E37A ON sylius_cms_section_pages (section_id)'); + $this->addSql('DROP INDEX idx_c96225eec4663e4 ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_2C0728F8C4663E4 ON sylius_cms_section_pages (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8C4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928E9ED820C'); + $this->addSql('DROP INDEX idx_a9d9c974d823e37a ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_5DE81928D823E37A ON sylius_cms_section_blocks (section_id)'); + $this->addSql('DROP INDEX idx_a9d9c974e9ed820c ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_5DE81928E9ED820C ON sylius_cms_section_blocks (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81EA9FDD75'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81D823E37A'); + $this->addSql('DROP INDEX idx_833a6197d823e37a ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_665F6C81D823E37A ON sylius_cms_section_media (section_id)'); + $this->addSql('DROP INDEX idx_833a6197ea9fdd75 ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_665F6C81EA9FDD75 ON sylius_cms_section_media (media_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEDE13F470'); + $this->addSql('DROP INDEX idx_b4d0b7cee9ed820c ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_DAA9DD18E9ED820C ON sylius_cms_block_products_in_taxons (block_id)'); + $this->addSql('DROP INDEX idx_b4d0b7cede13f470 ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_DAA9DD18DE13F470 ON sylius_cms_block_products_in_taxons (taxon_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEDE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B272EA9FDD75'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B27272F5A1AA'); + $this->addSql('DROP INDEX idx_2538b27272f5a1aa ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_D109622E72F5A1AA ON sylius_cms_media_channels (channel_id)'); + $this->addSql('DROP INDEX idx_2538b272ea9fdd75 ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_D109622EEA9FDD75 ON sylius_cms_media_channels (media_id)'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B272EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B27272F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8C4663E4'); + $this->addSql('DROP INDEX idx_2c0728f8d823e37a ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_C96225EED823E37A ON sylius_cms_section_pages (section_id)'); + $this->addSql('DROP INDEX idx_2c0728f8c4663e4 ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_C96225EEC4663E4 ON sylius_cms_section_pages (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8C4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('DROP INDEX uniq_74157e9277153098 ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_DB2BB2E177153098 ON sylius_cms_media (code)'); + $this->addSql('DROP INDEX uniq_74157e92b548b0f ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_DB2BB2E1B548B0F ON sylius_cms_media (path)'); + $this->addSql('ALTER TABLE sylius_cms_page DROP FOREIGN KEY FK_2C2740B2F56F16CF'); + $this->addSql('DROP INDEX idx_2c2740b2f56f16cf ON sylius_cms_page'); + $this->addSql('CREATE INDEX IDX_18F07F1BF56F16CF ON sylius_cms_page (teaser_image_id)'); + $this->addSql('DROP INDEX uniq_2c2740b277153098 ON sylius_cms_page'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_18F07F1B77153098 ON sylius_cms_page (code)'); + $this->addSql('ALTER TABLE sylius_cms_page ADD CONSTRAINT FK_2C2740B2F56F16CF FOREIGN KEY (teaser_image_id) REFERENCES sylius_cms_media (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602FE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602F72F5A1AA'); + $this->addSql('DROP INDEX idx_7026602f72f5a1aa ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_8417B07372F5A1AA ON sylius_cms_block_channels (channel_id)'); + $this->addSql('DROP INDEX idx_7026602fe9ed820c ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_8417B073E9ED820C ON sylius_cms_block_channels (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602FE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C3E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C34584665A'); + $this->addSql('DROP INDEX idx_3088d8c3e9ed820c ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_C4B9089FE9ED820C ON sylius_cms_block_products (block_id)'); + $this->addSql('DROP INDEX idx_3088d8c34584665a ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_C4B9089F4584665A ON sylius_cms_block_products (product_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C3E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C34584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE559DFD1'); + $this->addSql('DROP INDEX idx_49c0aace9ed820c ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_E1F907BAE9ED820C ON sylius_cms_block_locales (block_id)'); + $this->addSql('DROP INDEX idx_49c0aace559dfd1 ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_E1F907BAE559DFD1 ON sylius_cms_block_locales (locale_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE559DFD1 FOREIGN KEY (locale_id) REFERENCES sylius_locale (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_translation DROP FOREIGN KEY FK_AAAC4A922C2AC5D3'); + $this->addSql('DROP INDEX idx_aaac4a922c2ac5d3 ON sylius_cms_media_translation'); + $this->addSql('CREATE INDEX IDX_1FEC58972C2AC5D3 ON sylius_cms_media_translation (translatable_id)'); + $this->addSql('DROP INDEX sylius_cms_media_translation_uniq_trans ON sylius_cms_media_translation'); + $this->addSql('CREATE UNIQUE INDEX bitbag_cms_media_translation_uniq_trans ON sylius_cms_media_translation (translatable_id, locale)'); + $this->addSql('ALTER TABLE sylius_cms_media_translation ADD CONSTRAINT FK_AAAC4A922C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7FC4663E4'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7F72F5A1AA'); + $this->addSql('DROP INDEX idx_e8af4f7fc4663e4 ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_DCA4269C4663E4 ON sylius_cms_page_channels (page_id)'); + $this->addSql('DROP INDEX idx_e8af4f7f72f5a1aa ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_DCA426972F5A1AA ON sylius_cms_page_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7FC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DC4663E4'); + $this->addSql('DROP INDEX idx_bb97608de9ed820c ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_D899EFA7E9ED820C ON sylius_cms_content_configuration (block_id)'); + $this->addSql('DROP INDEX idx_bb97608dc4663e4 ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_D899EFA7C4663E4 ON sylius_cms_content_configuration (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id)'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81EA9FDD75'); + $this->addSql('DROP INDEX idx_665f6c81ea9fdd75 ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_833A6197EA9FDD75 ON sylius_cms_section_media (media_id)'); + $this->addSql('DROP INDEX idx_665f6c81d823e37a ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_833A6197D823E37A ON sylius_cms_section_media (section_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928E9ED820C'); + $this->addSql('DROP INDEX idx_5de81928d823e37a ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_A9D9C974D823E37A ON sylius_cms_section_blocks (section_id)'); + $this->addSql('DROP INDEX idx_5de81928e9ed820c ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_A9D9C974E9ED820C ON sylius_cms_section_blocks (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_translation DROP FOREIGN KEY FK_6D0D401B2C2AC5D3'); + $this->addSql('DROP INDEX sylius_cms_page_translation_uniq_trans ON sylius_cms_page_translation'); + $this->addSql('CREATE UNIQUE INDEX bitbag_cms_page_translation_uniq_trans ON sylius_cms_page_translation (translatable_id, locale)'); + $this->addSql('DROP INDEX idx_6d0d401b2c2ac5d3 ON sylius_cms_page_translation'); + $this->addSql('CREATE INDEX IDX_FDD074A62C2AC5D3 ON sylius_cms_page_translation (translatable_id)'); + $this->addSql('ALTER TABLE sylius_cms_page_translation ADD CONSTRAINT FK_6D0D401B2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('DROP INDEX uniq_d4dd0c0777153098 ON sylius_cms_section'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_421D079777153098 ON sylius_cms_section (code)'); + $this->addSql('DROP INDEX uniq_9d2248bc77153098 ON sylius_cms_block'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_321C84CF77153098 ON sylius_cms_block (code)'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03DE13F470'); + $this->addSql('DROP INDEX idx_5397dd03de13f470 ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_E324C6CEDE13F470 ON sylius_cms_block_taxons (taxon_id)'); + $this->addSql('DROP INDEX idx_5397dd03e9ed820c ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_E324C6CEE9ED820C ON sylius_cms_block_taxons (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03DE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + } +} diff --git a/src/Processor/ImportProcessor.php b/src/Processor/ImportProcessor.php index 64792f732..f06277dab 100644 --- a/src/Processor/ImportProcessor.php +++ b/src/Processor/ImportProcessor.php @@ -1,19 +1,13 @@ twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_heading.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_heading.html.twig', 'heading_type' => $headingType, 'heading_content' => $headingContent, ]); diff --git a/src/Renderer/ContentElement/MultipleMediaContentElementRenderer.php b/src/Renderer/ContentElement/MultipleMediaContentElementRenderer.php index 821d937b4..f12a6783c 100644 --- a/src/Renderer/ContentElement/MultipleMediaContentElementRenderer.php +++ b/src/Renderer/ContentElement/MultipleMediaContentElementRenderer.php @@ -1,20 +1,14 @@ twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_multiple_media.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_multiple_media.html.twig', 'media' => $media, ]); } diff --git a/src/Renderer/ContentElement/PagesCollectionContentElementRenderer.php b/src/Renderer/ContentElement/PagesCollectionContentElementRenderer.php index 543d18d0a..66536d8d5 100644 --- a/src/Renderer/ContentElement/PagesCollectionContentElementRenderer.php +++ b/src/Renderer/ContentElement/PagesCollectionContentElementRenderer.php @@ -1,19 +1,13 @@ collectionRepository->findOneBy(['code' => $code]); - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_pages_collection.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_pages_collection.html.twig', 'collection' => $collection?->getPages(), ]); } diff --git a/src/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRenderer.php b/src/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRenderer.php index 14a47edb0..3daf20331 100644 --- a/src/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRenderer.php +++ b/src/Renderer/ContentElement/ProductsCarouselByTaxonContentElementRenderer.php @@ -1,17 +1,11 @@ productRepository->findByTaxon($taxon); - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', 'products' => $products, ]); } diff --git a/src/Renderer/ContentElement/ProductsCarouselContentElementRenderer.php b/src/Renderer/ContentElement/ProductsCarouselContentElementRenderer.php index 180290e98..3baa20347 100644 --- a/src/Renderer/ContentElement/ProductsCarouselContentElementRenderer.php +++ b/src/Renderer/ContentElement/ProductsCarouselContentElementRenderer.php @@ -1,17 +1,11 @@ twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_carousel.html.twig', 'products' => $products, ]); } diff --git a/src/Renderer/ContentElement/ProductsGridByTaxonContentElementRenderer.php b/src/Renderer/ContentElement/ProductsGridByTaxonContentElementRenderer.php index c704ae08a..c678d28fe 100644 --- a/src/Renderer/ContentElement/ProductsGridByTaxonContentElementRenderer.php +++ b/src/Renderer/ContentElement/ProductsGridByTaxonContentElementRenderer.php @@ -1,17 +1,11 @@ productRepository->findByTaxon($taxon); - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', 'products' => $products, ]); } diff --git a/src/Renderer/ContentElement/ProductsGridContentElementRenderer.php b/src/Renderer/ContentElement/ProductsGridContentElementRenderer.php index 1b24a451f..740266177 100644 --- a/src/Renderer/ContentElement/ProductsGridContentElementRenderer.php +++ b/src/Renderer/ContentElement/ProductsGridContentElementRenderer.php @@ -1,17 +1,11 @@ productRepository->findBy(['code' => $productsCodes]); - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_products_grid.html.twig', 'products' => $products, ]); } diff --git a/src/Renderer/ContentElement/SingleMediaContentElementRenderer.php b/src/Renderer/ContentElement/SingleMediaContentElementRenderer.php index 348b705ed..14cac90d4 100644 --- a/src/Renderer/ContentElement/SingleMediaContentElementRenderer.php +++ b/src/Renderer/ContentElement/SingleMediaContentElementRenderer.php @@ -1,19 +1,13 @@ $this->mediaRepository->findOneBy(['code' => $code]), ]; - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_single_media.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_single_media.html.twig', 'media' => $media, ]); } diff --git a/src/Renderer/ContentElement/SpacerContentElementRenderer.php b/src/Renderer/ContentElement/SpacerContentElementRenderer.php index ed52840a3..1988ac319 100644 --- a/src/Renderer/ContentElement/SpacerContentElementRenderer.php +++ b/src/Renderer/ContentElement/SpacerContentElementRenderer.php @@ -1,17 +1,11 @@ getConfiguration()['spacer']; - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_spacer.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_spacer.html.twig', 'spacer_height' => $configuration, ]); } diff --git a/src/Renderer/ContentElement/TaxonsListContentElementRenderer.php b/src/Renderer/ContentElement/TaxonsListContentElementRenderer.php index de28c149a..c3e93ef2e 100644 --- a/src/Renderer/ContentElement/TaxonsListContentElementRenderer.php +++ b/src/Renderer/ContentElement/TaxonsListContentElementRenderer.php @@ -1,17 +1,11 @@ taxonRepository->findBy(['code' => $taxonsCodes]); - return $this->twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_taxons_list.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_taxons_list.html.twig', 'taxons' => $taxons, ]); } diff --git a/src/Renderer/ContentElement/TextareaContentElementRenderer.php b/src/Renderer/ContentElement/TextareaContentElementRenderer.php index 46674d8ec..2d0904526 100644 --- a/src/Renderer/ContentElement/TextareaContentElementRenderer.php +++ b/src/Renderer/ContentElement/TextareaContentElementRenderer.php @@ -1,17 +1,11 @@ twig->render('@BitBagSyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ - 'content_element' => '@BitBagSyliusCmsPlugin/Shop/ContentElement/_textarea.html.twig', + return $this->twig->render('@SyliusCmsPlugin/Shop/ContentElement/index.html.twig', [ + 'content_element' => '@SyliusCmsPlugin/Shop/ContentElement/_textarea.html.twig', 'content' => $contentConfiguration->getConfiguration()['textarea'], ]); } diff --git a/src/Renderer/ContentElementRendererStrategy.php b/src/Renderer/ContentElementRendererStrategy.php index 7dd645e35..2e45094e4 100644 --- a/src/Renderer/ContentElementRendererStrategy.php +++ b/src/Renderer/ContentElementRendererStrategy.php @@ -1,19 +1,13 @@ $this->urlGenerator->generate( - 'bitbag_sylius_cms_plugin_shop_page_show', + 'sylius_cms_shop_page_show', ['slug' => $page->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL, ), diff --git a/src/Renderer/PageLinkRendererInterface.php b/src/Renderer/PageLinkRendererInterface.php index a7a80001b..ed9c23385 100644 --- a/src/Renderer/PageLinkRendererInterface.php +++ b/src/Renderer/PageLinkRendererInterface.php @@ -1,16 +1,10 @@ { - const typeField = document.getElementById('bitbag_sylius_cms_plugin_collection_type'); + const typeField = document.getElementById('sylius_cms_collection_type'); const fields = { page: document.getElementById('collection-type-pages'), block: document.getElementById('collection-type-blocks'), diff --git a/src/Resources/assets/admin/js/bitbag/bitbag-content-configuration.js b/src/Resources/assets/admin/js/cms/cms-content-configuration.js similarity index 83% rename from src/Resources/assets/admin/js/bitbag/bitbag-content-configuration.js rename to src/Resources/assets/admin/js/cms/cms-content-configuration.js index 4e5739019..2544ba606 100644 --- a/src/Resources/assets/admin/js/bitbag/bitbag-content-configuration.js +++ b/src/Resources/assets/admin/js/cms/cms-content-configuration.js @@ -1,11 +1,5 @@ -/* - * This file was created by developers working at BitBag - * Do you need more information about us and what we do? Visit our https://bitbag.io website! - * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - $(document).ready(function() { - $('.bitbag-media-autocomplete, .sylius-autocomplete').each((index, element) => { + $('.cms-media-autocomplete, .sylius-autocomplete').each((index, element) => { $(element).autoComplete(); }); @@ -25,12 +19,12 @@ $(document).ready(function() { extraPlugins: ["mediaVideo", "mediaImage"], removePlugins: ["exportpdf"], filebrowserUploadUrl: "/admin/editor/upload-image", - bodyId: "bitbag-ckeditor", + bodyId: "cms-ckeditor", language: "en-us" }; - let pageElements = '#bitbag_sylius_cms_plugin_page_contentElements'; - let blockElements = '#bitbag_sylius_cms_plugin_block_contentElements'; + let pageElements = '#sylius_cms_page_contentElements'; + let blockElements = '#sylius_cms_block_contentElements'; let collectionHolder = $(pageElements).length ? pageElements : blockElements; let itemElement = document.querySelector(`${collectionHolder} [data-form-collection="item"]`); @@ -38,19 +32,16 @@ $(document).ready(function() { if (!$(collectionHolder).length) { return; } - $(document).on('collection-form-add', () => { - $('.bitbag-media-autocomplete, .sylius-autocomplete').each((index, element) => { + $('.cms-media-autocomplete, .sylius-autocomplete').each((index, element) => { if ($._data($(element).get(0), 'events') === undefined) { $(element).autoComplete(); } }); - $(`${collectionHolder} [data-form-collection="item"]`).each((index, element) => { $(document).loadContentConfiguration(element); }); }); - $.fn.extend({ loadContentConfiguration(target) { target.querySelector(`${collectionHolder} select[name*="type"]`).onchange = function () { @@ -58,36 +49,28 @@ $(document).ready(function() { const newConfig = document.createElement('div'); const selectedOption = this.selectedOptions[0]; newConfig.innerHTML = selectedOption.getAttribute('data-configuration'); - const oldConfig = parent.nextElementSibling; - parent.parentElement.replaceChild(newConfig, oldConfig); - let oldConfigInput = oldConfig.querySelector('input'); if (!oldConfigInput) { oldConfigInput = oldConfig.querySelector('textarea'); } - const oldConfigInputName = oldConfigInput.getAttribute('name'); - let newConfigInputs = newConfig.querySelectorAll('input'); if (!newConfigInputs.length) { newConfigInputs = newConfig.querySelectorAll('textarea'); } - newConfigInputs.forEach(element => { let newConfigInputName = element.getAttribute('name'); if (!newConfigInputName) { return; } - newConfigInputName = oldConfigInputName.replace( oldConfigInputName.substring(oldConfigInputName.indexOf('[configuration]') + 15), newConfigInputName.substring(newConfigInputName.indexOf('configuration') + 13), ); - $(element).attr('name', newConfigInputName); - $(newConfig).find('.bitbag-media-autocomplete').autoComplete(); + $(newConfig).find('.cms-media-autocomplete').autoComplete(); $(newConfig).find('.sylius-autocomplete').autoComplete(); if (this.value === 'textarea') { @@ -101,7 +84,6 @@ $(document).ready(function() { } } }); - $(`${collectionHolder} [data-form-collection="item"]`).each((index, element) => { $(document).loadContentConfiguration(element); }); diff --git a/src/Resources/assets/admin/js/bitbag/bitbag-media-autocomplete.js b/src/Resources/assets/admin/js/cms/cms-media-autocomplete.js similarity index 92% rename from src/Resources/assets/admin/js/bitbag/bitbag-media-autocomplete.js rename to src/Resources/assets/admin/js/cms/cms-media-autocomplete.js index d132c78b3..d2750e75f 100644 --- a/src/Resources/assets/admin/js/bitbag/bitbag-media-autocomplete.js +++ b/src/Resources/assets/admin/js/cms/cms-media-autocomplete.js @@ -1,8 +1,3 @@ -/* - This file was created by developers working at BitBag - Do you need more information about us and what we do? Visit our https://bitbag.io website! - We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ import triggerCustomEvent from '../../../common/js/utilities/triggerCustomEvent'; export class HandleAutoComplete { @@ -33,7 +28,7 @@ export class HandleAutoComplete { init() { if (typeof this.config !== 'object') { - throw new Error('Bitbag CMS Plugin - HandleAutoComplete class config is not a valid object'); + throw new Error('Sylius CMS Plugin - HandleAutoComplete class config is not a valid object'); } this.mediaContainers.forEach((mediaContainer) => { this._handleSavedValue(mediaContainer); @@ -113,7 +108,7 @@ export class HandleAutoComplete { triggerCustomEvent(mediaContainer, 'cms.media.saved.reload.completed', data); } catch (error) { - console.error(`BitBag CMS Plugin - HandleAutoComplete class error : ${error}`); + console.error(`Sylius CMS Plugin - HandleAutoComplete class error : ${error}`); triggerCustomEvent(mediaContainer, 'cms.media.saved.reload.error', error); } finally { mediaContainer.classList.remove('loading'); @@ -139,7 +134,7 @@ export class HandleAutoComplete { triggerCustomEvent(mediaContainer, 'cms.media.display.completed', data); } catch (error) { - console.error(`BitBag CMS Plugin - HandleAutoComplete class error : ${error}`); + console.error(`Sylius CMS Plugin - HandleAutoComplete class error : ${error}`); triggerCustomEvent(mediaContainer, 'cms.media.display.error', error); } finally { mediaContainer.classList.remove('loading'); diff --git a/src/Resources/assets/admin/js/bitbag/bitbag-page-slug.js b/src/Resources/assets/admin/js/cms/cms-page-slug.js similarity index 81% rename from src/Resources/assets/admin/js/bitbag/bitbag-page-slug.js rename to src/Resources/assets/admin/js/cms/cms-page-slug.js index bd146b03a..e27df10c4 100644 --- a/src/Resources/assets/admin/js/bitbag/bitbag-page-slug.js +++ b/src/Resources/assets/admin/js/cms/cms-page-slug.js @@ -1,9 +1,3 @@ -/* - This file was created by developers working at BitBag - Do you need more information about us and what we do? Visit our https://bitbag.io website! - We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - import triggerCustomEvent from '../../../common/js/utilities/triggerCustomEvent'; export class HandleSlugUpdate { @@ -11,8 +5,8 @@ export class HandleSlugUpdate { config = { wrappersIndicator: 'data-bb-cms-wrapper', lockFieldIndicator: 'data-bb-cms-toggle-slug', - bbTarget: 'bitbag_sylius_cms_plugin_page', - nameField: 'bitbag_sylius_cms_plugin_page_name', + bbTarget: 'sylius_cms_page', + nameField: 'sylius_cms_page_name', } ) { this.wrappers = document.querySelectorAll(`[${config.wrappersIndicator}]`); @@ -24,15 +18,15 @@ export class HandleSlugUpdate { init() { if (typeof this.config !== 'object') { - throw new Error('Bitbag CMS Plugin - HandleSlugUpdate class config is not a valid object'); + throw new Error('Sylius CMS Plugin - HandleSlugUpdate class config is not a valid object'); } if (typeof this.lockFieldIndicator !== 'string' || typeof this.bbTarget !== 'string') { - throw new Error('Bitbag CMS Plugin - HandleSlugUpdate class config key values are not valid strings'); + throw new Error('Sylius CMS Plugin - HandleSlugUpdate class config key values are not valid strings'); } if (!this.nameField ) { - throw new Error('Bitbag CMS Plugin - HandleSlugUpdate name field not found'); + throw new Error('Sylius CMS Plugin - HandleSlugUpdate name field not found'); } this._handleFields(); @@ -90,7 +84,7 @@ export class HandleSlugUpdate { const response = await request.json(); return response.slug; } catch (error) { - console.error(`BitBag CMS Plugin - HandleSlugUpdate class error : ${error}`); + console.error(`Sylius CMS Plugin - HandleSlugUpdate class error : ${error}`); } } diff --git a/src/Resources/assets/admin/js/bitbag/bitbag-cms-preview.js b/src/Resources/assets/admin/js/cms/cms-preview.js similarity index 87% rename from src/Resources/assets/admin/js/bitbag/bitbag-cms-preview.js rename to src/Resources/assets/admin/js/cms/cms-preview.js index e589b5a9b..9104531f3 100644 --- a/src/Resources/assets/admin/js/bitbag/bitbag-cms-preview.js +++ b/src/Resources/assets/admin/js/cms/cms-preview.js @@ -1,9 +1,3 @@ -/* - This file was created by developers working at BitBag - Do you need more information about us and what we do? Visit our https://bitbag.io website! - We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - import triggerCustomEvent from '../../../common/js/utilities/triggerCustomEvent'; export class HandlePreview { @@ -24,14 +18,14 @@ export class HandlePreview { } init() { if (typeof this.config !== 'object') { - throw new Error('Bitbag CMS Plugin - HandlePreview class config is not a valid object'); + throw new Error('Sylius CMS Plugin - HandlePreview class config is not a valid object'); } if ( typeof this.localeSelector !== 'string' || typeof this.channelSelector !== 'string' || typeof this.modalSelector !== 'string' ) { - throw new Error('Bitbag CMS Plugin - HandlePreview class config key values are not valid strings'); + throw new Error('Sylius CMS Plugin - HandlePreview class config key values are not valid strings'); } this._resourcePreview(); } @@ -94,7 +88,7 @@ export class HandlePreview { this.modal.querySelector('iframe').src = blobUrl; triggerCustomEvent(this.modal, 'cms.create.preview.completed', res); } catch (error) { - console.error(`BitBag CMS Plugin - HandlePreview class error : ${error}`); + console.error(`Sylius CMS Plugin - HandlePreview class error : ${error}`); triggerCustomEvent(this.modal, 'cms.create.preview.error', error); } finally { this.modal.querySelector('.ui.loadable').classList.remove('loading'); diff --git a/src/Resources/assets/admin/js/bitbag/bitbag-template.js b/src/Resources/assets/admin/js/cms/cms-template.js similarity index 66% rename from src/Resources/assets/admin/js/bitbag/bitbag-template.js rename to src/Resources/assets/admin/js/cms/cms-template.js index 6ca7984b3..0248477f3 100644 --- a/src/Resources/assets/admin/js/bitbag/bitbag-template.js +++ b/src/Resources/assets/admin/js/cms/cms-template.js @@ -1,15 +1,9 @@ -/* - * This file was created by developers working at BitBag - * Do you need more information about us and what we do? Visit our https://bitbag.io website! - * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - export class HandleTemplate { init() { $(document).ready(() => { const cmsLoadTemplate = $('[data-bb-cms-load-template]'); - const cmsPageTemplate = $('#bitbag_sylius_cms_plugin_page_template'); - const cmsBlockTemplate = $('#bitbag_sylius_cms_plugin_block_template'); + const cmsPageTemplate = $('#sylius_cms_page_template'); + const cmsBlockTemplate = $('#sylius_cms_block_template'); cmsLoadTemplate.on('click', function (e) { e.preventDefault(); @@ -37,7 +31,7 @@ export class HandleTemplate { type: 'GET', success: function(data) { if (data.status === 'success') { - $('[id^="bitbag_sylius_cms_plugin_"][id$="contentElements"]') + $('[id^="sylius_cms_"][id$="contentElements"]') .children('[data-form-collection="list"]') .html(''); @@ -45,13 +39,12 @@ export class HandleTemplate { $('[data-form-collection="add"]').trigger('click'); }); - const elements = $('[id^="bitbag_sylius_cms_plugin_"][id*="_contentElements_"][id$="_type"]').filter(function() { - return /_page_|_block_/.test(this.id); - }); - + const elements = $('.bb-collection-item'); $.each(data.content, function (index, element) { - elements.eq(index).val(element.type); - elements.eq(index).change(); + setTimeout(() => { + elements.eq(index).find('select:first').val(element.type); + elements.eq(index).find('select:first').change(); + }, 300); }); } else { console.error(data.message); diff --git a/src/Resources/assets/admin/js/bitbag/bitbag-upload-csv.js b/src/Resources/assets/admin/js/cms/cms-upload-csv.js similarity index 70% rename from src/Resources/assets/admin/js/bitbag/bitbag-upload-csv.js rename to src/Resources/assets/admin/js/cms/cms-upload-csv.js index bf2a9c145..00d4664ac 100644 --- a/src/Resources/assets/admin/js/bitbag/bitbag-upload-csv.js +++ b/src/Resources/assets/admin/js/cms/cms-upload-csv.js @@ -1,9 +1,3 @@ -/* - This file was created by developers working at BitBag - Do you need more information about us and what we do? Visit our https://bitbag.io website! - We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - export class HandleCsvUpload { constructor(config = {textField: 'data-bb-cms-text', fileField: 'data-bb-cms-file'}) { this.config = config; @@ -13,7 +7,7 @@ export class HandleCsvUpload { init() { if (typeof this.config !== 'object') { - throw new Error('Bitbag CMS Plugin - HandleCsvUpload class config is not a valid object'); + throw new Error('Sylius CMS Plugin - HandleCsvUpload class config is not a valid object'); } this._handleFields(); diff --git a/src/Resources/assets/admin/js/cms/index.js b/src/Resources/assets/admin/js/cms/index.js new file mode 100644 index 000000000..5ab24a4ec --- /dev/null +++ b/src/Resources/assets/admin/js/cms/index.js @@ -0,0 +1,7 @@ +import './cms-content-configuration'; +export {HandleCsvUpload} from './cms-upload-csv'; +export {HandleSlugUpdate} from './cms-page-slug'; +export {HandlePreview} from './cms-preview'; +export {HandleAutoComplete} from './cms-media-autocomplete'; +export {HandleChooseCollectionType} from './cms-choose-collection-type'; +export {HandleTemplate} from './cms-template'; diff --git a/src/Resources/assets/admin/js/index.js b/src/Resources/assets/admin/js/index.js index 498e17eca..a3587190b 100644 --- a/src/Resources/assets/admin/js/index.js +++ b/src/Resources/assets/admin/js/index.js @@ -5,7 +5,7 @@ import { HandleAutoComplete, HandleChooseCollectionType, HandleTemplate -} from './bitbag'; +} from './cms'; if (document.querySelector('[data-bb-target="cms-import"]')) { new HandleCsvUpload().init(); diff --git a/src/Resources/assets/admin/scss/_css.scss b/src/Resources/assets/admin/scss/_css.scss index d3c63c491..344383c19 100644 --- a/src/Resources/assets/admin/scss/_css.scss +++ b/src/Resources/assets/admin/scss/_css.scss @@ -1,21 +1,21 @@ -#bitbag-cms-resource-preview-modal { +#cms-resource-preview-modal { height: 100%; } -#bitbag-cms-resource-preview-modal iframe { +#cms-resource-preview-modal iframe { width: 100%; height: 100vh; } -#bitbag-cms-resource-preview-modal .ui.header { +#cms-resource-preview-modal .ui.header { padding-bottom: 0; } -.bitbag-cms-import .ui.action.input input[type='file'] { +.cms-import .ui.action.input input[type='file'] { display: none; } -.bitbag-cms-import .ui.action.input input[type='text'] { +.cms-import .ui.action.input input[type='text'] { width: auto; } @@ -96,11 +96,11 @@ } } -.bitbag-media-autocomplete .dropdown.icon { +.cms-media-autocomplete .dropdown.icon { pointer-events: none; } -.bitbag-media-autocomplete .search { +.cms-media-autocomplete .search { cursor: pointer !important; } diff --git a/src/Resources/assets/shop/scss/block/show.scss b/src/Resources/assets/shop/scss/block/show.scss index 4a687f347..b9487635c 100644 --- a/src/Resources/assets/shop/scss/block/show.scss +++ b/src/Resources/assets/shop/scss/block/show.scss @@ -1,4 +1,4 @@ -.bitbag-block { +.cms-block { margin-bottom: 20px; img { diff --git a/src/Resources/config/api_resources/Block.xml b/src/Resources/config/api_resources/Block.xml index 7e4f23d3d..d1bec15bc 100644 --- a/src/Resources/config/api_resources/Block.xml +++ b/src/Resources/config/api_resources/Block.xml @@ -3,42 +3,52 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd" > - + - shop:cms:read + sylius_cms:block:read:index + sylius_cms:block:read:show - + - shop:cms:write + sylius_cms:block:write sylius - + GET /shop/cms-plugin/blocks + + sylius_cms:block:read:index + - - + GET /shop/cms-plugin/blocks/{id} + + sylius_cms:block:read:show + + + + - - + + + diff --git a/src/Resources/config/api_resources/Collection.xml b/src/Resources/config/api_resources/Collection.xml index 26a3340ff..88986b47f 100644 --- a/src/Resources/config/api_resources/Collection.xml +++ b/src/Resources/config/api_resources/Collection.xml @@ -3,37 +3,47 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd" > - + - shop:cms:read + sylius_cms:collection:read:index + sylius_cms:collection:read:show - + - shop:cms:write + sylius_cms:collection:write sylius - + GET /shop/cms-plugin/collections + + sylius_cms:collection:read:index + - - + GET /shop/cms-plugin/collections/{id} + + sylius_cms:collection:read:show + + + + + diff --git a/src/Resources/config/api_resources/Media.xml b/src/Resources/config/api_resources/Media.xml index 8a53fb1b4..a28b8999d 100644 --- a/src/Resources/config/api_resources/Media.xml +++ b/src/Resources/config/api_resources/Media.xml @@ -3,33 +3,39 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd" > - + - shop:cms:read + sylius_cms:media:read:index + sylius_cms:media:read:show - + - shop:cms:write + sylius_cms:media:write sylius - + GET /shop/cms-plugin/media + + sylius_cms:media:read:index + - - + GET /shop/cms-plugin/media/{id} + + sylius_cms:media:read:show + diff --git a/src/Resources/config/api_resources/Page.xml b/src/Resources/config/api_resources/Page.xml index d08734007..113bd64b4 100644 --- a/src/Resources/config/api_resources/Page.xml +++ b/src/Resources/config/api_resources/Page.xml @@ -3,33 +3,39 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd" > - + - shop:cms:read + sylius_cms:page:read:index + sylius_cms:page:read:show - + - shop:cms:write + sylius_cms:page:write sylius - + GET /shop/cms-plugin/pages + + sylius_cms:page:read:index + - - + GET /shop/cms-plugin/pages/{id} + + sylius_cms:page:read:show + @@ -42,5 +48,6 @@ + diff --git a/src/Resources/config/api_resources/Template.xml b/src/Resources/config/api_resources/Template.xml new file mode 100644 index 000000000..a6e41e630 --- /dev/null +++ b/src/Resources/config/api_resources/Template.xml @@ -0,0 +1,47 @@ + + + + + + sylius_cms:template:read:index + sylius_cms:template:read:show + + + + + + sylius_cms:template:write + + + + sylius + + + + GET + /shop/cms-plugin/templates + + sylius_cms:template:read:index + + + + + + + GET + /shop/cms-plugin/templates/{id} + + sylius_cms:template:read:show + + + + + + + + + + diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index e438cbd5c..ae1c09fc1 100755 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -1,39 +1,38 @@ imports: - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/resources.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/fos_ck_editor/fos_ck_editor.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/services.xml" } + - { resource: "@SyliusCmsPlugin/Resources/config/fos_ck_editor/fos_ck_editor.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/services.xml" } parameters: sylius.sitemap.path: "%kernel.project_dir%/var/sitemap" - bitbag_validation_group: [bitbag] - bitbag_sylius_cms_plugin.form.type.block.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.content_configuration.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.block_image.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.page.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.translation.page.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.collection.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.translation.media.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.media.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.template.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.uploader.filesystem: bitbag_sylius_cms_plugin_media + sylius_validation_group: [cms] + sylius_cms.form.type.block.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.content_configuration.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.block_image.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.page.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.translation.page.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.collection.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.translation.media.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.media.validation_groups: "%sylius_validation_group%" + sylius_cms.form.type.template.validation_groups: "%sylius_validation_group%" + sylius_cms.uploader.filesystem: sylius_cms_media jms_serializer: metadata: directories: - bitbag-section: - namespace_prefix: "BitBag\\SyliusCmsPlugin" - path: "@BitBagSyliusCmsPlugin/Resources/config/serializer" + cms-section: + namespace_prefix: "Sylius\\CmsPlugin" + path: "@SyliusCmsPlugin/Resources/config/serializer" knp_gaufrette: adapters: - bitbag_sylius_cms_plugin_media: + sylius_cms_media: local: directory: "%sylius_core.public_dir%" create: true filesystems: - bitbag_sylius_cms_plugin_media: - adapter: "%bitbag_sylius_cms_plugin.uploader.filesystem%" + sylius_cms_media: + adapter: "%sylius_cms.uploader.filesystem%" liip_imagine: loaders: @@ -47,5 +46,5 @@ sylius_ui: sylius.admin.layout.javascripts: blocks: version_script: - template: "@BitBagSyliusCmsPlugin/Asset/_cmsVersionScript.html.twig" + template: "@SyliusCmsPlugin/Asset/_cmsVersionScript.html.twig" priority: 30 diff --git a/src/Resources/config/doctrine/Block.orm.xml b/src/Resources/config/doctrine/Block.orm.xml index 51f44b567..da1955577 100644 --- a/src/Resources/config/doctrine/Block.orm.xml +++ b/src/Resources/config/doctrine/Block.orm.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + @@ -16,10 +16,10 @@ - + - + @@ -29,7 +29,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -72,7 +72,7 @@ - + diff --git a/src/Resources/config/doctrine/Collection.orm.xml b/src/Resources/config/doctrine/Collection.orm.xml index 27a6f0893..ce82918e4 100644 --- a/src/Resources/config/doctrine/Collection.orm.xml +++ b/src/Resources/config/doctrine/Collection.orm.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + @@ -17,11 +17,11 @@ - + - + @@ -31,8 +31,8 @@ - - + + @@ -45,11 +45,11 @@ - + - + diff --git a/src/Resources/config/doctrine/ContentConfiguration.orm.xml b/src/Resources/config/doctrine/ContentConfiguration.orm.xml index a41d65b0e..a1822195b 100644 --- a/src/Resources/config/doctrine/ContentConfiguration.orm.xml +++ b/src/Resources/config/doctrine/ContentConfiguration.orm.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + @@ -18,11 +18,11 @@ - + - + diff --git a/src/Resources/config/doctrine/Media.orm.xml b/src/Resources/config/doctrine/Media.orm.xml index 6eedcf735..ab603784a 100644 --- a/src/Resources/config/doctrine/Media.orm.xml +++ b/src/Resources/config/doctrine/Media.orm.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + @@ -26,10 +26,10 @@ - + - + @@ -39,7 +39,7 @@ - + diff --git a/src/Resources/config/doctrine/MediaTranslation.orm.xml b/src/Resources/config/doctrine/MediaTranslation.orm.xml index 5d24b667a..a68cb35ac 100644 --- a/src/Resources/config/doctrine/MediaTranslation.orm.xml +++ b/src/Resources/config/doctrine/MediaTranslation.orm.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/src/Resources/config/doctrine/Page.orm.xml b/src/Resources/config/doctrine/Page.orm.xml index 7e26f5826..b0ccdcdcd 100644 --- a/src/Resources/config/doctrine/Page.orm.xml +++ b/src/Resources/config/doctrine/Page.orm.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + @@ -27,10 +27,10 @@ - + - + @@ -40,7 +40,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/src/Resources/config/doctrine/PageTranslation.orm.xml b/src/Resources/config/doctrine/PageTranslation.orm.xml index be6ae7f06..19e229545 100644 --- a/src/Resources/config/doctrine/PageTranslation.orm.xml +++ b/src/Resources/config/doctrine/PageTranslation.orm.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/src/Resources/config/doctrine/Template.orm.xml b/src/Resources/config/doctrine/Template.orm.xml index 12c49b4b9..3804931d1 100644 --- a/src/Resources/config/doctrine/Template.orm.xml +++ b/src/Resources/config/doctrine/Template.orm.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + diff --git a/src/Resources/config/fos_ck_editor/fos_ck_editor.yml b/src/Resources/config/fos_ck_editor/fos_ck_editor.yml index 2ef9a9dbb..e591d057a 100644 --- a/src/Resources/config/fos_ck_editor/fos_ck_editor.yml +++ b/src/Resources/config/fos_ck_editor/fos_ck_editor.yml @@ -1,8 +1,8 @@ fos_ck_editor: - default_config: bitbag_sylius_cms_plugin + default_config: sylius_cms configs: - bitbag_sylius_cms_plugin: - toolbar: bitbag_sylius_cms_plugin + sylius_cms: + toolbar: sylius_cms enterMode: 3 forcePasteAsPlainText: 'allow-word' allowedContent: true @@ -13,14 +13,14 @@ fos_ck_editor: - "exportpdf" plugins: mediaVideo: - path: '/bundles/bitbagsyliuscmsplugin/js/ckeditor-plugins/video/' + path: '/bundles/SyliusCmsPlugin/js/ckeditor-plugins/video/' filename: 'plugin.js' mediaImage: - path: '/bundles/bitbagsyliuscmsplugin/js/ckeditor-plugins/image/' + path: '/bundles/SyliusCmsPlugin/js/ckeditor-plugins/image/' filename: 'plugin.js' toolbars: configs: - bitbag_sylius_cms_plugin: + sylius_cms: - '@standard.clipboard' - '@standard.editing' - '@standard.links' diff --git a/src/Resources/config/grids.yml b/src/Resources/config/grids.yml index 3e22d5a0e..3bdbb63fa 100755 --- a/src/Resources/config/grids.yml +++ b/src/Resources/config/grids.yml @@ -1,8 +1,8 @@ imports: - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/shop.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/admin.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/shop.yml" } sylius_grid: templates: action: - import: "@BitBagSyliusCmsPlugin/Grid/Action/import.html.twig" + import: "@SyliusCmsPlugin/Grid/Action/import.html.twig" diff --git a/src/Resources/config/grids/admin.yml b/src/Resources/config/grids/admin.yml index 1ba6d4ad0..cbbed98f5 100755 --- a/src/Resources/config/grids/admin.yml +++ b/src/Resources/config/grids/admin.yml @@ -1,6 +1,6 @@ imports: - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/block.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/page.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/collection.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/media.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/template.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/admin/block.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/admin/page.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/admin/collection.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/admin/media.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/admin/template.yml" } diff --git a/src/Resources/config/grids/admin/block.yml b/src/Resources/config/grids/admin/block.yml index 45f423591..d6c7902fa 100755 --- a/src/Resources/config/grids/admin/block.yml +++ b/src/Resources/config/grids/admin/block.yml @@ -1,21 +1,21 @@ sylius_grid: grids: - bitbag_sylius_cms_plugin_admin_block: + sylius_cms_admin_block: driver: name: doctrine/orm options: - class: "%bitbag_sylius_cms_plugin.model.block.class%" + class: "%sylius_cms.model.block.class%" sorting: code: asc limits: [10, 25, 50] fields: name: type: twig - label: bitbag_sylius_cms_plugin.ui.name + label: sylius_cms.ui.name sortable: name path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/name.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/name.html.twig" code: type: string label: sylius.ui.code @@ -29,16 +29,16 @@ sylius_grid: template: "@SyliusUi/Grid/Field/enabled.html.twig" collections: type: twig - label: bitbag_sylius_cms_plugin.ui.collections + label: sylius_cms.ui.collections path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/collections.html.twig" channels: type: twig - label: bitbag_sylius_cms_plugin.ui.channels + label: sylius_cms.ui.channels path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/channels.html.twig" filters: search: type: string diff --git a/src/Resources/config/grids/admin/collection.yml b/src/Resources/config/grids/admin/collection.yml index 5e3282672..0f8492a48 100755 --- a/src/Resources/config/grids/admin/collection.yml +++ b/src/Resources/config/grids/admin/collection.yml @@ -1,28 +1,28 @@ sylius_grid: grids: - bitbag_sylius_cms_plugin_admin_collection: + sylius_cms_admin_collection: driver: name: doctrine/orm options: - class: "%bitbag_sylius_cms_plugin.model.collection.class%" + class: "%sylius_cms.model.collection.class%" sorting: code: asc limits: [10, 25, 50] fields: name: type: twig - label: bitbag_sylius_cms_plugin.ui.name + label: sylius_cms.ui.name sortable: name path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/name.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/name.html.twig" code: type: string - label: bitbag_sylius_cms_plugin.ui.code + label: sylius_cms.ui.code sortable: ~ type: type: string - label: bitbag_sylius_cms_plugin.ui.type + label: sylius_cms.ui.type sortable: ~ filters: search: diff --git a/src/Resources/config/grids/admin/media.yml b/src/Resources/config/grids/admin/media.yml index 81f497047..24de6d2fb 100644 --- a/src/Resources/config/grids/admin/media.yml +++ b/src/Resources/config/grids/admin/media.yml @@ -1,10 +1,10 @@ sylius_grid: grids: - bitbag_sylius_cms_plugin_admin_media: + sylius_cms_admin_media: driver: name: doctrine/orm options: - class: "%bitbag_sylius_cms_plugin.model.media.class%" + class: "%sylius_cms.model.media.class%" repository: method: createListQueryBuilder arguments: ["%locale%"] @@ -14,20 +14,20 @@ sylius_grid: fields: media_file: type: twig - label: bitbag_sylius_cms_plugin.ui.preview + label: sylius_cms.ui.preview path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/image_preview.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/image_preview.html.twig" name: type: twig - label: bitbag_sylius_cms_plugin.ui.name + label: sylius_cms.ui.name sortable: name path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/name.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/name.html.twig" code: type: string - label: bitbag_sylius_cms_plugin.ui.code + label: sylius_cms.ui.code sortable: ~ enabled: type: twig @@ -36,16 +36,16 @@ sylius_grid: template: "@SyliusUi/Grid/Field/enabled.html.twig" collections: type: twig - label: bitbag_sylius_cms_plugin.ui.collections + label: sylius_cms.ui.collections path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/collections.html.twig" channels: type: twig - label: bitbag_sylius_cms_plugin.ui.channels + label: sylius_cms.ui.channels path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/channels.html.twig" filters: search: type: string @@ -57,9 +57,9 @@ sylius_grid: label: sylius.ui.type form_options: choices: - sylius.ui.image: !php/const BitBag\SyliusCmsPlugin\Entity\MediaInterface::IMAGE_TYPE - bitbag_sylius_cms_plugin.ui.file: !php/const BitBag\SyliusCmsPlugin\Entity\MediaInterface::FILE_TYPE - bitbag_sylius_cms_plugin.ui.video: !php/const BitBag\SyliusCmsPlugin\Entity\MediaInterface::VIDEO_TYPE + sylius.ui.image: !php/const Sylius\CmsPlugin\Entity\MediaInterface::IMAGE_TYPE + sylius_cms.ui.file: !php/const Sylius\CmsPlugin\Entity\MediaInterface::FILE_TYPE + sylius_cms.ui.video: !php/const Sylius\CmsPlugin\Entity\MediaInterface::VIDEO_TYPE actions: main: import: diff --git a/src/Resources/config/grids/admin/page.yml b/src/Resources/config/grids/admin/page.yml index 4db7d1c64..fd37aa1ef 100755 --- a/src/Resources/config/grids/admin/page.yml +++ b/src/Resources/config/grids/admin/page.yml @@ -1,24 +1,24 @@ sylius_grid: grids: - bitbag_sylius_cms_plugin_admin_page: + sylius_cms_admin_page: driver: name: doctrine/orm options: - class: "%bitbag_sylius_cms_plugin.model.page.class%" + class: "%sylius_cms.model.page.class%" sorting: code: asc limits: [10, 25, 50] fields: name: type: twig - label: bitbag_sylius_cms_plugin.ui.name + label: sylius_cms.ui.name sortable: name path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/name.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/name.html.twig" code: type: string - label: bitbag_sylius_cms_plugin.ui.code + label: sylius_cms.ui.code sortable: ~ enabled: type: twig @@ -27,16 +27,16 @@ sylius_grid: template: "@SyliusUi/Grid/Field/enabled.html.twig" collections: type: twig - label: bitbag_sylius_cms_plugin.ui.collections + label: sylius_cms.ui.collections path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/collections.html.twig" channels: type: twig - label: bitbag_sylius_cms_plugin.ui.channels + label: sylius_cms.ui.channels path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/channels.html.twig" filters: search: type: string @@ -45,9 +45,9 @@ sylius_grid: fields: [code] collections: type: entity - label: bitbag_sylius_cms_plugin.ui.collections + label: sylius_cms.ui.collections form_options: - class: "%bitbag_sylius_cms_plugin.model.collection.class%" + class: "%sylius_cms.model.collection.class%" choice_label: name choice_value: code options: diff --git a/src/Resources/config/grids/admin/template.yml b/src/Resources/config/grids/admin/template.yml index bb3ae8490..1f82cae0f 100755 --- a/src/Resources/config/grids/admin/template.yml +++ b/src/Resources/config/grids/admin/template.yml @@ -1,21 +1,21 @@ sylius_grid: grids: - bitbag_sylius_cms_plugin_admin_template: + sylius_cms_admin_template: driver: name: doctrine/orm options: - class: "%bitbag_sylius_cms_plugin.model.template.class%" + class: "%sylius_cms.model.template.class%" sorting: name: asc limits: [10, 25, 50] fields: name: type: twig - label: bitbag_sylius_cms_plugin.ui.name + label: sylius_cms.ui.name sortable: name path: . options: - template: "@BitBagSyliusCmsPlugin/Grid/Field/name.html.twig" + template: "@SyliusCmsPlugin/Grid/Field/name.html.twig" type: type: string label: sylius.ui.type diff --git a/src/Resources/config/grids/shop.yml b/src/Resources/config/grids/shop.yml index 0c4485e93..e01ab3a15 100755 --- a/src/Resources/config/grids/shop.yml +++ b/src/Resources/config/grids/shop.yml @@ -1,2 +1,2 @@ imports: - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/shop/page.yml" } + - { resource: "@SyliusCmsPlugin/Resources/config/grids/shop/page.yml" } diff --git a/src/Resources/config/grids/shop/page.yml b/src/Resources/config/grids/shop/page.yml index 664414b1f..5bfd0d705 100755 --- a/src/Resources/config/grids/shop/page.yml +++ b/src/Resources/config/grids/shop/page.yml @@ -1,10 +1,10 @@ sylius_grid: grids: - bitbag_sylius_cms_plugin_shop_page: + sylius_cms_shop_page: driver: name: doctrine/orm options: - class: "%bitbag_sylius_cms_plugin.model.page.class%" + class: "%sylius_cms.model.page.class%" repository: method: createShopListQueryBuilder arguments: diff --git a/src/Resources/config/resources.yml b/src/Resources/config/resources.yml deleted file mode 100755 index d6a5d3e5e..000000000 --- a/src/Resources/config/resources.yml +++ /dev/null @@ -1,7 +0,0 @@ -imports: - - { resource: resources/block.yml } - - { resource: resources/content_configuration.yml } - - { resource: resources/page.yml } - - { resource: resources/collection.yml } - - { resource: resources/media.yml } - - { resource: resources/template.yml } diff --git a/src/Resources/config/resources/block.yml b/src/Resources/config/resources/block.yml deleted file mode 100755 index 131137059..000000000 --- a/src/Resources/config/resources/block.yml +++ /dev/null @@ -1,11 +0,0 @@ -sylius_resource: - resources: - bitbag_sylius_cms_plugin.block: - driver: doctrine/orm - classes: - model: BitBag\SyliusCmsPlugin\Entity\Block - interface: BitBag\SyliusCmsPlugin\Entity\BlockInterface - form: BitBag\SyliusCmsPlugin\Form\Type\BlockType - repository: BitBag\SyliusCmsPlugin\Repository\BlockRepository - controller: BitBag\SyliusCmsPlugin\Controller\BlockController - factory: Sylius\Component\Resource\Factory\Factory diff --git a/src/Resources/config/resources/collection.yml b/src/Resources/config/resources/collection.yml deleted file mode 100755 index 5e9f43d3c..000000000 --- a/src/Resources/config/resources/collection.yml +++ /dev/null @@ -1,10 +0,0 @@ -sylius_resource: - resources: - bitbag_sylius_cms_plugin.collection: - driver: doctrine/orm - classes: - model: BitBag\SyliusCmsPlugin\Entity\Collection - interface: BitBag\SyliusCmsPlugin\Entity\CollectionInterface - form: BitBag\SyliusCmsPlugin\Form\Type\CollectionType - repository: BitBag\SyliusCmsPlugin\Repository\CollectionRepository - factory: Sylius\Component\Resource\Factory\Factory diff --git a/src/Resources/config/resources/content_configuration.yml b/src/Resources/config/resources/content_configuration.yml deleted file mode 100644 index 881db0a3c..000000000 --- a/src/Resources/config/resources/content_configuration.yml +++ /dev/null @@ -1,10 +0,0 @@ -sylius_resource: - resources: - bitbag_sylius_cms_plugin.content_configuration: - driver: doctrine/orm - classes: - model: BitBag\SyliusCmsPlugin\Entity\ContentConfiguration - interface: BitBag\SyliusCmsPlugin\Entity\ContentConfigurationInterface - form: BitBag\SyliusCmsPlugin\Form\Type\ContentConfigurationType - repository: BitBag\SyliusCmsPlugin\Repository\ContentConfigurationRepository - factory: Sylius\Component\Resource\Factory\TranslatableFactory diff --git a/src/Resources/config/resources/media.yml b/src/Resources/config/resources/media.yml deleted file mode 100644 index 2b183a478..000000000 --- a/src/Resources/config/resources/media.yml +++ /dev/null @@ -1,15 +0,0 @@ -sylius_resource: - resources: - bitbag_sylius_cms_plugin.media: - driver: doctrine/orm - classes: - model: BitBag\SyliusCmsPlugin\Entity\Media - interface: BitBag\SyliusCmsPlugin\Entity\MediaInterface - form: BitBag\SyliusCmsPlugin\Form\Type\MediaType - repository: BitBag\SyliusCmsPlugin\Repository\MediaRepository - controller: BitBag\SyliusCmsPlugin\Controller\MediaController - factory: Sylius\Component\Resource\Factory\TranslatableFactory - translation: - classes: - model: BitBag\SyliusCmsPlugin\Entity\MediaTranslation - interface: BitBag\SyliusCmsPlugin\Entity\MediaTranslationInterface diff --git a/src/Resources/config/resources/page.yml b/src/Resources/config/resources/page.yml deleted file mode 100755 index 3f4dbc20f..000000000 --- a/src/Resources/config/resources/page.yml +++ /dev/null @@ -1,15 +0,0 @@ -sylius_resource: - resources: - bitbag_sylius_cms_plugin.page: - driver: doctrine/orm - classes: - model: BitBag\SyliusCmsPlugin\Entity\Page - interface: BitBag\SyliusCmsPlugin\Entity\PageInterface - form: BitBag\SyliusCmsPlugin\Form\Type\PageType - repository: BitBag\SyliusCmsPlugin\Repository\PageRepository - controller: BitBag\SyliusCmsPlugin\Controller\PageController - factory: Sylius\Component\Resource\Factory\TranslatableFactory - translation: - classes: - model: BitBag\SyliusCmsPlugin\Entity\PageTranslation - interface: BitBag\SyliusCmsPlugin\Entity\PageTranslationInterface diff --git a/src/Resources/config/resources/template.yml b/src/Resources/config/resources/template.yml deleted file mode 100755 index cc68b045f..000000000 --- a/src/Resources/config/resources/template.yml +++ /dev/null @@ -1,11 +0,0 @@ -sylius_resource: - resources: - bitbag_sylius_cms_plugin.template: - driver: doctrine/orm - classes: - model: BitBag\SyliusCmsPlugin\Entity\Template - interface: BitBag\SyliusCmsPlugin\Entity\TemplateInterface - form: BitBag\SyliusCmsPlugin\Form\Type\TemplateType - repository: BitBag\SyliusCmsPlugin\Repository\TemplateRepository - factory: Sylius\Component\Resource\Factory\Factory - controller: BitBag\SyliusCmsPlugin\Controller\TemplateController diff --git a/src/Resources/config/routing.yml b/src/Resources/config/routing.yml index d27bd1a9b..9c784f82e 100755 --- a/src/Resources/config/routing.yml +++ b/src/Resources/config/routing.yml @@ -1,7 +1,7 @@ -bitbag_sylius_cms_plugin_admin: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin.yml" +sylius_cms_admin: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin.yml" prefix: '/%sylius_admin.path_name%' -bitbag_sylius_cms_plugin_shop: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop.yml" +sylius_cms_shop: + resource: "@SyliusCmsPlugin/Resources/config/routing/shop.yml" prefix: /{_locale} diff --git a/src/Resources/config/routing/admin.yml b/src/Resources/config/routing/admin.yml index 126f90a95..693e1199e 100755 --- a/src/Resources/config/routing/admin.yml +++ b/src/Resources/config/routing/admin.yml @@ -1,46 +1,46 @@ -bitbag_sylius_cms_plugin_admin_block: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/block.yml" +sylius_cms_admin_block: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/block.yml" -bitbag_sylius_cms_plugin_admin_page: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/page.yml" +sylius_cms_admin_page: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/page.yml" -bitbag_sylius_cms_plugin_admin_collection: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/collection.yml" +sylius_cms_admin_collection: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/collection.yml" -bitbag_sylius_cms_plugin_admin_media: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/media.yml" +sylius_cms_admin_media: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/media.yml" -bitbag_sylius_cms_plugin_admin_product: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/product.yml" +sylius_cms_admin_product: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/product.yml" -bitbag_sylius_cms_plugin_admin_taxon: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/taxon.yml" +sylius_cms_admin_taxon: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/taxon.yml" -bitbag_sylius_cms_plugin_admin_locale: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/locale.yml" +sylius_cms_admin_locale: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/locale.yml" -bitbag_sylius_cms_plugin_admin_template: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/template.yml" +sylius_cms_admin_template: + resource: "@SyliusCmsPlugin/Resources/config/routing/admin/template.yml" -bitbag_sylius_cms_plugin_admin_ajax_generate_page_slug: +sylius_cms_admin_ajax_generate_page_slug: path: /page/generate-slug methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.page_slug::generateAction + _controller: sylius_cms.controller.page_slug::generateAction -bitbag_sylius_cms_plugin_admin_import_data: +sylius_cms_admin_import_data: path: /import/{resourceName} methods: [GET, POST] defaults: - _controller: bitbag_sylius_cms_plugin.controller.action.admin.import_data + _controller: sylius_cms.controller.action.admin.import_data -bitbag_sylius_cms_plugin_admin_upload_editor_image: +sylius_cms_admin_upload_editor_image: path: /editor/upload-image defaults: - _controller: bitbag_sylius_cms_plugin.controller.action.admin.upload_editor_image + _controller: sylius_cms.controller.action.admin.upload_editor_image -bitbag_sylius_cms_plugin_admin_retrieve_package_info: +sylius_cms_admin_retrieve_package_info: path: /cms/retrieve-package-info methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.action.admin.retrieve_package_info + _controller: sylius_cms.controller.action.admin.retrieve_package_info diff --git a/src/Resources/config/routing/admin/block.yml b/src/Resources/config/routing/admin/block.yml index 5025d02b7..d5b27c175 100755 --- a/src/Resources/config/routing/admin/block.yml +++ b/src/Resources/config/routing/admin/block.yml @@ -1,18 +1,18 @@ -bitbag_sylius_cms_plugin_admin_block: +sylius_cms_admin_block: resource: | - alias: bitbag_sylius_cms_plugin.block + alias: sylius_cms.block section: admin - templates: '@BitBagSyliusCmsPlugin/CrudUi' + templates: '@SyliusCmsPlugin/CrudUi' except: ['show'] redirect: update - grid: bitbag_sylius_cms_plugin_admin_block + grid: sylius_cms_admin_block permission: true vars: all: - header: bitbag_sylius_cms_plugin.ui.blocks_header - subheader: bitbag_sylius_cms_plugin.ui.blocks_subheader + header: sylius_cms.ui.blocks_header + subheader: sylius_cms.ui.blocks_subheader templates: - form: "@BitBagSyliusCmsPlugin/Block/Crud/_form.html.twig" + form: "@SyliusCmsPlugin/Block/Crud/_form.html.twig" index: icon: block layout route: @@ -20,20 +20,20 @@ bitbag_sylius_cms_plugin_admin_block: code: $type type: sylius.resource -bitbag_sylius_cms_plugin_admin_block_preview: +sylius_cms_admin_block_preview: path: /block/preview methods: [GET, POST, PUT] defaults: - _controller: bitbag_sylius_cms_plugin.controller.block::previewAction + _controller: sylius_cms.controller.block::previewAction _sylius: - template: "@BitBagSyliusCmsPlugin/Block/preview.html.twig" + template: "@SyliusCmsPlugin/Block/preview.html.twig" -bitbag_sylius_cms_plugin_admin_ajax_block_by_name_phrase: +sylius_cms_admin_ajax_block_by_name_phrase: path: /ajax/blocks/search methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.block::indexAction + _controller: sylius_cms.controller.block::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -42,12 +42,12 @@ bitbag_sylius_cms_plugin_admin_ajax_block_by_name_phrase: arguments: phrase: $phrase -bitbag_sylius_cms_plugin_admin_ajax_block_by_code: +sylius_cms_admin_ajax_block_by_code: path: /ajax/blocks/code methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.block::indexAction + _controller: sylius_cms.controller.block::indexAction _sylius: serialization_groups: [Autocomplete] permission: true diff --git a/src/Resources/config/routing/admin/collection.yml b/src/Resources/config/routing/admin/collection.yml index ad8b95fd9..cca2c9984 100755 --- a/src/Resources/config/routing/admin/collection.yml +++ b/src/Resources/config/routing/admin/collection.yml @@ -1,28 +1,28 @@ -bitbag_sylius_cms_plugin_admin_collection: +sylius_cms_admin_collection: resource: | - alias: bitbag_sylius_cms_plugin.collection + alias: sylius_cms.collection section: admin - templates: '@BitBagSyliusCmsPlugin/CrudUi' + templates: '@SyliusCmsPlugin/CrudUi' redirect: update - grid: bitbag_sylius_cms_plugin_admin_collection + grid: sylius_cms_admin_collection except: ['show'] permission: true vars: all: - header: bitbag_sylius_cms_plugin.ui.collections_header - subheader: bitbag_sylius_cms_plugin.ui.collections_subheader + header: sylius_cms.ui.collections_header + subheader: sylius_cms.ui.collections_subheader templates: - form: "@BitBagSyliusCmsPlugin/Collection/Crud/_form.html.twig" + form: "@SyliusCmsPlugin/Collection/Crud/_form.html.twig" index: icon: grid layout type: sylius.resource -bitbag_sylius_cms_plugin_admin_ajax_collection_by_name_phrase: +sylius_cms_admin_ajax_collection_by_name_phrase: path: /ajax/collections/search methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.collection::indexAction + _controller: sylius_cms.controller.collection::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -31,12 +31,12 @@ bitbag_sylius_cms_plugin_admin_ajax_collection_by_name_phrase: arguments: phrase: $phrase -bitbag_sylius_cms_plugin_admin_ajax_page_collection_by_name_phrase: +sylius_cms_admin_ajax_page_collection_by_name_phrase: path: /ajax/collections/page/search methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.collection::indexAction + _controller: sylius_cms.controller.collection::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -46,12 +46,12 @@ bitbag_sylius_cms_plugin_admin_ajax_page_collection_by_name_phrase: phrase: $phrase type: page -bitbag_sylius_cms_plugin_admin_ajax_collection_by_code: +sylius_cms_admin_ajax_collection_by_code: path: /ajax/collections/code methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.collection::indexAction + _controller: sylius_cms.controller.collection::indexAction _sylius: serialization_groups: [Autocomplete] permission: true diff --git a/src/Resources/config/routing/admin/locale.yml b/src/Resources/config/routing/admin/locale.yml index 9b398a5de..3a4e3fa6c 100644 --- a/src/Resources/config/routing/admin/locale.yml +++ b/src/Resources/config/routing/admin/locale.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin_admin_partial_locale_index: +sylius_cms_admin_partial_locale_index: path: /_partial/locales methods: [GET] defaults: diff --git a/src/Resources/config/routing/admin/media.yml b/src/Resources/config/routing/admin/media.yml index 726ef12c4..2a799aec3 100644 --- a/src/Resources/config/routing/admin/media.yml +++ b/src/Resources/config/routing/admin/media.yml @@ -1,28 +1,28 @@ -bitbag_sylius_cms_plugin_admin_media: +sylius_cms_admin_media: resource: | - alias: bitbag_sylius_cms_plugin.media + alias: sylius_cms.media section: admin - templates: '@BitBagSyliusCmsPlugin/CrudUi' + templates: '@SyliusCmsPlugin/CrudUi' redirect: update - grid: bitbag_sylius_cms_plugin_admin_media + grid: sylius_cms_admin_media except: ['show'] permission: true vars: all: - header: bitbag_sylius_cms_plugin.ui.media_header - subheader: bitbag_sylius_cms_plugin.ui.media_subheader + header: sylius_cms.ui.media_header + subheader: sylius_cms.ui.media_subheader templates: - form: "@BitBagSyliusCmsPlugin/Media/Crud/_form.html.twig" + form: "@SyliusCmsPlugin/Media/Crud/_form.html.twig" index: icon: file type: sylius.resource -bitbag_sylius_cms_plugin_admin_ajax_media_by_name_phrase: +sylius_cms_admin_ajax_media_by_name_phrase: path: /ajax/media/search methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.media.overriden::indexAction + _controller: sylius_cms.controller.media.overriden::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -32,12 +32,12 @@ bitbag_sylius_cms_plugin_admin_ajax_media_by_name_phrase: phrase: $phrase mediaType: $mediaType -bitbag_sylius_cms_plugin_admin_ajax_media_by_code: +sylius_cms_admin_ajax_media_by_code: path: /ajax/media/code methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.media.overriden::indexAction + _controller: sylius_cms.controller.media.overriden::indexAction _sylius: serialization_groups: [Autocomplete] permission: true diff --git a/src/Resources/config/routing/admin/page.yml b/src/Resources/config/routing/admin/page.yml index b5219d1d1..8f9200f98 100755 --- a/src/Resources/config/routing/admin/page.yml +++ b/src/Resources/config/routing/admin/page.yml @@ -1,37 +1,37 @@ -bitbag_sylius_cms_plugin_admin_page: +sylius_cms_admin_page: resource: | - alias: bitbag_sylius_cms_plugin.page + alias: sylius_cms.page section: admin - templates: '@BitBagSyliusCmsPlugin/CrudUi' + templates: '@SyliusCmsPlugin/CrudUi' redirect: update - grid: bitbag_sylius_cms_plugin_admin_page + grid: sylius_cms_admin_page except: ['show'] permission: true vars: all: - header: bitbag_sylius_cms_plugin.ui.pages_header - subheader: bitbag_sylius_cms_plugin.ui.pages_subheader + header: sylius_cms.ui.pages_header + subheader: sylius_cms.ui.pages_subheader templates: - form: "@BitBagSyliusCmsPlugin/Page/Crud/_form.html.twig" + form: "@SyliusCmsPlugin/Page/Crud/_form.html.twig" index: icon: sticky note type: sylius.resource -bitbag_sylius_cms_plugin_admin_page_preview: +sylius_cms_admin_page_preview: path: /page/preview/{id} methods: [GET, POST, PUT] defaults: - _controller: bitbag_sylius_cms_plugin.controller.page.overriden::previewAction + _controller: sylius_cms.controller.page.overriden::previewAction _sylius: - template: "@BitBagSyliusCmsPlugin/Page/preview.html.twig" + template: "@SyliusCmsPlugin/Page/preview.html.twig" id: null -bitbag_sylius_cms_plugin_admin_ajax_page_by_name_phrase: +sylius_cms_admin_ajax_page_by_name_phrase: path: /ajax/pages/search methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.page::indexAction + _controller: sylius_cms.controller.page::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -40,12 +40,12 @@ bitbag_sylius_cms_plugin_admin_ajax_page_by_name_phrase: arguments: phrase: $phrase -bitbag_sylius_cms_plugin_admin_ajax_page_by_code: +sylius_cms_admin_ajax_page_by_code: path: /ajax/pages/code methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.page::indexAction + _controller: sylius_cms.controller.page::indexAction _sylius: serialization_groups: [Autocomplete] permission: true diff --git a/src/Resources/config/routing/admin/product.yml b/src/Resources/config/routing/admin/product.yml index ef296f342..0e0168796 100644 --- a/src/Resources/config/routing/admin/product.yml +++ b/src/Resources/config/routing/admin/product.yml @@ -1,6 +1,6 @@ -bitbag_sylius_cms_plugin_admin_ajax_product_by_name_phrase: +sylius_cms_admin_ajax_product_by_name_phrase: path: /ajax/products/search-by-name methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.action.admin.product_search + _controller: sylius_cms.controller.action.admin.product_search diff --git a/src/Resources/config/routing/admin/taxon.yml b/src/Resources/config/routing/admin/taxon.yml index 9a26281ee..fa191797b 100644 --- a/src/Resources/config/routing/admin/taxon.yml +++ b/src/Resources/config/routing/admin/taxon.yml @@ -1,6 +1,6 @@ -bitbag_sylius_cms_plugin_admin_ajax_taxon_by_name_phrase: +sylius_cms_admin_ajax_taxon_by_name_phrase: path: /ajax/taxon/search-by-name methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.action.admin.taxon_search + _controller: sylius_cms.controller.action.admin.taxon_search diff --git a/src/Resources/config/routing/admin/template.yml b/src/Resources/config/routing/admin/template.yml index 9013de97b..33d2d8ad1 100755 --- a/src/Resources/config/routing/admin/template.yml +++ b/src/Resources/config/routing/admin/template.yml @@ -1,26 +1,26 @@ -bitbag_sylius_cms_plugin_admin_template: +sylius_cms_admin_template: resource: | - alias: bitbag_sylius_cms_plugin.template + alias: sylius_cms.template section: admin - templates: '@BitBagSyliusCmsPlugin/CrudUi' + templates: '@SyliusCmsPlugin/CrudUi' except: ['show'] redirect: update - grid: bitbag_sylius_cms_plugin_admin_template + grid: sylius_cms_admin_template permission: true vars: all: templates: - form: "@BitBagSyliusCmsPlugin/Template/Crud/_form.html.twig" + form: "@SyliusCmsPlugin/Template/Crud/_form.html.twig" index: icon: block layout type: sylius.resource -bitbag_sylius_cms_plugin_admin_ajax_template_page_by_name_phrase: +sylius_cms_admin_ajax_template_page_by_name_phrase: path: /ajax/templates/page/search methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.template::indexAction + _controller: sylius_cms.controller.template::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -30,12 +30,12 @@ bitbag_sylius_cms_plugin_admin_ajax_template_page_by_name_phrase: phrase: $phrase type: page -bitbag_sylius_cms_plugin_admin_ajax_template_block_by_name_phrase: +sylius_cms_admin_ajax_template_block_by_name_phrase: path: /ajax/templates/block/search methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.template::indexAction + _controller: sylius_cms.controller.template::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -45,12 +45,12 @@ bitbag_sylius_cms_plugin_admin_ajax_template_block_by_name_phrase: phrase: $phrase type: block -bitbag_sylius_cms_plugin_admin_ajax_template_by_id: +sylius_cms_admin_ajax_template_by_id: path: /ajax/templates/id methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.template::indexAction + _controller: sylius_cms.controller.template::indexAction _sylius: serialization_groups: [Autocomplete] permission: true @@ -58,11 +58,11 @@ bitbag_sylius_cms_plugin_admin_ajax_template_by_id: method: find arguments: [id: $id] -bitbag_sylius_cms_plugin_admin_ajax_template_content_by_id: +sylius_cms_admin_ajax_template_content_by_id: path: /ajax/templates/content/{id} methods: [GET] defaults: _format: json - _controller: bitbag_sylius_cms_plugin.controller.template::getContentElementsAction + _controller: sylius_cms.controller.action.admin.template_content_elements::getContentElementsAction _sylius: permission: true diff --git a/src/Resources/config/routing/shop.yml b/src/Resources/config/routing/shop.yml index 14ad3e9c5..bd3c5283f 100755 --- a/src/Resources/config/routing/shop.yml +++ b/src/Resources/config/routing/shop.yml @@ -1,11 +1,11 @@ -bitbag_sylius_cms_plugin_shop_block: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop/block.yml" +sylius_cms_shop_block: + resource: "@SyliusCmsPlugin/Resources/config/routing/shop/block.yml" -bitbag_sylius_cms_plugin_shop_page: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop/page.yml" +sylius_cms_shop_page: + resource: "@SyliusCmsPlugin/Resources/config/routing/shop/page.yml" -bitbag_sylius_cms_plugin_shop_collection: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop/collection.yml" +sylius_cms_shop_collection: + resource: "@SyliusCmsPlugin/Resources/config/routing/shop/collection.yml" -bitbag_sylius_cms_plugin_shop_media: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop/media.yml" +sylius_cms_shop_media: + resource: "@SyliusCmsPlugin/Resources/config/routing/shop/media.yml" diff --git a/src/Resources/config/routing/shop/block.yml b/src/Resources/config/routing/shop/block.yml index 79eb47675..e639af5fe 100755 --- a/src/Resources/config/routing/shop/block.yml +++ b/src/Resources/config/routing/shop/block.yml @@ -1,19 +1,19 @@ -bitbag_sylius_cms_plugin_shop_block_render: +sylius_cms_shop_block_render: path: /block/{code} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.block::renderBlockAction + _controller: sylius_cms.controller.block::renderBlockAction _sylius: repository: method: findOneByCode arguments: - $code -bitbag_sylius_cms_plugin_shop_block_index_by_collection_code: +sylius_cms_shop_block_index_by_collection_code: path: /blocks/collection/{collectionCode} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.block::indexAction + _controller: sylius_cms.controller.block::indexAction _sylius: template: $template repository: diff --git a/src/Resources/config/routing/shop/collection.yml b/src/Resources/config/routing/shop/collection.yml index 051ea55cb..0c045b479 100755 --- a/src/Resources/config/routing/shop/collection.yml +++ b/src/Resources/config/routing/shop/collection.yml @@ -1,8 +1,8 @@ -bitbag_sylius_cms_plugin_shop_collection_show: +sylius_cms_shop_collection_show: path: /collection/{code} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.collection::showAction + _controller: sylius_cms.controller.collection::showAction _sylius: template: $template repository: @@ -10,11 +10,11 @@ bitbag_sylius_cms_plugin_shop_collection_show: arguments: - $code -bitbag_sylius_cms_plugin_shop_collection_show_codes: +sylius_cms_shop_collection_show_codes: path: /collections/{codes} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.collection::indexAction + _controller: sylius_cms.controller.collection::indexAction _sylius: template: $template repository: diff --git a/src/Resources/config/routing/shop/media.yml b/src/Resources/config/routing/shop/media.yml index 36826fb59..6f1791f32 100755 --- a/src/Resources/config/routing/shop/media.yml +++ b/src/Resources/config/routing/shop/media.yml @@ -1,19 +1,19 @@ -bitbag_sylius_cms_plugin_shop_media_render: +sylius_cms_shop_media_render: path: /media/{code} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.media.overriden::renderMediaAction + _controller: sylius_cms_plugin.controller.media.overriden::renderMediaAction -bitbag_sylius_cms_plugin_shop_media_download: +sylius_cms_shop_media_download: path: /media/download/{code} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.media.overriden::downloadMediaAction + _controller: sylius_cms_plugin.controller.media.overriden::downloadMediaAction disposition: !php/const Symfony\Component\HttpFoundation\ResponseHeaderBag::DISPOSITION_ATTACHMENT -bitbag_sylius_cms_plugin_shop_media_inline: +sylius_cms_shop_media_inline: path: /media/inline/{code} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.media.overriden::downloadMediaAction + _controller: sylius_cms_plugin.controller.media.overriden::downloadMediaAction disposition: !php/const Symfony\Component\HttpFoundation\ResponseHeaderBag::DISPOSITION_INLINE diff --git a/src/Resources/config/routing/shop/page.yml b/src/Resources/config/routing/shop/page.yml index 5162c6be1..9d8f2d928 100755 --- a/src/Resources/config/routing/shop/page.yml +++ b/src/Resources/config/routing/shop/page.yml @@ -1,10 +1,10 @@ -bitbag_sylius_cms_plugin_shop_page_show: +sylius_cms_shop_page_show: path: /page/{slug} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.page.overriden::showAction + _controller: sylius_cms.controller.page.overriden::showAction _sylius: - template: "@BitBagSyliusCmsPlugin/Shop/Page/show.html.twig" + template: "@SyliusCmsPlugin/Shop/Page/show.html.twig" repository: method: findOneEnabledBySlugAndChannelCode arguments: @@ -12,11 +12,11 @@ bitbag_sylius_cms_plugin_shop_page_show: - "expr:service('sylius.context.locale').getLocaleCode()" - "expr:service('sylius.context.channel').getChannel().getCode()" -bitbag_sylius_cms_plugin_shop_page_show_link_by_code: +sylius_cms_shop_page_show_link_by_code: path: /page/link/{code} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.page.overriden::renderLinkAction + _controller: sylius_cms.controller.page.overriden::renderLinkAction _sylius: template: $template repository: @@ -24,39 +24,39 @@ bitbag_sylius_cms_plugin_shop_page_show_link_by_code: arguments: - $code -bitbag_sylius_cms_plugin_shop_page_index_by_collection_code: +sylius_cms_shop_page_index_by_collection_code: path: /page/{collectionCode} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.page.overriden::indexAction + _controller: sylius_cms.controller.page.overriden::indexAction _sylius: - template: "@BitBagSyliusCmsPlugin/Shop/Page/index.html.twig" - grid: bitbag_sylius_cms_plugin_shop_page + template: "@SyliusCmsPlugin/Shop/Page/index.html.twig" + grid: sylius_cms_shop_page repository: method: findByCollectionCode arguments: - $collectionCode -bitbag_sylius_cms_plugin_shop_page_index_by_collection_code_no_grid: +sylius_cms_shop_page_index_by_collection_code_no_grid: path: /pages/{collectionCode}/no-grid methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.page.overriden::indexAction + _controller: sylius_cms.controller.page.overriden::indexAction _sylius: - template: "@BitBagSyliusCmsPlugin/Shop/Page/index.html.twig" + template: "@SyliusCmsPlugin/Shop/Page/index.html.twig" repository: method: findByCollectionCode arguments: - $collectionCode -bitbag_sylius_cms_plugin_shop_page_index_by_collection_code_template: +sylius_cms_shop_page_index_by_collection_code_template: path: /pages-template/{collectionCode} methods: [GET] defaults: - _controller: bitbag_sylius_cms_plugin.controller.page.overriden::indexAction + _controller: sylius_cms.controller.page.overriden::indexAction _sylius: template: $template - grid: bitbag_sylius_cms_plugin_shop_page + grid: sylius_cms_shop_page repository: method: findByCollectionCode arguments: diff --git a/src/Resources/config/serialization/Block.xml b/src/Resources/config/serialization/Block.xml index 6bcab96ea..ad39aa163 100644 --- a/src/Resources/config/serialization/Block.xml +++ b/src/Resources/config/serialization/Block.xml @@ -3,33 +3,43 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - + - shop:cms:read + sylius_cms:block:read:index + sylius_cms:block:read:show - shop:cms:read + sylius_cms:block:read:index + sylius_cms:block:read:show - - shop:cms:read + + sylius_cms:block:read:index + sylius_cms:block:read:show - - shop:cms:read + + sylius_cms:block:read:index + sylius_cms:block:read:show - shop:cms:read + sylius_cms:block:read:show + + + sylius_cms:block:read:show + + + sylius_cms:block:read:show - shop:cms:read + sylius_cms:block:read:show - shop:cms:read + sylius_cms:block:read:show - shop:cms:read + sylius_cms:block:read:show - shop:cms:read + sylius_cms:block:read:show diff --git a/src/Resources/config/serialization/Collection.xml b/src/Resources/config/serialization/Collection.xml index 6f11af78c..90182810b 100644 --- a/src/Resources/config/serialization/Collection.xml +++ b/src/Resources/config/serialization/Collection.xml @@ -3,12 +3,27 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - + - shop:cms:read + sylius_cms:collection:read:index + sylius_cms:collection:read:show - shop:cms:read + sylius_cms:collection:read:index + sylius_cms:collection:read:show + + + sylius_cms:collection:read:index + sylius_cms:collection:read:show + + + sylius_cms:collection:read:show + + + sylius_cms:collection:read:show + + + sylius_cms:collection:read:show diff --git a/src/Resources/config/serialization/Media.xml b/src/Resources/config/serialization/Media.xml index 451a4f154..24f4c722b 100644 --- a/src/Resources/config/serialization/Media.xml +++ b/src/Resources/config/serialization/Media.xml @@ -3,45 +3,50 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - + - shop:cms:read + sylius_cms:media:read:index + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:index + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:index + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:index + sylius_cms:media:read:show + + + sylius_cms:media:read:index + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show - shop:cms:read - - - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show diff --git a/src/Resources/config/serialization/MediaTranslation.xml b/src/Resources/config/serialization/MediaTranslation.xml index 627f01e71..1a773bbb0 100644 --- a/src/Resources/config/serialization/MediaTranslation.xml +++ b/src/Resources/config/serialization/MediaTranslation.xml @@ -3,15 +3,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - + - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show - shop:cms:read + sylius_cms:media:read:show diff --git a/src/Resources/config/serialization/Page.xml b/src/Resources/config/serialization/Page.xml index 250782121..50a05b5d2 100644 --- a/src/Resources/config/serialization/Page.xml +++ b/src/Resources/config/serialization/Page.xml @@ -3,21 +3,27 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - + - shop:cms:read + sylius_cms:page:read:index + sylius_cms:page:read:show - shop:cms:read + sylius_cms:page:read:index + sylius_cms:page:read:show - shop:cms:read + sylius_cms:page:read:index + sylius_cms:page:read:show - shop:cms:read + sylius_cms:page:read:show + + + sylius_cms:page:read:show - shop:cms:read + sylius_cms:page:read:show diff --git a/src/Resources/config/serialization/PageTranslation.xml b/src/Resources/config/serialization/PageTranslation.xml index 9be02fc90..8d759d46b 100644 --- a/src/Resources/config/serialization/PageTranslation.xml +++ b/src/Resources/config/serialization/PageTranslation.xml @@ -3,21 +3,18 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - - - shop:cms:read - + - shop:cms:read + sylius_cms:page:read:show - shop:cms:read + sylius_cms:page:read:show - shop:cms:read + sylius_cms:page:read:show - shop:cms:read + sylius_cms:page:read:show diff --git a/src/Resources/config/serialization/Template.xml b/src/Resources/config/serialization/Template.xml index e65ab80fc..666114643 100644 --- a/src/Resources/config/serialization/Template.xml +++ b/src/Resources/config/serialization/Template.xml @@ -3,18 +3,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd" > - + - shop:cms:read + sylius_cms:template:read:index + sylius_cms:template:read:show - shop:cms:read + sylius_cms:template:read:index + sylius_cms:template:read:show - shop:cms:read + sylius_cms:template:read:index + sylius_cms:template:read:show - shop:cms:read + sylius_cms:template:read:show diff --git a/src/Resources/config/serializer/Entity.Block.yml b/src/Resources/config/serializer/Entity.Block.yml index 785a05373..80781986c 100644 --- a/src/Resources/config/serializer/Entity.Block.yml +++ b/src/Resources/config/serializer/Entity.Block.yml @@ -1,4 +1,4 @@ -BitBag\SyliusCmsPlugin\Entity\Block: +Sylius\CmsPlugin\Entity\Block: exclusion_policy: ALL xml_root_name: block properties: diff --git a/src/Resources/config/serializer/Entity.Collection.yml b/src/Resources/config/serializer/Entity.Collection.yml index b98b6ee9a..ff18f5d99 100644 --- a/src/Resources/config/serializer/Entity.Collection.yml +++ b/src/Resources/config/serializer/Entity.Collection.yml @@ -1,4 +1,4 @@ -BitBag\SyliusCmsPlugin\Entity\Collection: +Sylius\CmsPlugin\Entity\Collection: exclusion_policy: ALL xml_root_name: collection properties: diff --git a/src/Resources/config/serializer/Entity.Media.yml b/src/Resources/config/serializer/Entity.Media.yml index 8cf3defd2..d6c46c77f 100644 --- a/src/Resources/config/serializer/Entity.Media.yml +++ b/src/Resources/config/serializer/Entity.Media.yml @@ -1,4 +1,4 @@ -BitBag\SyliusCmsPlugin\Entity\Media: +Sylius\CmsPlugin\Entity\Media: exclusion_policy: ALL xml_root_name: media properties: @@ -19,7 +19,7 @@ BitBag\SyliusCmsPlugin\Entity\Media: - rel: self href: - route: bitbag_sylius_cms_plugin_shop_media_inline + route: sylius_cms_shop_media_inline parameters: _locale: expr(object.getTranslation().getLocale()) code: expr(object.getCode()) diff --git a/src/Resources/config/serializer/Entity.Page.yml b/src/Resources/config/serializer/Entity.Page.yml index 2bda04f44..75367e63a 100644 --- a/src/Resources/config/serializer/Entity.Page.yml +++ b/src/Resources/config/serializer/Entity.Page.yml @@ -1,4 +1,4 @@ -BitBag\SyliusCmsPlugin\Entity\Page: +Sylius\CmsPlugin\Entity\Page: exclusion_policy: ALL xml_root_name: page properties: diff --git a/src/Resources/config/serializer/Entity.Template.yml b/src/Resources/config/serializer/Entity.Template.yml index dced067d2..7e19eefb3 100644 --- a/src/Resources/config/serializer/Entity.Template.yml +++ b/src/Resources/config/serializer/Entity.Template.yml @@ -1,4 +1,4 @@ -BitBag\SyliusCmsPlugin\Entity\Template: +Sylius\CmsPlugin\Entity\Template: exclusion_policy: ALL xml_root_name: template properties: diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml index 2ee965e17..90fe0ae3a 100644 --- a/src/Resources/config/services.xml +++ b/src/Resources/config/services.xml @@ -6,38 +6,38 @@ - BitBag\SyliusCmsPlugin\MediaProvider\ProviderInterface + Sylius\CmsPlugin\MediaProvider\ProviderInterface - + - - - + + + - - + + - - %bitbag_sylius_cms_plugin.media_provider.interface% + + %sylius_cms.media_provider.interface% Media provider - - + + - + - %bitbag_sylius_cms_plugin.uploader.filesystem% + %sylius_cms.uploader.filesystem% - + diff --git a/src/Resources/config/services/assigner.xml b/src/Resources/config/services/assigner.xml index 3928794e4..585268f25 100644 --- a/src/Resources/config/services/assigner.xml +++ b/src/Resources/config/services/assigner.xml @@ -4,27 +4,27 @@ - + - + - + - - + + - + - + diff --git a/src/Resources/config/services/controller.xml b/src/Resources/config/services/controller.xml index 9f40680ed..bbd1d4003 100644 --- a/src/Resources/config/services/controller.xml +++ b/src/Resources/config/services/controller.xml @@ -4,51 +4,55 @@ - + - + - + - - + + - + - - - - + + + + - + + + + + - + - + - + - + @@ -58,12 +62,12 @@ - + - + - + @@ -73,6 +77,6 @@ - + diff --git a/src/Resources/config/services/event_listener.xml b/src/Resources/config/services/event_listener.xml index 95d29208e..5df6289b1 100644 --- a/src/Resources/config/services/event_listener.xml +++ b/src/Resources/config/services/event_listener.xml @@ -4,18 +4,18 @@ - - + + - - - - + + + + - + diff --git a/src/Resources/config/services/fixture.xml b/src/Resources/config/services/fixture.xml index e1f57e487..947b58398 100644 --- a/src/Resources/config/services/fixture.xml +++ b/src/Resources/config/services/fixture.xml @@ -4,69 +4,69 @@ - - + + - - + + - - + + - - + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - - + + + diff --git a/src/Resources/config/services/form.xml b/src/Resources/config/services/form.xml index 799016e55..65701c88c 100644 --- a/src/Resources/config/services/form.xml +++ b/src/Resources/config/services/form.xml @@ -2,162 +2,156 @@ - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\TextareaContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\SingleMediaContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\MultipleMediaContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\HeadingContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsCarouselContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsCarouselByTaxonContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsGridContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\ProductsGridByTaxonContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\TaxonsListContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\PagesCollectionContentElementType::TYPE - BitBag\SyliusCmsPlugin\Form\Type\ContentElements\SpacerContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\TextareaContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\SingleMediaContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\MultipleMediaContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\HeadingContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\ProductsCarouselContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\ProductsCarouselByTaxonContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\ProductsGridContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\ProductsGridByTaxonContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\TaxonsListContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\PagesCollectionContentElementType::TYPE + Sylius\CmsPlugin\Form\Type\ContentElements\SpacerContentElementType::TYPE - - %bitbag_sylius_cms_plugin.model.block.class% - %bitbag_sylius_cms_plugin.form.type.block.validation_groups% + + %sylius_cms.model.block.class% + %sylius_cms.form.type.block.validation_groups% - - BitBag\SyliusCmsPlugin\Entity\ContentConfiguration - %bitbag_sylius_cms_plugin.form.type.content_configuration.validation_groups% - + + Sylius\CmsPlugin\Entity\ContentConfiguration + %sylius_cms.form.type.content_configuration.validation_groups% + - - BitBag\SyliusCmsPlugin\Entity\BlockImage - %bitbag_sylius_cms_plugin.form.type.block_image.validation_groups% + + %sylius_cms.model.page.class% + %sylius_cms.form.type.page.validation_groups% - - %bitbag_sylius_cms_plugin.model.page.class% - %bitbag_sylius_cms_plugin.form.type.page.validation_groups% + + %sylius_cms.model.page_translation.class% + %sylius_cms.form.type.translation.page.validation_groups% - - %bitbag_sylius_cms_plugin.model.page_translation.class% - %bitbag_sylius_cms_plugin.form.type.translation.page.validation_groups% + + %sylius_cms.model.collection.class% + %sylius_cms.form.type.collection.validation_groups% - - %bitbag_sylius_cms_plugin.model.collection.class% - %bitbag_sylius_cms_plugin.form.type.collection.validation_groups% + - + + %sylius_cms.model.media_translation.class% + %sylius_cms.form.type.translation.media.validation_groups% - - %bitbag_sylius_cms_plugin.model.media_translation.class% - %bitbag_sylius_cms_plugin.form.type.translation.media.validation_groups% + + %sylius_cms.model.media.class% + %sylius_cms.form.type.media.validation_groups% + %sylius_cms.media_providers% - - %bitbag_sylius_cms_plugin.model.media.class% - %bitbag_sylius_cms_plugin.form.type.media.validation_groups% - %bitbag_sylius_cms_plugin.media_providers% - - - - + - - %bitbag_sylius_cms_plugin.model.template.class% - %bitbag_sylius_cms_plugin.form.type.template.validation_groups% + + %sylius_cms.model.template.class% + %sylius_cms.form.type.template.validation_groups% - - + + - - + + - - - - + + + + - - - + + + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - - - - + + + + - - + + - - + + - + diff --git a/src/Resources/config/services/importer.xml b/src/Resources/config/services/importer.xml index d5eb2c352..f5ad25ca3 100644 --- a/src/Resources/config/services/importer.xml +++ b/src/Resources/config/services/importer.xml @@ -4,38 +4,38 @@ - + - - + + - - + + - + - - - - - - - - + + + + + + + + - - + + - - + + - + - - + + diff --git a/src/Resources/config/services/media_provider.xml b/src/Resources/config/services/media_provider.xml index 52f284517..989c30996 100644 --- a/src/Resources/config/services/media_provider.xml +++ b/src/Resources/config/services/media_provider.xml @@ -4,28 +4,28 @@ - - + + - @BitBagSyliusCmsPlugin/Shop/Media/Show/image.html.twig + @SyliusCmsPlugin/Shop/Media/Show/image.html.twig media/image - + - - + + - @BitBagSyliusCmsPlugin/Shop/Media/Show/video.html.twig + @SyliusCmsPlugin/Shop/Media/Show/video.html.twig media/video - + - - + + - @BitBagSyliusCmsPlugin/Shop/Media/Show/file.html.twig + @SyliusCmsPlugin/Shop/Media/Show/file.html.twig media/file - + diff --git a/src/Resources/config/services/menu.xml b/src/Resources/config/services/menu.xml index 549122526..0f78688e5 100644 --- a/src/Resources/config/services/menu.xml +++ b/src/Resources/config/services/menu.xml @@ -4,6 +4,6 @@ - + diff --git a/src/Resources/config/services/orm.xml b/src/Resources/config/services/orm.xml new file mode 100644 index 000000000..4c59b14ec --- /dev/null +++ b/src/Resources/config/services/orm.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/Resources/config/services/renderer.xml b/src/Resources/config/services/renderer.xml index 182ed4e54..abbd1ae70 100644 --- a/src/Resources/config/services/renderer.xml +++ b/src/Resources/config/services/renderer.xml @@ -4,98 +4,98 @@ - - - + + + - + - + - + - - - + + + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - - + + + - - - + + + - - - + + + - + diff --git a/src/Resources/config/services/resolver.xml b/src/Resources/config/services/resolver.xml index 7299fca21..230abbbc5 100644 --- a/src/Resources/config/services/resolver.xml +++ b/src/Resources/config/services/resolver.xml @@ -4,80 +4,80 @@ - - - + + + code - - - + + + code - - - + + + code - - - + + + code - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/src/Resources/config/services/twig.xml b/src/Resources/config/services/twig.xml index d831b84ca..7a36e5cca 100644 --- a/src/Resources/config/services/twig.xml +++ b/src/Resources/config/services/twig.xml @@ -2,82 +2,82 @@ - - bitbag_cms_render_block - bitbag_cms_render_media + + sylius_cms_render_block + sylius_cms_render_media - @BitBagSyliusCmsPlugin/Page/link.html.twig + @SyliusCmsPlugin/Page/link.html.twig - - + + - - + + - + - - + + - + - - + + - - + + - - - + + + - + - - + + - + - - + + - + - %bitbag_cms.twig.admin_functions% + %sylius_cms.twig.admin_functions% - + - - + + - %bitbag_cms.twig.link_template% + %sylius_cms.twig.link_template% diff --git a/src/Resources/config/validation/Block.xml b/src/Resources/config/validation/Block.xml index 272b1ee50..f142162c3 100644 --- a/src/Resources/config/validation/Block.xml +++ b/src/Resources/config/validation/Block.xml @@ -3,38 +3,38 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - + - + - - + + - + @@ -42,16 +42,16 @@ - - + + diff --git a/src/Resources/config/validation/Collection.xml b/src/Resources/config/validation/Collection.xml index bd2499bc0..4bdd82aff 100644 --- a/src/Resources/config/validation/Collection.xml +++ b/src/Resources/config/validation/Collection.xml @@ -3,56 +3,56 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - + - + - - + + - + - + - - + + diff --git a/src/Resources/config/validation/Media.xml b/src/Resources/config/validation/Media.xml index 9b1ebbfde..eb8ee1eba 100644 --- a/src/Resources/config/validation/Media.xml +++ b/src/Resources/config/validation/Media.xml @@ -3,46 +3,46 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - + - + - - + + - + - - + + - + @@ -50,16 +50,16 @@ - - + + @@ -67,9 +67,9 @@ - + @@ -77,7 +77,7 @@ diff --git a/src/Resources/config/validation/MediaTranslation.xml b/src/Resources/config/validation/MediaTranslation.xml index 7996a1d33..4897fd36e 100644 --- a/src/Resources/config/validation/MediaTranslation.xml +++ b/src/Resources/config/validation/MediaTranslation.xml @@ -3,15 +3,15 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - - + + @@ -20,10 +20,10 @@ - - + + @@ -31,10 +31,10 @@ - - + + diff --git a/src/Resources/config/validation/Page.xml b/src/Resources/config/validation/Page.xml index 2219b3f98..a663aecae 100644 --- a/src/Resources/config/validation/Page.xml +++ b/src/Resources/config/validation/Page.xml @@ -3,56 +3,56 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - + - + - - + + - + - + - - + + diff --git a/src/Resources/config/validation/PageTranslation.xml b/src/Resources/config/validation/PageTranslation.xml index 811520f93..b211defa5 100644 --- a/src/Resources/config/validation/PageTranslation.xml +++ b/src/Resources/config/validation/PageTranslation.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - + - - + + @@ -32,10 +32,10 @@ - - + + @@ -44,10 +44,10 @@ - - + + diff --git a/src/Resources/config/validation/Template.xml b/src/Resources/config/validation/Template.xml index 9972c09c3..ff0fccfb2 100644 --- a/src/Resources/config/validation/Template.xml +++ b/src/Resources/config/validation/Template.xml @@ -3,31 +3,31 @@ xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + - + - + - - + + diff --git a/src/Resources/public/build/bitbag-cms-admin.css b/src/Resources/public/build/bitbag-cms-admin.css deleted file mode 100644 index f99496016..000000000 --- a/src/Resources/public/build/bitbag-cms-admin.css +++ /dev/null @@ -1 +0,0 @@ -#bitbag-cms-resource-preview-modal{height:100%}#bitbag-cms-resource-preview-modal iframe{height:100vh;width:100%}#bitbag-cms-resource-preview-modal .ui.header{padding-bottom:0}.bitbag-cms-import .ui.action.input input[type=file]{display:none}.bitbag-cms-import .ui.action.input input[type=text]{width:auto}.media-list{grid-gap:20px;display:grid;grid-template-columns:repeat(6,150px);margin:0 auto}.media-list__item{align-items:flex-start;display:flex;flex-direction:column;justify-content:space-between;max-width:150px;position:relative!important}.media-list__item__label,.media-list__item__label>strong{word-wrap:break-word!important;white-space:-moz-pre-wrap!important;white-space:-webkit-pre-wrap!important;white-space:-pre-wrap!important;white-space:-o-pre-wrap!important;white-space:pre-wrap!important;white-space:normal!important;word-break:break-all!important}.media-list__item__label>strong{display:block!important}.media-list__item__input{bottom:10px;position:absolute!important;right:10px;z-index:99}.media-list__item__input:hover{cursor:pointer}.media-list__item__img{height:150px!important;width:150px!important}.btn{display:inline-block!important;font-size:1.4em!important}.btn:hover{cursor:pointer}.page-number{font-size:1.4em!important}.btn-delete{color:#db2828;cursor:pointer;font-weight:700;height:20px;position:absolute;right:30px;width:20px;z-index:5}.btn-delete.is-hidden{opacity:.2;pointer-events:none}.bitbag-media-autocomplete .dropdown.icon{pointer-events:none}.bitbag-media-autocomplete .search{cursor:pointer!important}.bb-collection-item{margin-bottom:1em}.bb-collection-item-delete{margin-top:5px!important}.cke_notifications_area{display:none}.help-text{font-size:12px;margin-top:-10px;opacity:.5} \ No newline at end of file diff --git a/src/Resources/public/build/bitbag-cms-admin.js b/src/Resources/public/build/bitbag-cms-admin.js deleted file mode 100644 index 90e473396..000000000 --- a/src/Resources/public/build/bitbag-cms-admin.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see bitbag-cms-admin.js.LICENSE.txt */ -(()=>{var t={461:()=>{$(document).ready((function(){$(".bitbag-media-autocomplete, .sylius-autocomplete").each((function(t,e){$(e).autoComplete()}));var t="#bitbag_sylius_cms_plugin_page_contentElements",e=$(t).length?t:"#bitbag_sylius_cms_plugin_block_contentElements";$(e).length&&($(document).on("collection-form-add",(function(){$(".bitbag-media-autocomplete, .sylius-autocomplete").each((function(t,e){void 0===$._data($(e).get(0),"events")&&$(e).autoComplete()})),$("".concat(e,' [data-form-collection="item"]')).each((function(t,e){$(document).loadContentConfiguration(e)}))})),$.fn.extend({loadContentConfiguration:function(t){t.querySelector("".concat(e,' select[name*="type"]')).onchange=function(){var t=this.parentElement,e=document.createElement("div"),r=this.selectedOptions[0];e.innerHTML=r.getAttribute("data-configuration");var n=t.nextElementSibling;t.parentElement.replaceChild(e,n);var o=n.querySelector("input");o||(o=n.querySelector("textarea"));var i=o.getAttribute("name"),a=e.querySelectorAll("input");a.length||(a=e.querySelectorAll("textarea")),a.forEach((function(t){var r=t.getAttribute("name");r&&(r=i.replace(i.substring(i.indexOf("[configuration]")+15),r.substring(r.indexOf("configuration")+13)),$(t).attr("name",r),$(e).find(".bitbag-media-autocomplete").autoComplete(),$(e).find(".sylius-autocomplete").autoComplete())}))}}}),$("".concat(e,' [data-form-collection="item"]')).each((function(t,e){$(document).loadContentConfiguration(e)})),$(document).loadContentConfiguration(document.querySelector("".concat(e,' [data-form-collection="item"]'))))}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(()=>{"use strict";r(461);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{textField:"data-bb-cms-text",fileField:"data-bb-cms-file"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.textField=document.querySelector("[".concat(e.textField,"]")),this.fileField=document.querySelector("[".concat(e.fileField,"]"))},n=[{key:"init",value:function(){if("object"!==t(this.config))throw new Error("Bitbag CMS Plugin - HandleCsvUpload class config is not a valid object");this._handleFields()}},{key:"_handleFields",value:function(){this._handleTextField(),this._handleFileField()}},{key:"_handleTextField",value:function(){var t=this;this.textField.addEventListener("click",(function(){t.fileField.click()}))}},{key:"_handleFileField",value:function(){var t=this;this.fileField.addEventListener("change",(function(e){t.textField.value=e.target.files[0].name}))}}],n&&e(r.prototype,n),o&&e(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();const i=function(t,e,r){var n=new CustomEvent("".concat("bb",".").concat(e),{detail:r});return t.dispatchEvent(n),t};function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function _(){}var S={};f(S,c,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,c)&&(S=L);var x=_.prototype=b.prototype=Object.create(S);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=d(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function c(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)}))}}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{wrappersIndicator:"data-bb-cms-wrapper",lockFieldIndicator:"data-bb-cms-toggle-slug",bbTarget:"bitbag_sylius_cms_plugin_page",nameField:"bitbag_sylius_cms_plugin_page_name"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wrappers=document.querySelectorAll("[".concat(e.wrappersIndicator,"]")),this.lockFieldIndicator="[".concat(e.lockFieldIndicator,"]"),this.bbTarget=e.bbTarget,this.config=e,this.nameField=document.getElementById("".concat(e.nameField))},e=[{key:"init",value:function(){if("object"!==l(this.config))throw new Error("Bitbag CMS Plugin - HandleSlugUpdate class config is not a valid object");if("string"!=typeof this.lockFieldIndicator||"string"!=typeof this.bbTarget)throw new Error("Bitbag CMS Plugin - HandleSlugUpdate class config key values are not valid strings");if(!this.nameField)throw new Error("Bitbag CMS Plugin - HandleSlugUpdate name field not found");this._handleFields()}},{key:"_handleFields",value:function(){var t=this;this.wrappers.forEach((function(e){var r=e.dataset.locale,n=e.querySelector("#".concat(t.bbTarget,"_translations_").concat(r,"_slug"));if(n||(n=e.querySelector("#".concat(t.bbTarget,"_slug"))),n){var o;t.nameField.addEventListener("input",(function(e){e.preventDefault(),n.readOnly||(clearTimeout(o),o=setTimeout((function(){t._updateSlug(n,t.nameField.value)}),1e3))}));var i=e.querySelector(t.lockFieldIndicator);i&&i.addEventListener("click",(function(e){e.preventDefault(),t._toggleSlugModification(n,i)}))}}))}},{key:"_updateSlug",value:(o=u(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i(e,"cms.slug.update.start"),e.parentNode.classList.add("loading"),t.next=4,this._getValidSlug(e.dataset.url,r);case 4:e.value=t.sent,e.parentNode.classList.remove("loading"),i(e,"cms.slug.update.end");case 7:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"_getValidSlug",value:(n=u(a().mark((function t(e,r){var n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(e,"?name=").concat(encodeURIComponent(r)));case 3:return n=t.sent,t.next=6,n.json();case 6:return o=t.sent,t.abrupt("return",o.slug);case 10:t.prev=10,t.t0=t.catch(0),console.error("BitBag CMS Plugin - HandleSlugUpdate class error : ".concat(t.t0));case 13:case"end":return t.stop()}}),t,null,[[0,10]])}))),function(t,e){return n.apply(this,arguments)})},{key:"_toggleSlugModification",value:function(t,e){t.readOnly=!t.readOnly;var r=e.querySelector("i");r.classList.toggle("lock"),r.classList.toggle("unlock")}}],e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function _(){}var S={};l(S,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,a)&&(S=L);var x=_.prototype=b.prototype=Object.create(S);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==m(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function p(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function y(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{previewButton:"data-bb-cms-preview-btn",previewModal:"data-bb-cms-preview-modal",channelSwitch:"data-bb-cms-channel",localeSwitch:"data-bb-cms-locale"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.button=document.querySelector("[".concat(e.previewButton,"]")),this.modal=document.querySelector("[".concat(e.previewModal,"]")),this.modalSelector=e.previewModal,this.channelSelector=e.channelSwitch,this.localeSelector=e.localeSwitch},e=[{key:"init",value:function(){if("object"!==m(this.config))throw new Error("Bitbag CMS Plugin - HandlePreview class config is not a valid object");if("string"!=typeof this.localeSelector||"string"!=typeof this.channelSelector||"string"!=typeof this.modalSelector)throw new Error("Bitbag CMS Plugin - HandlePreview class config key values are not valid strings");this._resourcePreview()}},{key:"_$_CKEDITOR_MODAL_SHOW",value:function(){return $("[".concat(this.modalSelector,"]")).modal("show")}},{key:"_$_CKEDITOR_UPDATE_INSTANCES",value:function(){y(CKEDITOR.instances).forEach((function(t){return t.updateElement()}))}},{key:"_resourcePreview",value:function(){var t=this;this.button.addEventListener("click",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()})),document.querySelector("[".concat(this.channelSelector,"]")).addEventListener("change",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()})),document.querySelector("[".concat(this.localeSelector,"]")).addEventListener("change",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()}))}},{key:"_createPreview",value:(n=d().mark((function t(){var e,r,n,o,a,c,u,l,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.modal.querySelector(".ui.loadable").classList.add("loading"),this.modal.disabled=!0,e=document.querySelector("[".concat(this.channelSelector,"]")).value,r=document.querySelector("[".concat(this.localeSelector,"]")).value,n=this.button.dataset.url,o=this.button.closest("form"),a={method:"POST",body:new FormData(o)},t.prev=7,i(this.modal,"cms.create.preview.start"),t.next=11,fetch("".concat(n,"?_channel_code=").concat(e,"&_locale=").concat(r),a);case 11:return c=t.sent,t.next=14,c.text();case 14:u=t.sent,l=new Blob([u],{type:"text/html",charset:"utf-8"}),s=window.URL.createObjectURL(l),this.modal.querySelector("iframe").src=s,i(this.modal,"cms.create.preview.completed",u),t.next=25;break;case 21:t.prev=21,t.t0=t.catch(7),console.error("BitBag CMS Plugin - HandlePreview class error : ".concat(t.t0)),i(this.modal,"cms.create.preview.error",t.t0);case 25:return t.prev=25,this.modal.querySelector(".ui.loadable").classList.remove("loading"),this.modal.disabled=!1,i(this.modal,"cms.create.preview.end"),t.finish(25);case 30:case"end":return t.stop()}}),t,this,[[7,21,25,30]])})),o=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){p(i,r,o,a,c,"next",t)}function c(t){p(i,r,o,a,c,"throw",t)}a(void 0)}))},function(){return o.apply(this,arguments)})}],e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function _(){_=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(F([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==k(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function S(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{bbMediaContainer:"data-bb-cms-autocomplete",choiceName:"data-bb-cms-choice-name",choiceValue:"data-bb-cms-choice-value",criteriaType:"data-bb-cms-criteria-type",criteriaName:"data-bb-cms-criteria-name",editUrl:"data-bb-cms-load-edit-url",nameMessage:"data-bb-cms-name-message",deleteButton:"data-bb-cms-delete-selected",choosenPreview:"data-bb-cms-selected-image",selectMenu:"data-bb-cms-selection-menu",selectInput:"data-bb-cms-image-select",placeholder:"data-bb-cms-placeholder",limit:30};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.mediaContainers=document.querySelectorAll("[".concat(e.bbMediaContainer,"]")),this.deleteButton="[".concat(e.deleteButton,"]"),this.selectMenu="[".concat(e.selectMenu,"]"),this.selectInput="[".concat(e.selectInput,"]"),this.placeholder="[".concat(e.placeholder,"]")},e=[{key:"init",value:function(){var t=this;if("object"!==k(this.config))throw new Error("Bitbag CMS Plugin - HandleAutoComplete class config is not a valid object");this.mediaContainers.forEach((function(e){t._handleSavedValue(e),t._handleImageChoice(e),t._handleResetBtn(e)}))}},{key:"_handleResetBtn",value:function(t){var e=this,r=t.querySelector(this.deleteButton);""!==t.querySelector("input[type=hidden]").value?(r.classList.remove("is-hidden"),r.addEventListener("click",(function(){e._resetValues(t)}))):r.classList.add("is-hidden")}},{key:"_handleImageChoice",value:function(t){var e,r=this;t.querySelector(this.selectInput).addEventListener("click",(function(e){e.preventDefault(),r._getMediaImages(t)})),t.querySelector(this.selectInput).addEventListener("input",(function(n){n.preventDefault(),clearTimeout(e),e=setTimeout((function(){r._getMediaImages(t,n.target.value)}),500)})),t.querySelector("input[type=hidden]").addEventListener("change",(function(e){e.preventDefault(),r._handleResetBtn(t)}))}},{key:"_handleSavedValue",value:(o=x(_().mark((function t(e){var r,n,o,a,c,u,l;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!==e.querySelector("input[type=hidden]").value){t.next=2;break}return t.abrupt("return");case 2:return r="".concat(e.dataset.bbCmsLoadEditUrl,"?").concat(e.querySelector("input[type=hidden]").value.split(",").filter(String).map((function(t){return"code[]=".concat(t)})).join("&")),t.prev=3,i(e,"cms.media.saved.reload.start"),e.classList.add("loading"),t.next=8,fetch(r);case 8:return n=t.sent,t.next=11,n.json();case 11:o=t.sent,this._addToSelectMenu(o,e),a=[],null!==(c=e.querySelector(this.selectMenu))&&(a=c.children),u=S(a);try{for(u.s();!(l=u.n()).done;)l.value.click()}catch(t){u.e(t)}finally{u.f()}i(e,"cms.media.saved.reload.completed",o),t.next=25;break;case 21:t.prev=21,t.t0=t.catch(3),console.error("BitBag CMS Plugin - HandleAutoComplete class error : ".concat(t.t0)),i(e,"cms.media.saved.reload.error",t.t0);case 25:return t.prev=25,e.classList.remove("loading"),i(e,"cms.media.saved.reload.end"),t.finish(25);case 29:case"end":return t.stop()}}),t,this,[[3,21,25,29]])}))),function(t){return o.apply(this,arguments)})},{key:"_getMediaImages",value:(n=x(_().mark((function t(e){var r,n,o,a,c,u,l,s,f=arguments;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=f.length>1&&void 0!==f[1]&&f[1],n=e.dataset.bbCmsUrl,o=e.dataset.bbCmsCriteriaType,a=r?"&criteria[search][value]=".concat(r):"",c="".concat(n,"&limit=").concat(this.config.limit,"&criteria[search][type]=").concat(o,"&criteria[search][value]=").concat(a),t.prev=5,i(e,"cms.media.display.start"),e.classList.add("loading"),t.next=10,fetch(c);case 10:return u=t.sent,t.next=13,u.json();case 13:l=t.sent,s=l._embedded.items,this._addToSelectMenu(s,e),i(e,"cms.media.display.completed",l),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(5),console.error("BitBag CMS Plugin - HandleAutoComplete class error : ".concat(t.t0)),i(e,"cms.media.display.error",t.t0);case 23:return t.prev=23,e.classList.remove("loading"),i(e,"cms.media.display.end"),t.finish(23);case 27:case"end":return t.stop()}}),t,this,[[5,19,23,27]])}))),function(t){return n.apply(this,arguments)})},{key:"_resetValues",value:function(t){i(t,"cms.media.reset.start"),t.querySelector("input[type=hidden]").value="",t.querySelector(this.selectMenu).innerHTML="",t.querySelector(this.placeholder).innerHTML="",i(t,"cms.media.reset.end")}},{key:"_addToSelectMenu",value:function(t,e){var r=this;i(e,"cms.media.display.update.start");var n=e.querySelector(this.selectMenu);n.innerHTML="",null!==t&&t.forEach((function(t){n.insertAdjacentHTML("beforeend",r._itemTemplate(t.path,t.code.trim()))})),i(e,"cms.media.display.update.end")}},{key:"_itemTemplate",value:function(t,e){return'
').concat(e,"
")}}],e&&j(t.prototype,e),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function C(t,e){for(var r=0;r0&&(new h).init(),document.querySelectorAll("[data-bb-cms-preview-btn]").length>0&&(new w).init(),document.querySelector('[data-bb-target="cms-handle-autocomplete"]')&&(new P).init(),document.querySelector(".collection-type-items")&&(new F).init(),document.querySelector("[data-bb-cms-load-template]")&&(new N).init()})()})(); \ No newline at end of file diff --git a/src/Resources/public/build/bitbag-cms-shop.css b/src/Resources/public/build/bitbag-cms-shop.css deleted file mode 100644 index 537bb045c..000000000 --- a/src/Resources/public/build/bitbag-cms-shop.css +++ /dev/null @@ -1 +0,0 @@ -.bitbag-block{margin-bottom:20px}.bitbag-block img{max-width:100%}.carousel-wrapper{position:relative}.carousel-wrapper .carousel{margin:0 -1em}.carousel-wrapper .carousel-nav .carousel-left{left:30px}.carousel-wrapper .carousel-nav .carousel-right{right:30px}.carousel-wrapper .carousel-nav .carousel-left,.carousel-wrapper .carousel-nav .carousel-right{position:absolute;top:50%;transform:translateY(-50%)}.carousel-wrapper .carousel-item{padding:5px 1em}.teaser__content{margin-top:10px}.teaser__description{margin-top:5px}.teaser__read-more{display:block;margin-top:20px}[class^=cms_content_element__]:not(:last-child){margin-bottom:1rem} \ No newline at end of file diff --git a/src/Resources/public/build/entrypoints.json b/src/Resources/public/build/entrypoints.json index 00da06b81..38903804c 100644 --- a/src/Resources/public/build/entrypoints.json +++ b/src/Resources/public/build/entrypoints.json @@ -1,19 +1,19 @@ { "entrypoints": { - "bitbag-cms-shop": { + "sylius-cms-shop": { "css": [ - "/public/build/bitbag-cms-shop.css" + "/public/build/sylius-cms-shop.css" ], "js": [ - "/public/build/bitbag-cms-shop.js" + "/public/build/sylius-cms-shop.js" ] }, - "bitbag-cms-admin": { + "sylius-cms-admin": { "css": [ - "/public/build/bitbag-cms-admin.css" + "/public/build/sylius-cms-admin.css" ], "js": [ - "/public/build/bitbag-cms-admin.js" + "/public/build/sylius-cms-admin.js" ] } } diff --git a/src/Resources/public/build/manifest.json b/src/Resources/public/build/manifest.json index fe4d82bd6..328e454c0 100644 --- a/src/Resources/public/build/manifest.json +++ b/src/Resources/public/build/manifest.json @@ -1,6 +1,6 @@ { - "public/build/bitbag-cms-shop.css": "/public/build/bitbag-cms-shop.css", - "public/build/bitbag-cms-shop.js": "/public/build/bitbag-cms-shop.js", - "public/build/bitbag-cms-admin.css": "/public/build/bitbag-cms-admin.css", - "public/build/bitbag-cms-admin.js": "/public/build/bitbag-cms-admin.js" + "public/build/sylius-cms-shop.css": "/public/build/sylius-cms-shop.css", + "public/build/sylius-cms-shop.js": "/public/build/sylius-cms-shop.js", + "public/build/sylius-cms-admin.css": "/public/build/sylius-cms-admin.css", + "public/build/sylius-cms-admin.js": "/public/build/sylius-cms-admin.js" } \ No newline at end of file diff --git a/src/Resources/public/build/sylius-cms-admin.css b/src/Resources/public/build/sylius-cms-admin.css new file mode 100644 index 000000000..49fef1082 --- /dev/null +++ b/src/Resources/public/build/sylius-cms-admin.css @@ -0,0 +1 @@ +#cms-resource-preview-modal{height:100%}#cms-resource-preview-modal iframe{height:100vh;width:100%}#cms-resource-preview-modal .ui.header{padding-bottom:0}.cms-import .ui.action.input input[type=file]{display:none}.cms-import .ui.action.input input[type=text]{width:auto}.media-list{grid-gap:20px;display:grid;grid-template-columns:repeat(6,150px);margin:0 auto}.media-list__item{align-items:flex-start;display:flex;flex-direction:column;justify-content:space-between;max-width:150px;position:relative!important}.media-list__item__label,.media-list__item__label>strong{word-wrap:break-word!important;white-space:-moz-pre-wrap!important;white-space:-webkit-pre-wrap!important;white-space:-pre-wrap!important;white-space:-o-pre-wrap!important;white-space:pre-wrap!important;white-space:normal!important;word-break:break-all!important}.media-list__item__label>strong{display:block!important}.media-list__item__input{bottom:10px;position:absolute!important;right:10px;z-index:99}.media-list__item__input:hover{cursor:pointer}.media-list__item__img{height:150px!important;width:150px!important}.btn{display:inline-block!important;font-size:1.4em!important}.btn:hover{cursor:pointer}.page-number{font-size:1.4em!important}.btn-delete{color:#db2828;cursor:pointer;font-weight:700;height:20px;position:absolute;right:30px;width:20px;z-index:5}.btn-delete.is-hidden{opacity:.2;pointer-events:none}.cms-media-autocomplete .dropdown.icon{pointer-events:none}.cms-media-autocomplete .search{cursor:pointer!important}.bb-collection-item{margin-bottom:1em}.bb-collection-item-delete{margin-top:5px!important}.cke_notifications_area{display:none}.help-text{font-size:12px;margin-top:-10px;opacity:.5} \ No newline at end of file diff --git a/src/Resources/public/build/sylius-cms-admin.js b/src/Resources/public/build/sylius-cms-admin.js new file mode 100644 index 000000000..e1bee5273 --- /dev/null +++ b/src/Resources/public/build/sylius-cms-admin.js @@ -0,0 +1,2 @@ +/*! For license information please see sylius-cms-admin.js.LICENSE.txt */ +(()=>{var t={461:()=>{$(document).ready((function(){$(".bitbag-media-autocomplete, .sylius-autocomplete").each((function(t,e){$(e).autoComplete()}));var t="#sylius_cms_page_contentElements",e=$(t).length?t:"#sylius_cms_block_contentElements";$(e).length&&($(document).on("collection-form-add",(function(){$(".bitbag-media-autocomplete, .sylius-autocomplete").each((function(t,e){void 0===$._data($(e).get(0),"events")&&$(e).autoComplete()})),$("".concat(e,' [data-form-collection="item"]')).each((function(t,e){$(document).loadContentConfiguration(e)}))})),$.fn.extend({loadContentConfiguration:function(t){t.querySelector("".concat(e,' select[name*="type"]')).onchange=function(){var t=this.parentElement,e=document.createElement("div"),r=this.selectedOptions[0];e.innerHTML=r.getAttribute("data-configuration");var n=t.nextElementSibling;t.parentElement.replaceChild(e,n);var o=n.querySelector("input");o||(o=n.querySelector("textarea"));var i=o.getAttribute("name"),a=e.querySelectorAll("input");a.length||(a=e.querySelectorAll("textarea")),a.forEach((function(t){var r=t.getAttribute("name");r&&(r=i.replace(i.substring(i.indexOf("[configuration]")+15),r.substring(r.indexOf("configuration")+13)),$(t).attr("name",r),$(e).find(".bitbag-media-autocomplete").autoComplete(),$(e).find(".sylius-autocomplete").autoComplete())}))}}}),$("".concat(e,' [data-form-collection="item"]')).each((function(t,e){$(document).loadContentConfiguration(e)})),$(document).loadContentConfiguration(document.querySelector("".concat(e,' [data-form-collection="item"]'))))}))}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(()=>{"use strict";r(461);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{textField:"data-bb-cms-text",fileField:"data-bb-cms-file"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.textField=document.querySelector("[".concat(e.textField,"]")),this.fileField=document.querySelector("[".concat(e.fileField,"]"))},n=[{key:"init",value:function(){if("object"!==t(this.config))throw new Error("Bitbag CMS Plugin - HandleCsvUpload class config is not a valid object");this._handleFields()}},{key:"_handleFields",value:function(){this._handleTextField(),this._handleFileField()}},{key:"_handleTextField",value:function(){var t=this;this.textField.addEventListener("click",(function(){t.fileField.click()}))}},{key:"_handleFileField",value:function(){var t=this;this.fileField.addEventListener("change",(function(e){t.textField.value=e.target.files[0].name}))}}],n&&e(r.prototype,n),o&&e(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();const i=function(t,e,r){var n=new CustomEvent("".concat("bb",".").concat(e),{detail:r});return t.dispatchEvent(n),t};function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function S(){}var _={};f(_,c,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,c)&&(_=L);var x=S.prototype=b.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=d(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(e,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function c(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)}))}}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{wrappersIndicator:"data-bb-cms-wrapper",lockFieldIndicator:"data-bb-cms-toggle-slug",bbTarget:"sylius_cms_page",nameField:"sylius_cms_page_name"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wrappers=document.querySelectorAll("[".concat(e.wrappersIndicator,"]")),this.lockFieldIndicator="[".concat(e.lockFieldIndicator,"]"),this.bbTarget=e.bbTarget,this.config=e,this.nameField=document.getElementById("".concat(e.nameField))},e=[{key:"init",value:function(){if("object"!==l(this.config))throw new Error("Bitbag CMS Plugin - HandleSlugUpdate class config is not a valid object");if("string"!=typeof this.lockFieldIndicator||"string"!=typeof this.bbTarget)throw new Error("Bitbag CMS Plugin - HandleSlugUpdate class config key values are not valid strings");if(!this.nameField)throw new Error("Bitbag CMS Plugin - HandleSlugUpdate name field not found");this._handleFields()}},{key:"_handleFields",value:function(){var t=this;this.wrappers.forEach((function(e){var r=e.dataset.locale,n=e.querySelector("#".concat(t.bbTarget,"_translations_").concat(r,"_slug"));if(n||(n=e.querySelector("#".concat(t.bbTarget,"_slug"))),n){var o;t.nameField.addEventListener("input",(function(e){e.preventDefault(),n.readOnly||(clearTimeout(o),o=setTimeout((function(){t._updateSlug(n,t.nameField.value)}),1e3))}));var i=e.querySelector(t.lockFieldIndicator);i&&i.addEventListener("click",(function(e){e.preventDefault(),t._toggleSlugModification(n,i)}))}}))}},{key:"_updateSlug",value:(o=u(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i(e,"cms.slug.update.start"),e.parentNode.classList.add("loading"),t.next=4,this._getValidSlug(e.dataset.url,r);case 4:e.value=t.sent,e.parentNode.classList.remove("loading"),i(e,"cms.slug.update.end");case 7:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"_getValidSlug",value:(n=u(a().mark((function t(e,r){var n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(e,"?name=").concat(encodeURIComponent(r)));case 3:return n=t.sent,t.next=6,n.json();case 6:return o=t.sent,t.abrupt("return",o.slug);case 10:t.prev=10,t.t0=t.catch(0),console.error("BitBag CMS Plugin - HandleSlugUpdate class error : ".concat(t.t0));case 13:case"end":return t.stop()}}),t,null,[[0,10]])}))),function(t,e){return n.apply(this,arguments)})},{key:"_toggleSlugModification",value:function(t,e){t.readOnly=!t.readOnly;var r=e.querySelector("i");r.classList.toggle("lock"),r.classList.toggle("unlock")}}],e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function S(){}var _={};l(_,a,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(F([])));L&&L!==r&&n.call(L,a)&&(_=L);var x=S.prototype=b.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==m(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function p(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function y(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{previewButton:"data-bb-cms-preview-btn",previewModal:"data-bb-cms-preview-modal",channelSwitch:"data-bb-cms-channel",localeSwitch:"data-bb-cms-locale"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.button=document.querySelector("[".concat(e.previewButton,"]")),this.modal=document.querySelector("[".concat(e.previewModal,"]")),this.modalSelector=e.previewModal,this.channelSelector=e.channelSwitch,this.localeSelector=e.localeSwitch},e=[{key:"init",value:function(){if("object"!==m(this.config))throw new Error("Bitbag CMS Plugin - HandlePreview class config is not a valid object");if("string"!=typeof this.localeSelector||"string"!=typeof this.channelSelector||"string"!=typeof this.modalSelector)throw new Error("Bitbag CMS Plugin - HandlePreview class config key values are not valid strings");this._resourcePreview()}},{key:"_$_CKEDITOR_MODAL_SHOW",value:function(){return $("[".concat(this.modalSelector,"]")).modal("show")}},{key:"_$_CKEDITOR_UPDATE_INSTANCES",value:function(){y(CKEDITOR.instances).forEach((function(t){return t.updateElement()}))}},{key:"_resourcePreview",value:function(){var t=this;this.button.addEventListener("click",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()})),document.querySelector("[".concat(this.channelSelector,"]")).addEventListener("change",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()})),document.querySelector("[".concat(this.localeSelector,"]")).addEventListener("change",(function(e){e.preventDefault(),t._$_CKEDITOR_UPDATE_INSTANCES,t._createPreview(),t._$_CKEDITOR_MODAL_SHOW()}))}},{key:"_createPreview",value:(n=d().mark((function t(){var e,r,n,o,a,c,u,l,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.modal.querySelector(".ui.loadable").classList.add("loading"),this.modal.disabled=!0,e=document.querySelector("[".concat(this.channelSelector,"]")).value,r=document.querySelector("[".concat(this.localeSelector,"]")).value,n=this.button.dataset.url,o=this.button.closest("form"),a={method:"POST",body:new FormData(o)},t.prev=7,i(this.modal,"cms.create.preview.start"),t.next=11,fetch("".concat(n,"?_channel_code=").concat(e,"&_locale=").concat(r),a);case 11:return c=t.sent,t.next=14,c.text();case 14:u=t.sent,l=new Blob([u],{type:"text/html",charset:"utf-8"}),s=window.URL.createObjectURL(l),this.modal.querySelector("iframe").src=s,i(this.modal,"cms.create.preview.completed",u),t.next=25;break;case 21:t.prev=21,t.t0=t.catch(7),console.error("BitBag CMS Plugin - HandlePreview class error : ".concat(t.t0)),i(this.modal,"cms.create.preview.error",t.t0);case 25:return t.prev=25,this.modal.querySelector(".ui.loadable").classList.remove("loading"),this.modal.disabled=!1,i(this.modal,"cms.create.preview.end"),t.finish(25);case 30:case"end":return t.stop()}}),t,this,[[7,21,25,30]])})),o=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){p(i,r,o,a,c,"next",t)}function c(t){p(i,r,o,a,c,"throw",t)}a(void 0)}))},function(){return o.apply(this,arguments)})}],e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function S(){S=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new I(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",y="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(F([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==k(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{bbMediaContainer:"data-bb-cms-autocomplete",choiceName:"data-bb-cms-choice-name",choiceValue:"data-bb-cms-choice-value",criteriaType:"data-bb-cms-criteria-type",criteriaName:"data-bb-cms-criteria-name",editUrl:"data-bb-cms-load-edit-url",nameMessage:"data-bb-cms-name-message",deleteButton:"data-bb-cms-delete-selected",choosenPreview:"data-bb-cms-selected-image",selectMenu:"data-bb-cms-selection-menu",selectInput:"data-bb-cms-image-select",placeholder:"data-bb-cms-placeholder",limit:30};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e,this.mediaContainers=document.querySelectorAll("[".concat(e.bbMediaContainer,"]")),this.deleteButton="[".concat(e.deleteButton,"]"),this.selectMenu="[".concat(e.selectMenu,"]"),this.selectInput="[".concat(e.selectInput,"]"),this.placeholder="[".concat(e.placeholder,"]")},e=[{key:"init",value:function(){var t=this;if("object"!==k(this.config))throw new Error("Bitbag CMS Plugin - HandleAutoComplete class config is not a valid object");this.mediaContainers.forEach((function(e){t._handleSavedValue(e),t._handleImageChoice(e),t._handleResetBtn(e)}))}},{key:"_handleResetBtn",value:function(t){var e=this,r=t.querySelector(this.deleteButton);""!==t.querySelector("input[type=hidden]").value?(r.classList.remove("is-hidden"),r.addEventListener("click",(function(){e._resetValues(t)}))):r.classList.add("is-hidden")}},{key:"_handleImageChoice",value:function(t){var e,r=this;t.querySelector(this.selectInput).addEventListener("click",(function(e){e.preventDefault(),r._getMediaImages(t)})),t.querySelector(this.selectInput).addEventListener("input",(function(n){n.preventDefault(),clearTimeout(e),e=setTimeout((function(){r._getMediaImages(t,n.target.value)}),500)})),t.querySelector("input[type=hidden]").addEventListener("change",(function(e){e.preventDefault(),r._handleResetBtn(t)}))}},{key:"_handleSavedValue",value:(o=x(S().mark((function t(e){var r,n,o,a,c,u,l;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!==e.querySelector("input[type=hidden]").value){t.next=2;break}return t.abrupt("return");case 2:return r="".concat(e.dataset.bbCmsLoadEditUrl,"?").concat(e.querySelector("input[type=hidden]").value.split(",").filter(String).map((function(t){return"code[]=".concat(t)})).join("&")),t.prev=3,i(e,"cms.media.saved.reload.start"),e.classList.add("loading"),t.next=8,fetch(r);case 8:return n=t.sent,t.next=11,n.json();case 11:o=t.sent,this._addToSelectMenu(o,e),a=[],null!==(c=e.querySelector(this.selectMenu))&&(a=c.children),u=_(a);try{for(u.s();!(l=u.n()).done;)l.value.click()}catch(t){u.e(t)}finally{u.f()}i(e,"cms.media.saved.reload.completed",o),t.next=25;break;case 21:t.prev=21,t.t0=t.catch(3),console.error("BitBag CMS Plugin - HandleAutoComplete class error : ".concat(t.t0)),i(e,"cms.media.saved.reload.error",t.t0);case 25:return t.prev=25,e.classList.remove("loading"),i(e,"cms.media.saved.reload.end"),t.finish(25);case 29:case"end":return t.stop()}}),t,this,[[3,21,25,29]])}))),function(t){return o.apply(this,arguments)})},{key:"_getMediaImages",value:(n=x(S().mark((function t(e){var r,n,o,a,c,u,l,s,f=arguments;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=f.length>1&&void 0!==f[1]&&f[1],n=e.dataset.bbCmsUrl,o=e.dataset.bbCmsCriteriaType,a=r?"&criteria[search][value]=".concat(r):"",c="".concat(n,"&limit=").concat(this.config.limit,"&criteria[search][type]=").concat(o,"&criteria[search][value]=").concat(a),t.prev=5,i(e,"cms.media.display.start"),e.classList.add("loading"),t.next=10,fetch(c);case 10:return u=t.sent,t.next=13,u.json();case 13:l=t.sent,s=l._embedded.items,this._addToSelectMenu(s,e),i(e,"cms.media.display.completed",l),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(5),console.error("BitBag CMS Plugin - HandleAutoComplete class error : ".concat(t.t0)),i(e,"cms.media.display.error",t.t0);case 23:return t.prev=23,e.classList.remove("loading"),i(e,"cms.media.display.end"),t.finish(23);case 27:case"end":return t.stop()}}),t,this,[[5,19,23,27]])}))),function(t){return n.apply(this,arguments)})},{key:"_resetValues",value:function(t){i(t,"cms.media.reset.start"),t.querySelector("input[type=hidden]").value="",t.querySelector(this.selectMenu).innerHTML="",t.querySelector(this.placeholder).innerHTML="",i(t,"cms.media.reset.end")}},{key:"_addToSelectMenu",value:function(t,e){var r=this;i(e,"cms.media.display.update.start");var n=e.querySelector(this.selectMenu);n.innerHTML="",null!==t&&t.forEach((function(t){n.insertAdjacentHTML("beforeend",r._itemTemplate(t.path,t.code.trim()))})),i(e,"cms.media.display.update.end")}},{key:"_itemTemplate",value:function(t,e){return'
').concat(e,"
")}}],e&&j(t.prototype,e),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function C(t,e){for(var r=0;r0&&(new h).init(),document.querySelectorAll("[data-bb-cms-preview-btn]").length>0&&(new w).init(),document.querySelector('[data-bb-target="cms-handle-autocomplete"]')&&(new P).init(),document.querySelector(".collection-type-items")&&(new F).init(),document.querySelector("[data-bb-cms-load-template]")&&(new N).init()})()})(); \ No newline at end of file diff --git a/src/Resources/public/build/sylius-cms-admin.js.LICENSE.txt b/src/Resources/public/build/sylius-cms-admin.js.LICENSE.txt new file mode 100644 index 000000000..ae386fb79 --- /dev/null +++ b/src/Resources/public/build/sylius-cms-admin.js.LICENSE.txt @@ -0,0 +1 @@ +/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ diff --git a/src/Resources/public/build/sylius-cms-shop.css b/src/Resources/public/build/sylius-cms-shop.css new file mode 100644 index 000000000..fa24c6ec9 --- /dev/null +++ b/src/Resources/public/build/sylius-cms-shop.css @@ -0,0 +1 @@ +.cms-block{margin-bottom:20px}.cms-block img{max-width:100%}.carousel-wrapper{position:relative}.carousel-wrapper .carousel{margin:0 -1em}.carousel-wrapper .carousel-nav .carousel-left{left:30px}.carousel-wrapper .carousel-nav .carousel-right{right:30px}.carousel-wrapper .carousel-nav .carousel-left,.carousel-wrapper .carousel-nav .carousel-right{position:absolute;top:50%;transform:translateY(-50%)}.carousel-wrapper .carousel-item{padding:5px 1em}.teaser__content{margin-top:10px}.teaser__description{margin-top:5px}.teaser__read-more{display:block;margin-top:20px}[class^=cms_content_element__]:not(:last-child){margin-bottom:1rem} \ No newline at end of file diff --git a/src/Resources/public/build/sylius-cms-shop.js b/src/Resources/public/build/sylius-cms-shop.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/Resources/public/js/ckeditor-plugins/dialogs/index.js b/src/Resources/public/js/ckeditor-plugins/dialogs/index.js index f5cbafb3f..130e7450f 100644 --- a/src/Resources/public/js/ckeditor-plugins/dialogs/index.js +++ b/src/Resources/public/js/ckeditor-plugins/dialogs/index.js @@ -1,9 +1,3 @@ -/* - This file was created by developers working at BitBag - Do you need more information about us and what we do? Visit our https://bitbag.io website! - We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - let oldValue = null; let phrase = ''; let currentPage = 1; diff --git a/src/Resources/public/js/ckeditor-plugins/image/plugin.js b/src/Resources/public/js/ckeditor-plugins/image/plugin.js index d992f2be3..2dd595991 100644 --- a/src/Resources/public/js/ckeditor-plugins/image/plugin.js +++ b/src/Resources/public/js/ckeditor-plugins/image/plugin.js @@ -1,9 +1,3 @@ -/* - This file was created by developers working at BitBag - Do you need more information about us and what we do? Visit our https://bitbag.io website! - We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - CKEDITOR.plugins.add('mediaImage', { icons: 'mediaimage', init(editor) { diff --git a/src/Resources/public/js/ckeditor-plugins/video/plugin.js b/src/Resources/public/js/ckeditor-plugins/video/plugin.js index 3ffce1eea..ab61e9eeb 100644 --- a/src/Resources/public/js/ckeditor-plugins/video/plugin.js +++ b/src/Resources/public/js/ckeditor-plugins/video/plugin.js @@ -1,9 +1,3 @@ -/* - This file was created by developers working at BitBag - Do you need more information about us and what we do? Visit our https://bitbag.io website! - We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career -*/ - CKEDITOR.plugins.add('mediaVideo', { icons: 'mediavideo', init(editor) { diff --git a/src/Resources/translations/messages.cs.yml b/src/Resources/translations/messages.cs.yml index f63a89a22..138695e21 100755 --- a/src/Resources/translations/messages.cs.yml +++ b/src/Resources/translations/messages.cs.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: collections: Kolekce blocks: Bloky diff --git a/src/Resources/translations/messages.cs_CZ.yml b/src/Resources/translations/messages.cs_CZ.yml index f63a89a22..138695e21 100755 --- a/src/Resources/translations/messages.cs_CZ.yml +++ b/src/Resources/translations/messages.cs_CZ.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: collections: Kolekce blocks: Bloky diff --git a/src/Resources/translations/messages.de.yml b/src/Resources/translations/messages.de.yml index 1d58b5d60..8a6c8b76e 100755 --- a/src/Resources/translations/messages.de.yml +++ b/src/Resources/translations/messages.de.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Blöcke block: Block diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index 1a948ceab..9d160b4b0 100755 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Blocks block: Block diff --git a/src/Resources/translations/messages.es.yml b/src/Resources/translations/messages.es.yml index d868601ca..53ee94a2b 100755 --- a/src/Resources/translations/messages.es.yml +++ b/src/Resources/translations/messages.es.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Bloques block: Bloque diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index e63e3436f..4bf0e5c34 100755 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Blocs block: Bloc diff --git a/src/Resources/translations/messages.hr.yml b/src/Resources/translations/messages.hr.yml index c2ce3ee42..9c4f08be5 100755 --- a/src/Resources/translations/messages.hr.yml +++ b/src/Resources/translations/messages.hr.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Blokovi block: Blok diff --git a/src/Resources/translations/messages.lt.yml b/src/Resources/translations/messages.lt.yml index b61436900..1613f8ddf 100644 --- a/src/Resources/translations/messages.lt.yml +++ b/src/Resources/translations/messages.lt.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Blokai block: Blokas diff --git a/src/Resources/translations/messages.nl.yml b/src/Resources/translations/messages.nl.yml index 593236a30..3ee4aee72 100755 --- a/src/Resources/translations/messages.nl.yml +++ b/src/Resources/translations/messages.nl.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Blokken block: Blok diff --git a/src/Resources/translations/messages.pl.yml b/src/Resources/translations/messages.pl.yml index 60111e84f..c56192f43 100755 --- a/src/Resources/translations/messages.pl.yml +++ b/src/Resources/translations/messages.pl.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Bloki block: Blok diff --git a/src/Resources/translations/messages.ru.yml b/src/Resources/translations/messages.ru.yml index e791f2fa1..15f0d76f7 100755 --- a/src/Resources/translations/messages.ru.yml +++ b/src/Resources/translations/messages.ru.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Блоки block: Блок diff --git a/src/Resources/translations/messages.sk.yml b/src/Resources/translations/messages.sk.yml index 7755e99d9..c06934c17 100644 --- a/src/Resources/translations/messages.sk.yml +++ b/src/Resources/translations/messages.sk.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Bloky block: Blok diff --git a/src/Resources/translations/messages.uk.yml b/src/Resources/translations/messages.uk.yml index 877787130..0aa6e91a3 100755 --- a/src/Resources/translations/messages.uk.yml +++ b/src/Resources/translations/messages.uk.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: ui: blocks: Блоки block: Блок diff --git a/src/Resources/translations/validators.cs.yml b/src/Resources/translations/validators.cs.yml index 04d2f6cae..874a9aa40 100644 --- a/src/Resources/translations/validators.cs.yml +++ b/src/Resources/translations/validators.cs.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Pouze PNG, SVG a JPEG soubory jsou povoleny. diff --git a/src/Resources/translations/validators.de.yml b/src/Resources/translations/validators.de.yml index 56254cdce..1174bffb7 100755 --- a/src/Resources/translations/validators.de.yml +++ b/src/Resources/translations/validators.de.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Nur PNG, SVG und JPEG Dateien sind erlaubt. diff --git a/src/Resources/translations/validators.en.yml b/src/Resources/translations/validators.en.yml index 9bdc6b924..34b174ba3 100755 --- a/src/Resources/translations/validators.en.yml +++ b/src/Resources/translations/validators.en.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Only PNG, SVG and JPEG files are allowed. diff --git a/src/Resources/translations/validators.es.yml b/src/Resources/translations/validators.es.yml index f7f531190..99682d19a 100755 --- a/src/Resources/translations/validators.es.yml +++ b/src/Resources/translations/validators.es.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Solo se permiten archivos PNG, SVG y JPEG. diff --git a/src/Resources/translations/validators.fr.yml b/src/Resources/translations/validators.fr.yml index 4047a473a..d28c80914 100755 --- a/src/Resources/translations/validators.fr.yml +++ b/src/Resources/translations/validators.fr.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Seuls les fichiers PNG, SVG et JPEG sont autorisés. diff --git a/src/Resources/translations/validators.hr.yml b/src/Resources/translations/validators.hr.yml index 9100c21a7..cab29c8da 100755 --- a/src/Resources/translations/validators.hr.yml +++ b/src/Resources/translations/validators.hr.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Samo su PNG, SVG ili JPG formati dopušteni. diff --git a/src/Resources/translations/validators.lt.yml b/src/Resources/translations/validators.lt.yml index d232adee1..fb91f3259 100644 --- a/src/Resources/translations/validators.lt.yml +++ b/src/Resources/translations/validators.lt.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Leidžiami tik PNG ir JPEG formatų failai. diff --git a/src/Resources/translations/validators.nl.yml b/src/Resources/translations/validators.nl.yml index 4434b1d01..d12575455 100755 --- a/src/Resources/translations/validators.nl.yml +++ b/src/Resources/translations/validators.nl.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Alleen PNG, SVG en JPEG bestanden zijn toegestaan. diff --git a/src/Resources/translations/validators.pl.yml b/src/Resources/translations/validators.pl.yml index c56e7bc79..e27a4c7b3 100755 --- a/src/Resources/translations/validators.pl.yml +++ b/src/Resources/translations/validators.pl.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Only PNG, SVG and JPEG files are allowed. diff --git a/src/Resources/translations/validators.ru.yml b/src/Resources/translations/validators.ru.yml index c3001f00c..8b71515b4 100755 --- a/src/Resources/translations/validators.ru.yml +++ b/src/Resources/translations/validators.ru.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Только PNG, SVG или JPEG. diff --git a/src/Resources/translations/validators.sk.yml b/src/Resources/translations/validators.sk.yml index e21f54d9f..1aff25712 100755 --- a/src/Resources/translations/validators.sk.yml +++ b/src/Resources/translations/validators.sk.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Iba PNG, SVG a JPEG súbory sú povolené. diff --git a/src/Resources/translations/validators.uk.yml b/src/Resources/translations/validators.uk.yml index 2955ba818..b106ad07a 100755 --- a/src/Resources/translations/validators.uk.yml +++ b/src/Resources/translations/validators.uk.yml @@ -1,4 +1,4 @@ -bitbag_sylius_cms_plugin: +sylius_cms: block: image: mime_types: Тільки PNG, SVG чи JPEG. diff --git a/src/Resources/views/Block/Crud/_form.html.twig b/src/Resources/views/Block/Crud/_form.html.twig index f6fb33f31..31310485e 100755 --- a/src/Resources/views/Block/Crud/_form.html.twig +++ b/src/Resources/views/Block/Crud/_form.html.twig @@ -1,8 +1,8 @@ -{% from '@BitBagSyliusCmsPlugin/Macro/translationForm.html.twig' import translationForm %} -{% form_theme form '@BitBagSyliusCmsPlugin/Form/theme.html.twig' %} +{% from '@SyliusCmsPlugin/Macro/translationForm.html.twig' import translationForm %} +{% form_theme form '@SyliusCmsPlugin/Form/theme.html.twig' %} -{% include '@BitBagSyliusCmsPlugin/Modal/_resourcePreview.html.twig' %} -{% include '@BitBagSyliusCmsPlugin/Modal/_loadTemplateConfirmation.html.twig' %} +{% include '@SyliusCmsPlugin/Modal/_resourcePreview.html.twig' %} +{% include '@SyliusCmsPlugin/Modal/_loadTemplateConfirmation.html.twig' %}
-

{{ 'bitbag_sylius_cms_plugin.ui.manage_block_display'|trans }}

+

{{ 'sylius_cms.ui.manage_block_display'|trans }}

{{ form_row(form.products) }} {{ form_row(form.productsInTaxons) }} {{ form_row(form.taxons) }} @@ -33,8 +33,8 @@
-

{{ 'bitbag_sylius_cms_plugin.ui.content_elements.title'|trans }}

- {% include '@BitBagSyliusCmsPlugin/Template/form.html.twig' with {ajax_url: path('bitbag_sylius_cms_plugin_admin_ajax_template_content_by_id', {'id': 'REPLACE_ID'}) } %} +

{{ 'sylius_cms.ui.content_elements.title'|trans }}

+ {% include '@SyliusCmsPlugin/Template/form.html.twig' with {ajax_url: path('sylius_cms_admin_ajax_template_content_by_id', {'id': 'REPLACE_ID'}) } %}
{{ form_row(form.contentElements) }} diff --git a/src/Resources/views/Block/preview.html.twig b/src/Resources/views/Block/preview.html.twig index b34fb16e0..9d8eb74cb 100755 --- a/src/Resources/views/Block/preview.html.twig +++ b/src/Resources/views/Block/preview.html.twig @@ -7,7 +7,7 @@ {% block content %}
- {{ bitbag_cms_render_content_elements(block) }} + {{ sylius_cms_render_content_elements(block) }}
{% endblock %} diff --git a/src/Resources/views/Collection/Crud/_form.html.twig b/src/Resources/views/Collection/Crud/_form.html.twig index cd5b3c5a9..afc93a9c2 100755 --- a/src/Resources/views/Collection/Crud/_form.html.twig +++ b/src/Resources/views/Collection/Crud/_form.html.twig @@ -1,5 +1,5 @@ {% from '@SyliusAdmin/Macro/translationForm.html.twig' import translationForm %} -{% form_theme form '@BitBagSyliusCmsPlugin/Form/theme.html.twig' %} +{% form_theme form '@SyliusCmsPlugin/Form/theme.html.twig' %} {{ form_errors(form) }} diff --git a/src/Resources/views/ContentConfiguration/_action.html.twig b/src/Resources/views/ContentConfiguration/_action.html.twig index b7f55e28c..fd98adfe9 100644 --- a/src/Resources/views/ContentConfiguration/_action.html.twig +++ b/src/Resources/views/ContentConfiguration/_action.html.twig @@ -1,4 +1,4 @@ -{% form_theme field '@BitBagSyliusCmsPlugin/Form/theme.html.twig' %} +{% form_theme field '@SyliusCmsPlugin/Form/theme.html.twig' %} {{ form_row(field) }} diff --git a/src/Resources/views/CrudUi/create.html.twig b/src/Resources/views/CrudUi/create.html.twig index 98ae01951..3b81f7165 100755 --- a/src/Resources/views/CrudUi/create.html.twig +++ b/src/Resources/views/CrudUi/create.html.twig @@ -1,4 +1,4 @@ -{% extends '@BitBagSyliusCmsPlugin/layout.html.twig' %} +{% extends '@SyliusCmsPlugin/layout.html.twig' %} {% import '@SyliusUi/Macro/headers.html.twig' as headers %} diff --git a/src/Resources/views/CrudUi/index.html.twig b/src/Resources/views/CrudUi/index.html.twig index 02ed75bde..f658effd1 100644 --- a/src/Resources/views/CrudUi/index.html.twig +++ b/src/Resources/views/CrudUi/index.html.twig @@ -1,4 +1,4 @@ -{% extends '@BitBagSyliusCmsPlugin/layout.html.twig' %} +{% extends '@SyliusCmsPlugin/layout.html.twig' %} {% import '@SyliusUi/Macro/headers.html.twig' as headers %} diff --git a/src/Resources/views/CrudUi/update.html.twig b/src/Resources/views/CrudUi/update.html.twig index bb2f65af1..40080fd98 100755 --- a/src/Resources/views/CrudUi/update.html.twig +++ b/src/Resources/views/CrudUi/update.html.twig @@ -1,4 +1,4 @@ -{% extends '@BitBagSyliusCmsPlugin/layout.html.twig' %} +{% extends '@SyliusCmsPlugin/layout.html.twig' %} {% import '@SyliusUi/Macro/headers.html.twig' as headers %} {% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} diff --git a/src/Resources/views/Form/theme.html.twig b/src/Resources/views/Form/theme.html.twig index 6b2a39579..290dc6dee 100755 --- a/src/Resources/views/Form/theme.html.twig +++ b/src/Resources/views/Form/theme.html.twig @@ -1,38 +1,38 @@ {% extends '@SyliusUi/Form/theme.html.twig' %} -{% block bitbag_collection_autocomplete_choice_row %} - {{ form_row(form, {'remote_url': path('bitbag_sylius_cms_plugin_admin_ajax_collection_by_name_phrase'), 'load_edit_url': path('bitbag_sylius_cms_plugin_admin_ajax_collection_by_code')}) }} +{% block sylius_collection_autocomplete_choice_row %} + {{ form_row(form, {'remote_url': path('sylius_cms_admin_ajax_collection_by_name_phrase'), 'load_edit_url': path('sylius_cms_admin_ajax_collection_by_code')}) }} {% endblock %} -{% block bitbag_page_collection_autocomplete_choice_row %} - {{ form_row(form, {'remote_url': path('bitbag_sylius_cms_plugin_admin_ajax_page_collection_by_name_phrase'), 'load_edit_url': path('bitbag_sylius_cms_plugin_admin_ajax_collection_by_code')}) }} +{% block sylius_page_collection_autocomplete_choice_row %} + {{ form_row(form, {'remote_url': path('sylius_cms_admin_ajax_page_collection_by_name_phrase'), 'load_edit_url': path('sylius_cms_admin_ajax_collection_by_code')}) }} {% endblock %} -{% block bitbag_page_autocomplete_choice_row %} - {{ form_row(form, {'remote_url': path('bitbag_sylius_cms_plugin_admin_ajax_page_by_name_phrase'), 'load_edit_url': path('bitbag_sylius_cms_plugin_admin_ajax_page_by_code')}) }} +{% block sylius_page_autocomplete_choice_row %} + {{ form_row(form, {'remote_url': path('sylius_cms_admin_ajax_page_by_name_phrase'), 'load_edit_url': path('sylius_cms_admin_ajax_page_by_code')}) }} {% endblock %} -{% block bitbag_block_autocomplete_choice_row %} - {{ form_row(form, {'remote_url': path('bitbag_sylius_cms_plugin_admin_ajax_block_by_name_phrase'), 'load_edit_url': path('bitbag_sylius_cms_plugin_admin_ajax_block_by_code')}) }} +{% block sylius_block_autocomplete_choice_row %} + {{ form_row(form, {'remote_url': path('sylius_cms_admin_ajax_block_by_name_phrase'), 'load_edit_url': path('sylius_cms_admin_ajax_block_by_code')}) }} {% endblock %} -{% block bitbag_template_page_autocomplete_choice_row %} - {{ form_row(form, {'remote_url': path('bitbag_sylius_cms_plugin_admin_ajax_template_page_by_name_phrase'), 'load_edit_url': path('bitbag_sylius_cms_plugin_admin_ajax_template_by_id')}) }} +{% block sylius_template_page_autocomplete_choice_row %} + {{ form_row(form, {'remote_url': path('sylius_cms_admin_ajax_template_page_by_name_phrase'), 'load_edit_url': path('sylius_cms_admin_ajax_template_by_id')}) }} {% endblock %} -{% block bitbag_template_block_autocomplete_choice_row %} - {{ form_row(form, {'remote_url': path('bitbag_sylius_cms_plugin_admin_ajax_template_block_by_name_phrase'), 'load_edit_url': path('bitbag_sylius_cms_plugin_admin_ajax_template_by_id')}) }} +{% block sylius_template_block_autocomplete_choice_row %} + {{ form_row(form, {'remote_url': path('sylius_cms_admin_ajax_template_block_by_name_phrase'), 'load_edit_url': path('sylius_cms_admin_ajax_template_by_id')}) }} {% endblock %} -{% block bitbag_media_autocomplete_choice_row %} +{% block sylius_media_autocomplete_choice_row %}
{{- form_label(form) -}}