diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f4fb43e..6c524ca 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -71,8 +71,6 @@ jobs: - run: make test.yaml - - run: make test.twig - - run: make test.schema - run: make test.container diff --git a/README.md b/README.md index d6b6736..8e65055 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Sylius Plus Adapter Plugin -This plugin offer tools to adapt your plugins to Sylius Plus ACL system. +This plugin offer tools to adapt your plugins to Sylius Plus RBAC system. There is no point in installing this plugin directly on Sylius Plus app at this time. @@ -37,9 +37,9 @@ sylius_resource: ### Add permissions on routes -It's a Sylius native feature, you don't have to install this plugin ! +It's a Sylius native feature, you don't have to install this plugin! You just have to add `permission: true` on your route definition. -If you do this, your route will decame available on the permission tree. +If you do this, your route will become available on the permission tree. #### Example @@ -127,7 +127,7 @@ class FooSyliusBarPluginExtension extends Extension implements PrependExtensionI $container, 'foo_bar_my_resource', // This is the grid name '%foo_bar.model.my_resource.class%', // This is the resource class as in your original grid - "expr:service('foo_bar.repository.my_resource').createListQueryBuilder('%locale%')" // This is the original query builder but as an expression call + "expr:service('foo_bar.repository.my_resource').createListQueryBuilder('%locale%')" // This is the original query builder but called as an expression ); } } @@ -139,7 +139,7 @@ To filter the channel choice type with channel restriction, you need to include #### Example -***Your current resource forme type*** +***Your current resource form type*** ```php namespace Foo\SyliusBarPlugin\Form\Type; @@ -190,10 +190,10 @@ class FooSyliusBarPluginExtension extends Extension implements PrependExtensionI ## Development Because this plugin is a kind of sidekick for your plugins, it's not intended to be used in a standalone project. -Even more because it requires Sylius Plus to be useful. Our traditionnal test application then seems useless. +Even more because it requires Sylius Plus to be useful. Our traditional test application then seems useless. But to be fair, we still added a test app with our CMS plugin installed and configured to use the `SyliusPlusCompatibilityTrait` trait. -It would be useful to be sure that everything is working as expected in a normal Sylius event if this plugin is installed and used. +It would be useful to be sure that everything is working as expected in a normal Sylius even if this plugin is installed and used. ## License diff --git a/src/DependencyInjection/SyliusPlusCompatibilityTrait.php b/src/DependencyInjection/SyliusPlusCompatibilityTrait.php index 19ad2fb..6204161 100644 --- a/src/DependencyInjection/SyliusPlusCompatibilityTrait.php +++ b/src/DependencyInjection/SyliusPlusCompatibilityTrait.php @@ -26,7 +26,7 @@ public function enabledFilteredChannelChoiceType(ContainerBuilder $container, ar return; } - // For each type with a channel choice list to filter we crate a "virtual" type extension based on the FilteredChannelChoiceTypeExtension + // For each type with a channel choice list to filter we create a "virtual" type extension based on the FilteredChannelChoiceTypeExtension // class to override channel(s) fields of original types. foreach ($extendables as $code => $type) { $container->setDefinition( @@ -71,14 +71,14 @@ public function replaceInGridOriginalQueryBuilderWithChannelRestrictedQueryBuild return; } - // Add alias because class name in `expr:service` seems not working + // Add alias because class name in `expr:service` seems to not work $container->setAlias( 'monsieurbiz_cms_page.sylius_plus_adapter.channel_restricted_query_builder', ChannelRestrictionQueryBuilderInterface::class )->setPublic(true); // Override grid repository method to use a kind of decorator around the original query builder to add - // channel restritions if needed. + // channel restrictions if needed. $container->loadFromExtension('sylius_grid', [ 'grids' => [$grid => ['driver' => ['options' => [ 'class' => $class, diff --git a/src/Form/Extension/FilteredChannelChoiceTypeExtension.php b/src/Form/Extension/FilteredChannelChoiceTypeExtension.php index c62f689..aecc403 100644 --- a/src/Form/Extension/FilteredChannelChoiceTypeExtension.php +++ b/src/Form/Extension/FilteredChannelChoiceTypeExtension.php @@ -84,8 +84,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void return; } - // In case of multiple channels and channel restriction, we need to save the channels that are not available - // To avoid loosing them when saving the form + // In case of multiple channels and channel restriction, we need to save the channels that are not available + // To avoid losing them when saving the form $form = $event->getForm(); /** @var array $availableChannels */ $availableChannels = $form->get(self::CHANNELS)->getConfig()->getOptions()['choices'] ?? [];