diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index 772dcf408..e996e3f9c 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -538,7 +538,6 @@ class ExportController extends AbstractController $formFormatter->submit($dataFormatter); $dataFormatter = $formFormatter->getData(); } - dump($dataExport); return [ 'centers' => $dataCenters['centers'], diff --git a/src/Bundle/ChillMainBundle/Controller/ExportGenerationController.php b/src/Bundle/ChillMainBundle/Controller/ExportGenerationController.php index aea4049c9..9a5006216 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportGenerationController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportGenerationController.php @@ -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]), ); } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue index 308717bf8..dd492da27 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/App.vue @@ -13,6 +13,8 @@ import DocumentActionButtonsGroup from "ChillDocStoreAssets/vuejs/DocumentAction interface AppProps { exportGenerationId: string; + title: string; + createdDate: string; } const props = defineProps(); @@ -26,6 +28,7 @@ const isFetching = computed( ); const isReady = computed(() => status.value === "ready"); const isFailure = computed(() => status.value === "failure"); +const filename = computed(() => `${props.title}-${props.createdDate}`); /** * counter for the number of times that we check for a new status @@ -113,6 +116,7 @@ onMounted(() => {

diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts index 5addad73d..e970e51b9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/DownloadExport/index.ts @@ -9,4 +9,7 @@ if (null === el) { } const exportGenerationId = el?.dataset.exportGenerationId as string; -createApp(App, { exportGenerationId }).mount(el); +const title = el?.dataset.exportTitle as string; +const createdDate = el?.dataset.exportGenerationDate as string; + +createApp(App, { exportGenerationId, title, createdDate }).mount(el); diff --git a/src/Bundle/ChillMainBundle/Resources/views/ExportGeneration/wait.html.twig b/src/Bundle/ChillMainBundle/Resources/views/ExportGeneration/wait.html.twig index b605c04a9..992d72a74 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/ExportGeneration/wait.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/ExportGeneration/wait.html.twig @@ -11,7 +11,11 @@ {% endblock %} {% block content %} -
+