Use better namespacing for configuring workflow signature documents

This commit is contained in:
Julie Lenaerts 2024-07-18 16:03:45 +02:00
parent 72e3325626
commit 7351a35c42
2 changed files with 28 additions and 24 deletions

View File

@ -194,8 +194,8 @@ class ChillMainExtension extends Extension implements
);
$container->setParameter(
'chill_main.id_document_kinds',
$config['id_document_kinds']
'chill_main.workflow_signatures.base_signer.document_kinds',
$config['workflow_signature']['base_signer']['document_kinds']
);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));

View File

@ -151,28 +151,6 @@ class Configuration implements ConfigurationInterface
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
->end() // end of widgets/children
->end() // end of widgets
->arrayNode('id_document_kinds')->defaultValue([])
->arrayPrototype()
->children()
->scalarNode('key')->isRequired()->cannotBeEmpty()
->info('the key stored in database')
->example('id_card')
->end()
->arrayNode('labels')->isRequired()->requiresAtLeastOneElement()
->arrayPrototype()
->children()
->scalarNode('lang')->isRequired()->cannotBeEmpty()
->example('fr')
->end()
->scalarNode('label')->isRequired()->cannotBeEmpty()
->example('Carte de séjour')
->end()
->end()
->end()
->end()
->end()
->end()
->end() // end of document types
->arrayNode('cruds')
->defaultValue([])
->arrayPrototype()
@ -299,6 +277,32 @@ class Configuration implements ConfigurationInterface
->end() // end of root
;
$rootNode->children()
->arrayNode('workflow_signature')
->children()
->arrayNode('base_signer')
->children()
->arrayNode('document_kinds')
->arrayPrototype()
->children()
->scalarNode('key')->cannotBeEmpty()->end()
->arrayNode('labels')
->arrayPrototype()
->children()
->scalarNode('lang')->cannotBeEmpty()->end()
->scalarNode('label')->cannotBeEmpty()->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end();
$rootNode->children()
->arrayNode('add_address')->addDefaultsIfNotSet()->children()
->scalarNode('default_country')->cannotBeEmpty()->defaultValue('BE')->end()