Skip to content

Commit

Permalink
[Maintenance] Reorganize Route-Related Files (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee authored Dec 11, 2024
2 parents 85d17b2 + 8566b6e commit 94a33a6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
32 changes: 20 additions & 12 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,29 @@
- - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" }
+ - { resource: '@SyliusInvoicingPlugin/config/config.yaml' }
```

The routes have been consolidated into a single `config/routes.yaml` file. It is sufficient to import this file instead of defining each route explicitly:
```yaml
sylius_invoicing:
resource: "@SyliusRefundPlugin/config/routes.yaml"
```
The routes configuration paths:
However, if you have customized the routes, you need to adjust the paths to reflect the new structure:
```diff
sylius_invoicing_plugin_admin:
- resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/admin_invoicing.yml"
- prefix: /admin
+ resource: '@SyliusInvoicingPlugin/config/admin_routes.yaml'
+ prefix: '/%sylius_admin.path_name%'
- sylius_invoicing_plugin_admin:
- resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/admin_invoicing.yml"
- prefix: /admin
+ sylius_invoicing_admin:
+ resource: '@SyliusInvoicingPlugin/config/routes/admin.yaml'
+ prefix: '/%sylius_admin.path_name%'

sylius_invoicing_plugin_shop:
- resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/shop_invoicing.yml"
+ resource: '@SyliusInvoicingPlugin/config/shop_routes.yaml'
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$
- sylius_invoicing_plugin_shop:
- resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/shop_invoicing.yml"
+ sylius_invoicing_shop:
+ resource: '@SyliusInvoicingPlugin/config/routes/shop.yaml'
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$
```
And the paths to assets and templates if you are using them.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sylius_invoicing_admin:
resource: "@SyliusInvoicingPlugin/config/admin_routes.yaml"
resource: "@SyliusInvoicingPlugin/config/routes/admin.yaml"
prefix: /admin

sylius_invoicing_shop:
resource: "@SyliusInvoicingPlugin/config/shop_routes.yaml"
resource: "@SyliusInvoicingPlugin/config/routes/shop.yaml"
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$
File renamed without changes.
File renamed without changes.
17 changes: 5 additions & 12 deletions docs/legacy_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,12 @@
- { resource: '@SyliusInvoicingPlugin/config/config.yaml' }
```
1. Import routing:
1. Import routes:
```yaml
sylius_invoicing_admin:
resource: '@SyliusInvoicingPlugin/config/admin_routes.yaml'
prefix: '/%sylius_admin.path_name%'
sylius_invoicing_shop:
resource: '@SyliusInvoicingPlugin/config/shop_routes.yaml'
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$
```
````yaml
sylius_refund:
resource: "@SyliusInvoicingPlugin/config/routes.yaml"
````
1. Check if you have `wkhtmltopdf` binary. If not, you can download it [here](https://wkhtmltopdf.org/downloads.html).
Expand Down
2 changes: 0 additions & 2 deletions tests/Application/config/packages/sylius_invoicing.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions tests/Application/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sylius_invoicing:
resource: "@SyliusInvoicingPlugin/config/routes.yaml"

0 comments on commit 94a33a6

Please sign in to comment.