Add title and creation date to export data handling

Enhanced export functionality by including `title` and `createdDate` in data passed to the Vue app. Updated controllers, templates, and components to handle and display the new fields, improving export file naming and user interface. Removed a debug `dump` call for cleaner code.
This commit is contained in:
2025-03-13 17:36:47 +01:00
parent 70ca4acafb
commit fb806a9579
5 changed files with 18 additions and 4 deletions

View File

@@ -538,7 +538,6 @@ class ExportController extends AbstractController
$formFormatter->submit($dataFormatter);
$dataFormatter = $formFormatter->getData();
}
dump($dataExport);
return [
'centers' => $dataCenters['centers'],

View File

@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Controller;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\MainBundle\Entity\ExportGeneration;
use Chill\MainBundle\Export\ExportManager;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@@ -28,6 +29,7 @@ final readonly class ExportGenerationController
private Security $security,
private Environment $twig,
private SerializerInterface $serializer,
private ExportManager $exportManager,
) {}
#[Route('/{_locale}/main/export-generation/{id}/wait', methods: ['GET'], name: 'chill_main_export-generation_wait')]
@@ -37,8 +39,10 @@ final readonly class ExportGenerationController
throw new AccessDeniedHttpException('Only users can download an export');
}
$export = $this->exportManager->getExport($exportGeneration->getExportAlias());
return new Response(
$this->twig->render('@ChillMain/ExportGeneration/wait.html.twig', ['exportGeneration' => $exportGeneration]),
$this->twig->render('@ChillMain/ExportGeneration/wait.html.twig', ['exportGeneration' => $exportGeneration, 'export' => $export]),
);
}