mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
Prepare for moving into monorepo
This commit is contained in:
7
src/Bundle/ChillCustomFields/config/routes.yaml
Normal file
7
src/Bundle/ChillCustomFields/config/routes.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
chill_customfields_customfieldsgroup:
|
||||
resource: "@ChillCustomFieldsBundle/config/routes/customfieldsgroup.yaml"
|
||||
prefix: /
|
||||
|
||||
chill_customfields_customfield:
|
||||
resource: "@ChillCustomFieldsBundle/config/routes/customfield.yaml"
|
||||
prefix: /
|
27
src/Bundle/ChillCustomFields/config/routes/customfield.yaml
Normal file
27
src/Bundle/ChillCustomFields/config/routes/customfield.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
customfield_section:
|
||||
path: /{_locale}/admin/customfield/
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:Admin:index" }
|
||||
options:
|
||||
menus:
|
||||
admin_section:
|
||||
order: 1000
|
||||
label: "Custom fields configuration"
|
||||
icons: ['asterisk']
|
||||
|
||||
customfield_new:
|
||||
path: /{_locale}/admin/customfield/new
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomField:new" }
|
||||
|
||||
customfield_create:
|
||||
path: /{_locale}/admin/customfield/create
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomField:create" }
|
||||
methods: [POST]
|
||||
|
||||
customfield_edit:
|
||||
path: /{_locale}/admin/customfield/{id}/edit
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomField:edit" }
|
||||
|
||||
customfield_update:
|
||||
path: /{_locale}/admin/customfield/{id}/update
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomField:update" }
|
||||
methods: [POST, PUT]
|
@@ -0,0 +1,39 @@
|
||||
customfieldsgroup:
|
||||
path: /{_locale}/admin/customfieldsgroup/
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:index" }
|
||||
options:
|
||||
menus:
|
||||
admin_custom_fields:
|
||||
order: 1010
|
||||
label: "CustomFields Groups"
|
||||
|
||||
customfieldsgroup_show:
|
||||
path: /{_locale}/admin/customfieldsgroup/{id}/show
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:show" }
|
||||
|
||||
customfieldsgroup_makedefault:
|
||||
path: /{_locale}/admin/customfieldsgroup/make_default
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:makeDefault" }
|
||||
|
||||
customfieldsgroup_new:
|
||||
path: /{_locale}/admin/customfieldsgroup/new
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:new" }
|
||||
|
||||
customfieldsgroup_create:
|
||||
path: /{_locale}/admin/customfieldsgroup/create
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:create" }
|
||||
methods: POST
|
||||
|
||||
customfieldsgroup_edit:
|
||||
path: /{_locale}/admin/customfieldsgroup/{id}/edit
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:edit" }
|
||||
|
||||
customfieldsgroup_update:
|
||||
path: /{_locale}/admin/customfieldsgroup/{id}/update
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:update" }
|
||||
methods: [POST, PUT]
|
||||
|
||||
customfieldsgroup_delete:
|
||||
path: /{_locale}/admin/customfieldsgroup/{id}/delete
|
||||
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:delete" }
|
||||
methods: [POST, DELETE]
|
140
src/Bundle/ChillCustomFields/config/services.yaml
Normal file
140
src/Bundle/ChillCustomFields/config/services.yaml
Normal file
@@ -0,0 +1,140 @@
|
||||
parameters:
|
||||
# cl_custom_fields.example.class: Chill\CustomFieldsBundle\Example
|
||||
|
||||
services:
|
||||
|
||||
chill.custom_field.provider:
|
||||
class: Chill\CustomFieldsBundle\Service\CustomFieldProvider
|
||||
calls:
|
||||
- [setContainer, ["@service_container"]]
|
||||
|
||||
Chill\CustomFieldsBundle\Service\CustomFieldProvider: '@chill.custom_field.provider'
|
||||
|
||||
chill.custom_field.custom_field_choice_type:
|
||||
class: Chill\CustomFieldsBundle\Form\CustomFieldType
|
||||
arguments:
|
||||
- "@chill.custom_field.provider"
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- '@chill.main.helper.translatable_string'
|
||||
tags:
|
||||
- { name: 'form.type', alias: 'custom_field_choice' }
|
||||
|
||||
chill.custom_field.custom_fields_group_type:
|
||||
class: Chill\CustomFieldsBundle\Form\CustomFieldsGroupType
|
||||
arguments:
|
||||
- "%chill_custom_fields.customizables_entities%"
|
||||
- "@translator"
|
||||
tags:
|
||||
- { name: 'form.type', alias: 'custom_fields_group' }
|
||||
|
||||
chill.custom_field.custom_field_type:
|
||||
class: Chill\CustomFieldsBundle\Form\Type\CustomFieldType
|
||||
arguments:
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- "@chill.custom_field.provider"
|
||||
tags:
|
||||
- { name: 'form.type', alias: 'custom_field' }
|
||||
|
||||
chill.custom_field.text:
|
||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldText
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
- "@templating"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: 'chill.custom_field', type: 'text' }
|
||||
|
||||
chill.custom_field.number:
|
||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldNumber
|
||||
arguments:
|
||||
- "@templating"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: 'chill.custom_field', type: 'number' }
|
||||
|
||||
chill.form_extension.post_text_integer:
|
||||
class: Chill\CustomFieldsBundle\Form\Extension\PostTextIntegerExtension
|
||||
tags:
|
||||
- { name: form.type_extension, extended_type: Symfony\Component\Form\Extension\Core\Type\IntegerType }
|
||||
|
||||
chill.form_extension.post_text_number:
|
||||
class: Chill\CustomFieldsBundle\Form\Extension\PostTextNumberExtension
|
||||
tags:
|
||||
- { name: form.type_extension, extended_type: Symfony\Component\Form\Extension\Core\Type\NumberType }
|
||||
|
||||
chill.custom_field.choice:
|
||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice
|
||||
arguments:
|
||||
- "@translator.default"
|
||||
- "@templating"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: 'chill.custom_field', type: 'choice' }
|
||||
|
||||
chill.custom_field.custom_fields_group_linked_custom_fields:
|
||||
class: Chill\CustomFieldsBundle\Form\Type\LinkedCustomFieldsType
|
||||
arguments:
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: form.type, alias: custom_fields_group_linked_custom_fields }
|
||||
|
||||
chill.custom_field.custom_fields_title_type:
|
||||
class: Chill\CustomFieldsBundle\Form\Type\CustomFieldsTitleType
|
||||
tags:
|
||||
- { name: 'form.type', alias: 'custom_field_title' }
|
||||
|
||||
chill.custom_field.title:
|
||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldTitle
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
- "@templating"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: 'chill.custom_field', type: 'title' }
|
||||
|
||||
chill.custom_field.date:
|
||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldDate
|
||||
arguments:
|
||||
- "@templating"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: 'chill.custom_field', type: 'date' }
|
||||
|
||||
chill.custom_field.helper:
|
||||
class: Chill\CustomFieldsBundle\Service\CustomFieldsHelper
|
||||
arguments:
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- "@chill.custom_field.provider"
|
||||
|
||||
chill.custom_field.twig.custom_fields_rendering:
|
||||
class: Chill\CustomFieldsBundle\Templating\Twig\CustomFieldRenderingTwig
|
||||
arguments:
|
||||
- "@chill.custom_field.helper"
|
||||
calls:
|
||||
- [setContainer, ["@service_container"]]
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
chill.custom_field.twig.custom_fields_group_rendering:
|
||||
class: Chill\CustomFieldsBundle\Templating\Twig\CustomFieldsGroupRenderingTwig
|
||||
calls:
|
||||
- [setContainer, ["@service_container"]]
|
||||
arguments:
|
||||
- "%chill_custom_fields.show_empty_values%"
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
chill.custom_field.custom_field_long_choice:
|
||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldLongChoice
|
||||
arguments:
|
||||
- "@chill.custom_field.custom_field_long_choice_option_repository"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
- "@templating"
|
||||
tags:
|
||||
- { name: 'chill.custom_field', type: 'long_choice' }
|
||||
|
||||
chill.custom_field.custom_field_long_choice_option_repository:
|
||||
class: Chill\CustomFieldsBundle\EntityRepository\CustomFieldLongChoice\OptionRepository
|
||||
factory: ["@doctrine", getRepository]
|
||||
arguments:
|
||||
- "Chill\\CustomFieldsBundle\\Entity\\CustomFieldLongChoice\\Option"
|
10
src/Bundle/ChillCustomFields/config/services/command.yaml
Normal file
10
src/Bundle/ChillCustomFields/config/services/command.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
Chill\CustomFieldsBundle\Command\CreateFieldsOnGroupCommand:
|
||||
arguments:
|
||||
$customFieldProvider: '@chill.custom_field.provider'
|
||||
$entityManager: '@doctrine.orm.default_entity_manager'
|
||||
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
|
||||
$availableLanguages: '%chill_main.available_languages%'
|
||||
$customizablesEntities: '%chill_custom_fields.customizables_entities%'
|
||||
tags:
|
||||
- { name: console.command }
|
19
src/Bundle/ChillCustomFields/config/services/controller.yaml
Normal file
19
src/Bundle/ChillCustomFields/config/services/controller.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
Chill\CustomFieldsBundle\Controller\:
|
||||
resource: '../../Controller'
|
||||
tags: ['controller.service_arguments']
|
||||
|
||||
Chill\CustomFieldsBundle\Controller\CustomFieldsGroupController:
|
||||
arguments:
|
||||
$customFieldProvider: '@chill.custom_field.provider'
|
||||
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
|
||||
tags: ['controller.service_arguments']
|
||||
## TODO
|
||||
## cfr. https://github.com/symfony/symfony/issues/27436#issuecomment-393576416
|
||||
#
|
||||
# " An exception has been thrown during the rendering of a template
|
||||
# ("The "Chill\CustomFieldsBundle\Controller\CustomFieldsGroupController::getParameter()" method is missing a parameter bag
|
||||
# to work properly. Did you forget to register your controller as a service subscriber? This can be fixed
|
||||
# either by using autoconfiguration or by manually wiring a "parameter_bag" in the service locator passed to the controller.").
|
||||
autowire: true
|
||||
autoconfigure: true
|
@@ -0,0 +1,4 @@
|
||||
services:
|
||||
Chill\CustomFieldsBundle\DataFixtures\ORM\:
|
||||
resource: ../../DataFixtures/ORM
|
||||
tags: [ 'doctrine.fixture.orm' ]
|
7
src/Bundle/ChillCustomFields/config/validation.yaml
Normal file
7
src/Bundle/ChillCustomFields/config/validation.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
Chill\CustomFieldsBundle\Entity\CustomField:
|
||||
properties:
|
||||
slug:
|
||||
- Regex:
|
||||
pattern: '/^[0-9a-z\-]{1,}$/'
|
||||
message: Characters not allowed. Only lowercase letters, numbers and "-" are allowed.
|
||||
|
Reference in New Issue
Block a user