From 78445f0d656e4262bd3b44f13ecaa05a203b0655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 10 Oct 2024 11:39:04 +0200 Subject: [PATCH] fixup! Add message handling for public view creation --- .../Messenger/PostPublicViewMessageHandler.php | 11 +++++++++++ .../translations/messages+intl-icu.fr.yaml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Workflow/Messenger/PostPublicViewMessageHandler.php b/src/Bundle/ChillMainBundle/Workflow/Messenger/PostPublicViewMessageHandler.php index ccf566137..b963b2910 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Messenger/PostPublicViewMessageHandler.php +++ b/src/Bundle/ChillMainBundle/Workflow/Messenger/PostPublicViewMessageHandler.php @@ -68,6 +68,12 @@ final readonly class PostPublicViewMessageHandler implements MessageHandlerInter $dto = new WorkflowTransitionContextDTO($entityWorkflow); $dto->transition = $workflow->getEnabledTransition($entityWorkflow, $placeMetadata[self::TRANSITION_ON_VIEW]); + $this->logger->info( + self::LOG_PREFIX.'Apply transition to workflow after a first view', + ['transition' => $placeMetadata[self::TRANSITION_ON_VIEW], 'entityWorkflowId' => $entityWorkflow->getId(), + 'viewId' => $view->getId()] + ); + $workflow->apply($entityWorkflow, $placeMetadata[self::TRANSITION_ON_VIEW], [ 'context' => $dto, 'transitionAt' => $view->getViewAt(), @@ -85,6 +91,11 @@ final readonly class PostPublicViewMessageHandler implements MessageHandlerInter } } + $this->logger->info( + self::LOG_PREFIX.'No transition applyied for this entityWorkflow after a view', + ['entityWorkflowId' => $entityWorkflow->getId(), 'viewId' => $view->getId()] + ); + $this->entityManager->clear(); } } diff --git a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml index 0b0d8d65d..a759d4bef 100644 --- a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml @@ -79,7 +79,7 @@ workflow: } public_link: shared_explanation_until_remaining: >- - Ce partage sera actif jusqu'au {expireAt, time, short} à {expireAt, time, short}. {viewsCount, plural, + Ce partage sera actif jusqu'au {expireAt, date, long} à {expireAt, time, short}. {viewsCount, plural, =0 {Ce partage n'a pas encore été visualisé} one {Ce partage a été visualisé une fois} other {Ce partage a été visualisé # fois}