From 0439c293056487ae069e1bf3b41cf3173245003b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 7 Nov 2024 21:52:44 +0100 Subject: [PATCH] Prevent workflow execution for finalized transitions Added a check in the workflow-show page script to stop the execution if a transition is marked as finalized (`toFinal`). This ensures that transitions leading to final states are not processed further. --- .../Resources/public/page/workflow-show/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js b/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js index 0f94ac374..7ae5ca621 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js @@ -25,6 +25,10 @@ window.addEventListener('DOMContentLoaded', function() { for (let transition of froms) { for (let input of transition.querySelectorAll('input')) { if (input.checked) { + if ('1' === input.dataset.toFinal) { + return false; + } + if ('1' === input.dataset.isSentExternal) { return false; } @@ -151,6 +155,7 @@ window.addEventListener('DOMContentLoaded', function() { } } } + return true; }, toggle_callback: function (c, dir) { for (let div of c) {