Skip to content

Commit

Permalink
Change all occurences of setono_sylius_peak_wms to setono_sylius_peak
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Jun 20, 2024
1 parent 116d9f8 commit 6831acd
Show file tree
Hide file tree
Showing 39 changed files with 119 additions and 121 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ composer require setono/sylius-peak-wms-plugin
### Add plugin class to your `bundles.php`

Make sure you add it before `SyliusGridBundle`, otherwise you'll get
`You have requested a non-existent parameter "setono_sylius_peak_wms.model.remote_event.class".` exception.
`You have requested a non-existent parameter "setono_sylius_peak.model.upload_order_request.class".` exception.

```php
<?php
Expand All @@ -29,16 +29,16 @@ $bundles = [
### Import routing

```yaml
# config/routes/setono_sylius_peak_wms.yaml
setono_sylius_peak_wms:
# config/routes/setono_sylius_peak.yaml
setono_sylius_peak:
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes.yaml"
```
or if your app doesn't use locales:
```yaml
# config/routes/setono_sylius_peak_wms.yaml
setono_sylius_peak_wms:
# config/routes/setono_sylius_peak.yaml
setono_sylius_peak:
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes_no_locale.yaml"
```
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/PeakController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function index(): Response
$apiError = 'There was an error connecting to the API. Please check your credentials and try again. If you continue to experience issues, did you forget to enable/disable the sandbox?';
}

return $this->render('@SetonoSyliusPeakPlugin/admin/peak_wms/index.html.twig', [
return $this->render('@SetonoSyliusPeakPlugin/admin/peak/index.html.twig', [
'apiError' => $apiError,
'webhooksShouldBeRegistered' => $this->webhookRegistrar->outOfDate(),
]);
Expand All @@ -43,6 +43,6 @@ public function registerWebhooks(): RedirectResponse

$this->addFlash('success', 'Webhooks registered successfully');

return $this->redirectToRoute('setono_sylius_peak_wms_admin_peak_wms_index');
return $this->redirectToRoute('setono_sylius_peak_admin_peak_index');
}
}
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('setono_sylius_peak_wms');
$treeBuilder = new TreeBuilder('setono_sylius_peak');
$rootNode = $treeBuilder->getRootNode();

/** @psalm-suppress UndefinedInterfaceMethod,PossiblyNullReference,MixedMethodCall */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

final class SetonoSyliusPeakWMSExtension extends AbstractResourceExtension implements PrependExtensionInterface
final class SetonoSyliusPeakExtension extends AbstractResourceExtension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container): void
{
Expand All @@ -28,18 +28,18 @@ public function load(array $configs, ContainerBuilder $container): void

$container
->registerForAutoconfiguration(SalesOrderDataMapperInterface::class)
->addTag('setono_sylius_peak_wms.sales_order_data_mapper')
->addTag('setono_sylius_peak.sales_order_data_mapper')
;

$container
->registerForAutoconfiguration(WebhookHandlerInterface::class)
->addTag('setono_sylius_peak_wms.webhook_handler')
->addTag('setono_sylius_peak.webhook_handler')
;

$container->setParameter('setono_sylius_peak_wms.api_key', $config['api_key']);
$container->setParameter('setono_sylius_peak.api_key', $config['api_key']);

$this->registerResources(
'setono_sylius_peak_wms',
'setono_sylius_peak',
SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
$config['resources'],
$container,
Expand All @@ -53,7 +53,7 @@ public function prepend(ContainerBuilder $container): void
$container->prependExtensionConfig('framework', [
'messenger' => [
'buses' => [
'setono_sylius_peak_wms.command_bus' => [
'setono_sylius_peak.command_bus' => [
'middleware' => [
'doctrine_transaction',
'router_context',
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/AddLinkToPeakSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function addLink(OrderShowMenuBuilderEvent $event): void
'uri' => sprintf('https://app%s.peakwms.com/dialog/orderOverview/%d/details', $this->testEnvironment ? '-test' : '', $peakOrderId),
])
->setAttribute('type', 'link')
->setLabel('setono_sylius_peak_wms.ui.view_order_in_peak')
->setLabel('setono_sylius_peak.ui.view_order_in_peak')
->setLabelAttribute('icon', 'external alternate')
->setLabelAttribute('color', 'blue')
;
Expand Down
6 changes: 3 additions & 3 deletions src/EventSubscriber/AddMenuSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public function add(MenuBuilderEvent $event): void
private function addChild(ItemInterface $item): void
{
$item
->addChild('peak_wms', [
'route' => 'setono_sylius_peak_wms_admin_peak_wms_index',
->addChild('setono_sylius_peak', [
'route' => 'setono_sylius_peak_admin_peak_index',
])
->setLabel('setono_sylius_peak_wms.ui.peak_wms')
->setLabel('setono_sylius_peak.ui.peak')
->setLabelAttribute('icon', 'truck')
;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public function add(GridDefinitionConverterEvent $event): void
{
$field = Field::fromNameAndType('peakWMSUploadOrderRequest', 'twig');
$field->setOptions([
'template' => '@SetonoSyliusPeakPlugin/admin/order/grid/field/peak_wms_upload_order_request.html.twig',
'template' => '@SetonoSyliusPeakPlugin/admin/order/grid/field/peak_upload_order_request.html.twig',
'vars' => [
'labels' => '@SetonoSyliusPeakPlugin/admin/order/grid/field/peak_wms_upload_order_request',
'labels' => '@SetonoSyliusPeakPlugin/admin/order/grid/field/peak_upload_order_request',
],
]);
$field->setLabel('setono_sylius_peak_wms.ui.peak_wms_state');
$field->setLabel('setono_sylius_peak.ui.peak_state');

$event->getGrid()->addField($field);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Registrar/WebhookRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private function getWebhooks(): array
$webhooks[] = new Webhook(
name: $name,
url: $this->urlGenerator->generate(
name: 'setono_sylius_peak_wms_global_webhook',
name: 'setono_sylius_peak_global_webhook',
parameters: ['name' => $name],
referenceType: UrlGeneratorInterface::ABSOLUTE_URL,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<mapped-superclass name="Setono\SyliusPeakPlugin\Model\RegisteredWebhooks"
table="setono_sylius_peak_wms__registered_webhooks">
table="setono_sylius_peak__registered_webhooks">
<id name="id" type="integer">
<generator strategy="AUTO"/>
</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<mapped-superclass name="Setono\SyliusPeakPlugin\Model\UploadOrderRequest"
table="setono_sylius_peak_wms__upload_order_request">
table="setono_sylius_peak__upload_order_request">
<id name="id" type="integer">
<generator strategy="AUTO"/>
</id>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
setono_sylius_peak_wms_global:
setono_sylius_peak_global:
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes/global.yaml"

setono_sylius_peak_wms_admin:
setono_sylius_peak_admin:
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes/admin.yaml"
prefix: /admin
12 changes: 6 additions & 6 deletions src/Resources/config/routes/admin.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
setono_sylius_peak_wms_admin_peak_wms_index:
path: /peak-wms
setono_sylius_peak_admin_peak_index:
path: /peak
methods: [GET,POST]
defaults:
_controller: setono_sylius_peak_wms.controller.admin.peak_wms::index
_controller: setono_sylius_peak.controller.admin.peak::index

setono_sylius_peak_wms_admin_peak_wms_register_webhooks:
path: /peak-wms/register-webhooks
setono_sylius_peak_admin_peak_register_webhooks:
path: /peak/register-webhooks
methods: [GET]
defaults:
_controller: setono_sylius_peak_wms.controller.admin.peak_wms::registerWebhooks
_controller: setono_sylius_peak.controller.admin.peak::registerWebhooks
8 changes: 3 additions & 5 deletions src/Resources/config/routes/global.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# todo since this plugin will support Symfony 5.4 we need to create our own Webhook implementation
setono_sylius_peak_wms_global_webhook:
path: /peak-wms/webhook
setono_sylius_peak_global_webhook:
path: /peak/webhook
defaults:
_controller: webhook.controller::handle
type: 'peak_wms'
_controller: setono_sylius_peak.controller.handle_webhook
4 changes: 2 additions & 2 deletions src/Resources/config/routes_no_locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# localized URLs (see https://docs.sylius.com/en/latest/cookbook/shop/disabling-localised-urls.html).
# To accommodate this in your plugin, provide a routes file for non localized stores and tell this in the README.md

setono_sylius_peak_wms_global:
setono_sylius_peak_global:
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes/global.yaml"

setono_sylius_peak_wms_admin:
setono_sylius_peak_admin:
resource: "@SetonoSyliusPeakPlugin/Resources/config/routes/admin.yaml"
prefix: /admin
4 changes: 2 additions & 2 deletions src/Resources/config/services/client.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak_wms.client" class="Setono\PeakWMS\Client\Client">
<argument>%setono_sylius_peak_wms.api_key%</argument>
<service id="setono_sylius_peak.client" class="Setono\PeakWMS\Client\Client">
<argument>%setono_sylius_peak.api_key%</argument>

<call method="setLogger">
<argument type="service" id="logger"/>
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/config/services/command.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak_wms.command.upload_orders"
<service id="setono_sylius_peak.command.upload_orders"
class="Setono\SyliusPeakPlugin\Command\ProcessCommand">
<argument type="service" id="setono_sylius_peak_wms.processor.upload_order_request"/>
<argument type="service" id="setono_sylius_peak.processor.upload_order_request"/>

<tag name="console.command"/>
</service>

<service id="setono_sylius_peak_wms.command.register_webhooks"
<service id="setono_sylius_peak.command.register_webhooks"
class="Setono\SyliusPeakPlugin\Command\RegisterWebhooksCommand">
<argument type="service" id="setono_sylius_peak_wms.command_bus"/>
<argument type="service" id="setono_sylius_peak.command_bus"/>

<tag name="console.command"/>
</service>
Expand Down
14 changes: 7 additions & 7 deletions src/Resources/config/services/controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak_wms.controller.admin.peak_wms"
<service id="setono_sylius_peak.controller.admin.peak"
class="Setono\SyliusPeakPlugin\Controller\Admin\PeakController" public="true">
<argument type="service" id="setono_sylius_peak_wms.command_bus"/>
<argument type="service" id="setono_sylius_peak_wms.registrar.webhook"/>
<argument type="service" id="setono_sylius_peak_wms.client"/>
<argument type="service" id="setono_sylius_peak.command_bus"/>
<argument type="service" id="setono_sylius_peak.registrar.webhook"/>
<argument type="service" id="setono_sylius_peak.client"/>

<call method="setContainer">
<argument type="service" id="service_container"/>
Expand All @@ -15,10 +15,10 @@
<tag name="controller.service_arguments"/>
</service>

<service id="setono_sylius_peak_wms.controller.handle_webhook"
<service id="setono_sylius_peak.controller.handle_webhook"
class="Setono\SyliusPeakPlugin\Controller\HandleWebhookControllerAction" public="true">
<argument type="service" id="setono_sylius_peak_wms.webhook_parser"/>
<argument type="service" id="setono_sylius_peak_wms.webhook_handler.composite"/>
<argument type="service" id="setono_sylius_peak.webhook_parser"/>
<argument type="service" id="setono_sylius_peak.webhook_handler.composite"/>
</service>
</services>
</container>
10 changes: 5 additions & 5 deletions src/Resources/config/services/data_mapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak_wms.data_mapper.sales_order.composite"
<service id="setono_sylius_peak.data_mapper.sales_order.composite"
class="Setono\SyliusPeakPlugin\DataMapper\CompositeSalesOrderDataMapper">
<argument type="service" id="event_dispatcher"/>
</service>

<service id="setono_sylius_peak_wms.data_mapper.sales_order.default"
<service id="setono_sylius_peak.data_mapper.sales_order.default"
class="Setono\SyliusPeakPlugin\DataMapper\SalesOrderDataMapper">
<tag name="setono_sylius_peak_wms.sales_order_data_mapper" priority="100"/>
<tag name="setono_sylius_peak.sales_order_data_mapper" priority="100"/>
</service>

<service id="setono_sylius_peak_wms.data_mapper.sales_order.order_lines"
<service id="setono_sylius_peak.data_mapper.sales_order.order_lines"
class="Setono\SyliusPeakPlugin\DataMapper\SalesOrderLinesSalesOrderDataMapper">
<argument type="service" id="event_dispatcher"/>

<tag name="setono_sylius_peak_wms.sales_order_data_mapper" priority="90"/>
<tag name="setono_sylius_peak.sales_order_data_mapper" priority="90"/>
</service>
</services>
</container>
10 changes: 5 additions & 5 deletions src/Resources/config/services/event_subscriber.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak_wms.event_subscriber.grid.add_upload_order_request_column_to_order_grid"
<service id="setono_sylius_peak.event_subscriber.grid.add_upload_order_request_column_to_order_grid"
class="Setono\SyliusPeakPlugin\EventSubscriber\Grid\AddUploadOrderRequestColumnToOrderGridSubscriber">
<tag name="kernel.event_subscriber"/>
</service>

<service id="setono_sylius_peak_wms.event_subscriber.add_link_to_peak"
<service id="setono_sylius_peak.event_subscriber.add_link_to_peak"
class="Setono\SyliusPeakPlugin\EventSubscriber\AddLinkToPeakSubscriber">
<argument>%kernel.debug%</argument>

<tag name="kernel.event_subscriber"/>
</service>

<service id="setono_sylius_peak_wms.event_subscriber.add_menu"
<service id="setono_sylius_peak.event_subscriber.add_menu"
class="Setono\SyliusPeakPlugin\EventSubscriber\AddMenuSubscriber">
<tag name="kernel.event_subscriber"/>
</service>

<service id="setono_sylius_peak_wms.event_subscriber.create_upload_order_request"
<service id="setono_sylius_peak.event_subscriber.create_upload_order_request"
class="Setono\SyliusPeakPlugin\EventSubscriber\CreateUploadOrderRequestSubscriber">
<argument type="service" id="doctrine"/>
<argument type="service" id="setono_sylius_peak_wms.factory.upload_order_request"/>
<argument type="service" id="setono_sylius_peak.factory.upload_order_request"/>

<tag name="kernel.event_subscriber"/>
</service>
Expand Down
12 changes: 6 additions & 6 deletions src/Resources/config/services/factory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="setono_sylius_peak_wms.custom_factory.registered_webhooks"
<service id="setono_sylius_peak.custom_factory.registered_webhooks"
class="Setono\SyliusPeakPlugin\Factory\RegisteredWebhooksFactory"
decorates="setono_sylius_peak_wms.factory.registered_webhooks" decoration-priority="64">
<argument type="service" id="setono_sylius_peak_wms.custom_factory.registered_webhooks.inner"/>
decorates="setono_sylius_peak.factory.registered_webhooks" decoration-priority="64">
<argument type="service" id="setono_sylius_peak.custom_factory.registered_webhooks.inner"/>
</service>

<service id="setono_sylius_peak_wms.custom_factory.upload_order_request"
<service id="setono_sylius_peak.custom_factory.upload_order_request"
class="Setono\SyliusPeakPlugin\Factory\UploadOrderRequestFactory"
decorates="setono_sylius_peak_wms.factory.upload_order_request" decoration-priority="64">
<argument type="service" id="setono_sylius_peak_wms.custom_factory.upload_order_request.inner"/>
decorates="setono_sylius_peak.factory.upload_order_request" decoration-priority="64">
<argument type="service" id="setono_sylius_peak.custom_factory.upload_order_request.inner"/>
</service>
</services>
</container>
Loading

0 comments on commit 6831acd

Please sign in to comment.