From 68d47e954330c906ecb050a0cf4f6685b2d9ad9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bosi?= <71827178+bosiraphael@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:14:04 +0100 Subject: [PATCH] Fix workflow activate last version (#9243) Fix workflow activate last version being displayed when it shouldn't be. --- ...seActivateLastPublishedVersionWorkflowSingleRecordAction.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts index 32f84f673..0c68e1a62 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts +++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/hooks/useActivateLastPublishedVersionWorkflowSingleRecordAction.ts @@ -13,7 +13,8 @@ export const useActivateLastPublishedVersionWorkflowSingleRecordAction: SingleRe isDefined(workflowWithCurrentVersion) && isDefined(workflowWithCurrentVersion.currentVersion.trigger) && isDefined(workflowWithCurrentVersion.lastPublishedVersionId) && - workflowWithCurrentVersion.currentVersion.status !== 'ACTIVE' && + workflowWithCurrentVersion.lastPublishedVersionId !== '' && + !workflowWithCurrentVersion.statuses?.includes('ACTIVE') && isDefined(workflowWithCurrentVersion.currentVersion?.steps) && workflowWithCurrentVersion.currentVersion?.steps.length !== 0;