From 018af36cfc870da980e5c36fa89b7f7468bd6369 Mon Sep 17 00:00:00 2001 From: Marie <51697796+ijreilly@users.noreply.github.com> Date: Mon, 15 Jun 2026 15:24:56 +0200 Subject: [PATCH] Hide logic functions that are not exposed as tools (#21598) each time we create a workflow node that is a logic function, it creates a logic function that is then exposed in the options for future nodes. Let's hide them by only showing here functions that were added by applications that are not the workspace application. If a logic function was meant to be exposed as a tool by an application, it will still show. Decided to go with this as I see no case where we create a logic function from the main app that we want exposed as a tool. image Review in cubic --- .../components/SidePanelWorkflowSelectAction.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx b/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx index 16e2d5fae7..9fcda93f0f 100644 --- a/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx +++ b/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx @@ -1,4 +1,7 @@ +import { isWorkspaceCustomApplication } from '@/applications/utils/isWorkspaceCustomApplication'; +import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState'; import { logicFunctionsSelector } from '@/logic-functions/states/logicFunctionsSelector'; +import { ToolMenuItem } from '@/side-panel/pages/workflow/action/components/ToolMenuItem'; import { WorkflowActionMenuItems } from '@/side-panel/pages/workflow/action/components/WorkflowActionMenuItems'; import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { type WorkflowActionType } from '@/workflow/types/Workflow'; @@ -9,7 +12,6 @@ import { CORE_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constan import { FLOW_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/FlowActions'; import { HUMAN_INPUT_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/HumanInputActions'; import { RECORD_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/RecordActions'; -import { ToolMenuItem } from '@/side-panel/pages/workflow/action/components/ToolMenuItem'; import { useLingui } from '@lingui/react/macro'; import { isDefined } from 'twenty-shared/utils'; @@ -26,9 +28,13 @@ export const SidePanelWorkflowSelectAction = ({ const { t } = useLingui(); const logicFunctions = useAtomStateValue(logicFunctionsSelector); + const currentWorkspace = useAtomStateValue(currentWorkspaceState); - const toolFunctions = logicFunctions.filter((fn) => - isDefined(fn.workflowActionTriggerSettings), + const toolFunctions = logicFunctions.filter( + (fn) => + isDefined(fn.workflowActionTriggerSettings) && + isDefined(fn.applicationId) && + !isWorkspaceCustomApplication({ id: fn.applicationId }, currentWorkspace), ); const handleActionClick = (actionType: WorkflowActionType) => {