Add public workflow view functionality

Introduced the ability to render public views for workflows, including new templates, handlers, and metadata support. Updated entity interfaces and translations to enhance the public sharing of workflow documents.
This commit is contained in:
2024-10-08 15:15:58 +02:00
parent 118ae291e2
commit 3f80d62ca2
12 changed files with 228 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowSend;
use Chill\MainBundle\Workflow\Exception\HandlerNotFoundException;
use Chill\MainBundle\Workflow\Exception\HandlerWithPublicViewNotFoundException;
use Chill\MainBundle\Workflow\Templating\EntityWorkflowViewMetadataDTO;
use Symfony\Component\Workflow\Registry;
/**
@@ -80,13 +81,13 @@ class EntityWorkflowManager
*
* @throws HandlerWithPublicViewNotFoundException if no handler with public view is found
*/
public function renderPublicView(EntityWorkflowSend $entityWorkflowSend): string
public function renderPublicView(EntityWorkflowSend $entityWorkflowSend, EntityWorkflowViewMetadataDTO $metadata): string
{
$entityWorkflow = $entityWorkflowSend->getEntityWorkflowStep()->getEntityWorkflow();
foreach ($this->handlers as $handler) {
if ($handler instanceof EntityWorkflowWithPublicViewInterface && $handler->supports($entityWorkflow)) {
return $handler->renderPublicView($entityWorkflowSend);
return $handler->renderPublicView($entityWorkflowSend, $metadata);
}
}