mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 06:44:59 +00:00
Regenerate data from saved export on formatter test
[ci-skip]
This commit is contained in:
@@ -297,8 +297,18 @@ class ExportController extends AbstractController
|
||||
$isGenerate = strpos($step, 'generate_') === 0;
|
||||
|
||||
$options = match ($step) {
|
||||
'export', 'generate_export' => ['picked_centers' => $exportManager->getPickedCenters($data['centers'])],
|
||||
default => [],
|
||||
'export', 'generate_export' => [
|
||||
'export_alias' => $alias,
|
||||
'picked_centers' => $exportManager->getPickedCenters($data['centers'])
|
||||
],
|
||||
'formatter', 'generate_formatter' => [
|
||||
'export_alias' => $alias,
|
||||
'formatter_alias' => $exportManager->getFormatterAlias($data['export']),
|
||||
'aggregator_aliases' => $exportManager->getUsedAggregatorsAliases($data['export']),
|
||||
],
|
||||
default => [
|
||||
'export_alias' => $alias,
|
||||
],
|
||||
};
|
||||
|
||||
$defaultFormData = match ($savedExport) {
|
||||
@@ -318,26 +328,15 @@ class ExportController extends AbstractController
|
||||
);
|
||||
|
||||
if ('centers' === $step || 'generate_centers' === $step) {
|
||||
$builder->add('centers', PickCenterType::class, [
|
||||
'export_alias' => $alias,
|
||||
]);
|
||||
$builder->add('centers', PickCenterType::class, $options);
|
||||
}
|
||||
|
||||
if ('export' === $step || 'generate_export' === $step) {
|
||||
$builder->add('export', ExportType::class, [
|
||||
'export_alias' => $alias,
|
||||
'picked_centers' => $exportManager->getPickedCenters($data['centers']),
|
||||
]);
|
||||
$builder->add('export', ExportType::class, $options);
|
||||
}
|
||||
|
||||
if ('formatter' === $step || 'generate_formatter' === $step) {
|
||||
$builder->add('formatter', FormatterType::class, [
|
||||
'formatter_alias' => $exportManager
|
||||
->getFormatterAlias($data['export']),
|
||||
'export_alias' => $alias,
|
||||
'aggregator_aliases' => $exportManager
|
||||
->getUsedAggregatorsAliases($data['export']),
|
||||
]);
|
||||
$builder->add('formatter', FormatterType::class, $options);
|
||||
}
|
||||
|
||||
$builder->add('submit', SubmitType::class, [
|
||||
|
Reference in New Issue
Block a user