Skip to content

Commit 7644c46

Browse files
author
Maxime
authored
Merge pull request #269 from delyriand/chore/fix-case
Replace camelCase with snake_case in template paths
2 parents 94a6b8a + 3b69bc5 commit 7644c46

File tree

86 files changed

+95
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+95
-81
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ monsieurbiz_sylius_richeditor:
242242
app.google_maps:
243243
title: 'app.ui_element.google_maps.title'
244244
description: 'app.ui_element.google_maps.description'
245-
icon: map pin
245+
icon: tabler:brand-google-maps
246246
classes:
247247
form: App\Form\Type\UiElement\GoogleMapsType
248248
#ui_element: App\UiElement\MyUiElement
249249
templates:
250-
admin_render: '/Admin/UiElement/google_maps.html.twig'
251-
front_render: '/Shop/UiElement/google_maps.html.twig'
250+
admin_render: '/admin/ui_element/google_maps.html.twig'
251+
front_render: '/shop/ui_element/google_maps.html.twig'
252252
tags: []
253253
```
254254

@@ -299,7 +299,7 @@ use MonsieurBiz\SyliusRichEditorPlugin\Attribute\AsUiElement;
299299
300300
#[AsUiElement(
301301
code: 'app.google_maps',
302-
icon: 'map pin',
302+
icon: 'tabler:brand-google-maps',
303303
)]
304304
class GoogleMapsType extends AbstractType
305305
// ...
@@ -309,8 +309,8 @@ The title, description and templates values are generated automatically from the
309309

310310
- the title will be `app.ui_element.google_maps.title`,
311311
- the description will be `app.ui_element.google_maps.description`,
312-
- the admin template will be `/Admin/UiElement/google_maps.html.twig`,
313-
- and the front template will be `/Shop/UiElement/google_maps.html.twig`.
312+
- the admin template will be `/admin/ui_element/google_maps.html.twig`,
313+
- and the front template will be `/shop/ui_element/google_maps.html.twig`.
314314

315315
But you can override them if you want:
316316

@@ -319,10 +319,10 @@ But you can override them if you want:
319319
code: 'app.google_maps',
320320
title: 'my_cusom.title', // Use your own translation key or a string
321321
description: 'my_custom.description',
322-
icon: 'map pin',
322+
icon: 'tabler:brand-google-maps',
323323
templates: new TemplatesUiElement(
324-
adminRender: 'MyCusomPath/google_maps.html.twig',
325-
frontRender: 'MyCusomPath/google_maps.html.twig',
324+
adminRender: 'admin/my_custom_path/google_maps.html.twig',
325+
frontRender: 'shop/my_custom_path/google_maps.html.twig',
326326
),
327327
uiElement: GoogleMapsUiElement::class, // Use your own UiElement class
328328
tags: ['map'], // Add some tags to filter the UiElement
@@ -396,21 +396,21 @@ It will be displayed in the admin form to help the user to understand what the U
396396
The file can be either:
397397
* An SVG with a `.twig` extension. Example: `button.svg.twig`.
398398
* A classic twig template. Example `button.html.twig`.
399-
You can add the files in the folder : `templates/MonsieurBizSyliusRichEditorPlugin/Wireframe/*.{svg/html}.twig`
399+
You can add the files in the folder : `templates/MonsieurBizSyliusRichEditorPlugin/wireframe/*.{svg/html}.twig`
400400
In the YAML declaration of a UI Element, you can add the wireframe key with the name of the file without the extension.
401401
```yaml
402402
monsieurbiz.title:
403403
alias: title
404404
title: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.title.title'
405405
description: 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.title.description'
406-
icon: heading
406+
icon: tabler:heading
407407
wireframe: title
408408
tags: [ default ]
409409
classes:
410410
form: MonsieurBiz\SyliusRichEditorPlugin\Form\Type\UiElement\TitleType
411411
templates:
412-
admin_render: '@MonsieurBizSyliusRichEditorPlugin/Admin/UiElement/title.html.twig'
413-
front_render: '@MonsieurBizSyliusRichEditorPlugin/Shop/UiElement/title.html.twig'
412+
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/title.html.twig'
413+
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/title.html.twig'
414414
```
415415

416416
## Wysiwyg Type

UPGRADE-3.1.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Upgrade from v3.0 to v3.1
2+
3+
- Template paths are replaced by snake case in the attribute and maker to match with the new naming convention in Sylius:
4+
- `Admin/UiElement/` is now `admin/ui_element/`
5+
- `Shop/UiElement/` is now `shop/ui_element/`
6+
- All template paths in the plugin are updated to match the new naming convention:
7+
- `Admin/` is now `admin/`
8+
- `Admin/UiElement/` is now `admin/ui_element/`
9+
- `Admin/formContainer.html.twig` is now `admin/form_container.html.twig`
10+
- `Form/` is now `form/`
11+
- `Icon/Ux` is now `icon/ux/`
12+
- `Shop/` is now `shop/`
13+
- `Shop/UiElement/` is now `shop/ui_element/`
14+
- `Wireframe/` is now `wireframe/`

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"extra": {
4747
"branch-alias": {
48-
"dev-master": "3.0-dev"
48+
"dev-master": "3.1-dev"
4949
},
5050
"symfony": {
5151
"docker": false,

dist/config/packages/monsieurbiz_sylius_rich_editor_plugin_custom.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ monsieurbiz_sylius_richeditor:
44
# app.google_maps:
55
# title: 'app.ui_element.google_maps.title'
66
# description: 'app.ui_element.google_maps.description'
7-
# icon: map pin
7+
# icon: tabler:brand-google-maps
88
# tags: [ map ]
99
# classes:
1010
# form: App\Form\Type\UiElement\GoogleMapsType
1111
# ui_element: App\UiElement\GoogleMapsUiElement
1212
# templates:
13-
# admin_render: '/Admin/UiElement/google_maps.html.twig'
14-
# front_render: '/Shop/UiElement/google_maps.html.twig'
13+
# admin_render: '/admin/ui_element/google_maps.html.twig'
14+
# front_render: '/shop/ui_element/google_maps.html.twig'
1515
app.noseeme:
1616
title: 'You should not see me'
1717
description: 'The invisible Ui Element'
@@ -20,8 +20,8 @@ monsieurbiz_sylius_richeditor:
2020
classes:
2121
form: MonsieurBiz\SyliusRichEditorPlugin\Form\Type\UiElement\TextType
2222
templates:
23-
admin_render: '@MonsieurBizSyliusRichEditorPlugin/Admin/UiElement/text.html.twig'
24-
front_render: '@MonsieurBizSyliusRichEditorPlugin/Shop/UiElement/text.html.twig'
23+
admin_render: '@MonsieurBizSyliusRichEditorPlugin/admin/ui_element/text.html.twig'
24+
front_render: '@MonsieurBizSyliusRichEditorPlugin/shop/ui_element/text.html.twig'
2525

2626
sylius_fixtures:
2727
suites:
File renamed without changes.
File renamed without changes.

dist/templates/Admin/UiElement/product_collection.html.twig renamed to dist/templates/admin/ui_element/product_collection.html.twig

File renamed without changes.

dist/templates/Admin/UiElement/text_collection.html.twig renamed to dist/templates/admin/ui_element/text_collection.html.twig

File renamed without changes.

dist/templates/bundles/MonsieurBizSyliusRichEditorPlugin/Wireframe/google-maps.svg.twig renamed to dist/templates/bundles/MonsieurBizSyliusRichEditorPlugin/wireframe/google-maps.svg.twig

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)