diff --git a/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsx b/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsx index 19a18079152..73878d48d1a 100644 --- a/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsx +++ b/packages/twenty-front/src/modules/command-menu/constants/CommandMenuPagesConfig.tsx @@ -30,7 +30,7 @@ export const COMMAND_MENU_PAGES_CONFIG = new Map< [CommandMenuPages.ViewCalendarEvent, ], [CommandMenuPages.EditRichText, ], [ - CommandMenuPages.WorkflowStepSelectTriggerType, + CommandMenuPages.WorkflowTriggerSelectType, , ], [CommandMenuPages.WorkflowStepCreate, ], diff --git a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsx b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsx index 97f289b9a6d..8ee72637a7d 100644 --- a/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsx +++ b/packages/twenty-front/src/modules/command-menu/hooks/__tests__/useWorkflowCommandMenu.test.tsx @@ -147,7 +147,7 @@ describe('useWorkflowCommandMenu', () => { expect(result.current.workflowId).toBe('test-workflow-id'); expect(mockNavigateCommandMenu).toHaveBeenCalledWith({ - page: CommandMenuPages.WorkflowStepSelectTriggerType, + page: CommandMenuPages.WorkflowTriggerSelectType, pageTitle: t`Trigger Type`, pageIcon: IconBolt, pageId: 'mocked-uuid', diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.ts index fee19b16a86..ef0d7434da5 100644 --- a/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.ts +++ b/packages/twenty-front/src/modules/command-menu/hooks/useWorkflowCommandMenu.ts @@ -32,7 +32,7 @@ export const useWorkflowCommandMenu = () => { ); navigateCommandMenu({ - page: CommandMenuPages.WorkflowStepSelectTriggerType, + page: CommandMenuPages.WorkflowTriggerSelectType, pageTitle: t`Trigger Type`, pageIcon: IconBolt, pageId, diff --git a/packages/twenty-front/src/modules/command-menu/pages/workflow/step/view-run/components/CommandMenuWorkflowRunViewStepContent.tsx b/packages/twenty-front/src/modules/command-menu/pages/workflow/step/view-run/components/CommandMenuWorkflowRunViewStepContent.tsx index aa14667ae97..3423d57e066 100644 --- a/packages/twenty-front/src/modules/command-menu/pages/workflow/step/view-run/components/CommandMenuWorkflowRunViewStepContent.tsx +++ b/packages/twenty-front/src/modules/command-menu/pages/workflow/step/view-run/components/CommandMenuWorkflowRunViewStepContent.tsx @@ -13,7 +13,6 @@ import { useWorkflowRun } from '@/workflow/hooks/useWorkflowRun'; import { useWorkflowRunIdOrThrow } from '@/workflow/hooks/useWorkflowRunIdOrThrow'; import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrThrow'; import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/states/workflowSelectedNodeComponentState'; -import { WorkflowIteratorSubStepSwitcher } from '@/workflow/workflow-steps/components/WorkflowIteratorSubStepSwitcher'; import { WorkflowRunStepInputDetail } from '@/workflow/workflow-steps/components/WorkflowRunStepInputDetail'; import { WorkflowRunStepNodeDetail } from '@/workflow/workflow-steps/components/WorkflowRunStepNodeDetail'; import { WorkflowRunStepOutputDetail } from '@/workflow/workflow-steps/components/WorkflowRunStepOutputDetail'; @@ -22,6 +21,7 @@ import { type WorkflowRunTabIdType, } from '@/workflow/workflow-steps/types/WorkflowRunTabId'; import { getWorkflowRunStepExecutionStatus } from '@/workflow/workflow-steps/utils/getWorkflowRunStepExecutionStatus'; +import { WorkflowIteratorSubStepSwitcher } from '@/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher'; import styled from '@emotion/styled'; import { isNull } from '@sniptt/guards'; import { isDefined } from 'twenty-shared/utils'; diff --git a/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerType.tsx b/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerType.tsx index 4877cfeaf7d..66469d28c6f 100644 --- a/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerType.tsx +++ b/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerType.tsx @@ -1,17 +1,10 @@ import { useCommandMenuWorkflowIdOrThrow } from '@/command-menu/pages/workflow/hooks/useCommandMenuWorkflowIdOrThrow'; import { CommandMenuWorkflowSelectTriggerTypeContent } from '@/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerTypeContent'; -import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion'; import { getWorkflowVisualizerComponentInstanceId } from '@/workflow/utils/getWorkflowVisualizerComponentInstanceId'; import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext'; -import { isDefined } from 'twenty-shared/utils'; export const CommandMenuWorkflowSelectTriggerType = () => { const workflowId = useCommandMenuWorkflowIdOrThrow(); - const workflow = useWorkflowWithCurrentVersion(workflowId); - - if (!isDefined(workflow)) { - return null; - } return ( { }), }} > - + ); }; diff --git a/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerTypeContent.tsx b/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerTypeContent.tsx index 6ce5b8ac9af..d91c544de0c 100644 --- a/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerTypeContent.tsx +++ b/packages/twenty-front/src/modules/command-menu/pages/workflow/trigger-type/components/CommandMenuWorkflowSelectTriggerTypeContent.tsx @@ -1,9 +1,11 @@ import { useWorkflowCommandMenu } from '@/command-menu/hooks/useWorkflowCommandMenu'; +import { useCommandMenuWorkflowIdOrThrow } from '@/command-menu/pages/workflow/hooks/useCommandMenuWorkflowIdOrThrow'; import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems'; import { useSetRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentState'; +import { useFlowOrThrow } from '@/workflow/hooks/useFlowOrThrow'; import { + type WorkflowTrigger, type WorkflowTriggerType, - type WorkflowWithCurrentVersion, } from '@/workflow/types/Workflow'; import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/states/workflowSelectedNodeComponentState'; import { RightDrawerStepListContainer } from '@/workflow/workflow-steps/components/RightDrawerWorkflowSelectStepContainer'; @@ -13,16 +15,14 @@ import { OTHER_TRIGGER_TYPES } from '@/workflow/workflow-trigger/constants/Other import { useUpdateWorkflowVersionTrigger } from '@/workflow/workflow-trigger/hooks/useUpdateWorkflowVersionTrigger'; import { getTriggerDefaultDefinition } from '@/workflow/workflow-trigger/utils/getTriggerDefaultDefinition'; import { useTheme } from '@emotion/react'; +import { isDefined } from 'twenty-shared/utils'; import { TRIGGER_STEP_ID } from 'twenty-shared/workflow'; import { useIcons } from 'twenty-ui/display'; import { MenuItem } from 'twenty-ui/navigation'; -export const CommandMenuWorkflowSelectTriggerTypeContent = ({ - workflow, -}: { - workflow: WorkflowWithCurrentVersion; -}) => { +export const CommandMenuWorkflowSelectTriggerTypeContent = () => { const { getIcon } = useIcons(); + const workflowId = useCommandMenuWorkflowIdOrThrow(); const { updateTrigger } = useUpdateWorkflowVersionTrigger(); const { activeNonSystemObjectMetadataItems } = @@ -32,6 +32,7 @@ export const CommandMenuWorkflowSelectTriggerTypeContent = ({ workflowSelectedNodeComponentState, ); const { openWorkflowEditStepInCommandMenu } = useWorkflowCommandMenu(); + const flow = useFlowOrThrow(); const handleTriggerTypeClick = ({ type, @@ -43,18 +44,26 @@ export const CommandMenuWorkflowSelectTriggerTypeContent = ({ icon: string; }) => { return async () => { - await updateTrigger( - getTriggerDefaultDefinition({ - defaultLabel, - type, - activeNonSystemObjectMetadataItems, - }), - ); + let updatedTrigger: WorkflowTrigger | null = getTriggerDefaultDefinition({ + defaultLabel, + type, + activeNonSystemObjectMetadataItems, + }); + + if (isDefined(flow.trigger)) { + updatedTrigger = { + ...updatedTrigger, + position: flow.trigger.position, + nextStepIds: flow.trigger.nextStepIds, + }; + } + + await updateTrigger(updatedTrigger); setWorkflowSelectedNode(TRIGGER_STEP_ID); openWorkflowEditStepInCommandMenu( - workflow.id, + workflowId, defaultLabel, getIcon(icon), ); diff --git a/packages/twenty-front/src/modules/command-menu/types/CommandMenuPages.ts b/packages/twenty-front/src/modules/command-menu/types/CommandMenuPages.ts index 24361da50d0..24a4664a9b9 100644 --- a/packages/twenty-front/src/modules/command-menu/types/CommandMenuPages.ts +++ b/packages/twenty-front/src/modules/command-menu/types/CommandMenuPages.ts @@ -6,7 +6,7 @@ export enum CommandMenuPages { ViewCalendarEvent = 'view-calendar-event', EditRichText = 'edit-rich-text', Copilot = 'copilot', - WorkflowStepSelectTriggerType = 'workflow-step-select-trigger-type', + WorkflowTriggerSelectType = 'workflow-trigger-select-type', WorkflowStepCreate = 'workflow-step-create', WorkflowStepEditType = 'workflow-step-edit-type', WorkflowStepView = 'workflow-step-view', diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/__stories__/WorkflowDiagramStepNodeEditableContent.stories.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/__stories__/WorkflowDiagramStepNodeEditableContent.stories.tsx index 97406424e3e..414b44e184f 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/__stories__/WorkflowDiagramStepNodeEditableContent.stories.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/__stories__/WorkflowDiagramStepNodeEditableContent.stories.tsx @@ -2,7 +2,6 @@ import { type Meta, type StoryObj } from '@storybook/react'; import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext'; import { type WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram'; -import { fn } from '@storybook/test'; import '@xyflow/react/dist/style.css'; import { RecoilRoot } from 'recoil'; import { CatalogDecorator, type CatalogStory } from 'twenty-ui/testing'; @@ -123,7 +122,6 @@ export const Catalog: CatalogStory< id: 'story-node', data: ALL_STEPS[0], selected: false, - onDelete: fn(), }, parameters: { pseudo: { hover: ['.hover'] }, diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditable.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditable.tsx index b68a1df8324..6de66d6206d 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditable.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditable.tsx @@ -8,7 +8,6 @@ import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/ import { type WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram'; import { getWorkflowNodeIconKey } from '@/workflow/workflow-diagram/utils/getWorkflowNodeIconKey'; import { WorkflowDiagramStepNodeEditableContent } from '@/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditableContent'; -import { useDeleteStep } from '@/workflow/workflow-steps/hooks/useDeleteStep'; import { useContext } from 'react'; import { useSetRecoilState } from 'recoil'; import { isDefined } from 'twenty-shared/utils'; @@ -29,7 +28,6 @@ export const WorkflowDiagramStepNodeEditable = ({ workflowVisualizerWorkflowIdComponentState, ); - const { deleteStep } = useDeleteStep(); const setWorkflowSelectedNode = useSetRecoilComponentState( workflowSelectedNodeComponentState, ); @@ -64,9 +62,6 @@ export const WorkflowDiagramStepNodeEditable = ({ return; } }} - onDelete={() => { - deleteStep(id); - }} /> ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditableContent.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditableContent.tsx index d3545744979..724a7aba2c7 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditableContent.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramStepNodeEditableContent.tsx @@ -21,8 +21,6 @@ import { useLingui } from '@lingui/react/macro'; import { Position } from '@xyflow/react'; import { useState } from 'react'; import { capitalize, isDefined } from 'twenty-shared/utils'; -import { IconTrash } from 'twenty-ui/display'; -import { FloatingIconButton } from 'twenty-ui/input'; const StyledAddStepButtonContainer = styled.div<{ shouldDisplay: boolean; @@ -38,27 +36,15 @@ const StyledAddStepButtonContainer = styled.div<{ transform: translateX(-50%) translateY(100%); `; -const StyledDeleteButtonContainer = styled.div` - display: flex; - align-items: center; - position: absolute; - right: ${({ theme }) => theme.spacing(-4)}; - bottom: 0; - top: 0; - transform: translateX(100%); -`; - export const WorkflowDiagramStepNodeEditableContent = ({ id, data, selected, onClick, - onDelete, }: { id: string; data: WorkflowDiagramStepNodeData; selected: boolean; - onDelete: () => void; onClick?: () => void; }) => { const { i18n } = useLingui(); @@ -117,16 +103,6 @@ export const WorkflowDiagramStepNodeEditableContent = ({ {data.name} - - {selected && ( - - - - )} {!data.hasNextStepIds && !isConnectionInProgress && ( diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepNodeDetail.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepNodeDetail.tsx index 6e1bb2322d5..964fa0e3da9 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepNodeDetail.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowRunStepNodeDetail.tsx @@ -17,7 +17,7 @@ import { WorkflowEditActionFilter } from '@/workflow/workflow-steps/workflow-act import { WorkflowEditActionFindRecords } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords'; import { WorkflowEditActionFormFiller } from '@/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFiller'; import { WorkflowEditActionHttpRequest } from '@/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest'; -import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-actions/iterator-action/WorkflowEditActionIterator'; +import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowEditActionIterator'; import { WorkflowEditTriggerCronForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm'; import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm'; import { WorkflowEditTriggerManual } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManual'; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepBody.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepBody.tsx index 091a7bcdd8b..a1376f0e27b 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepBody.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepBody.tsx @@ -1,3 +1,6 @@ +import { AppErrorBoundary } from '@/error-handler/components/AppErrorBoundary'; +import { AppErrorDisplay } from '@/error-handler/components/internal/AppErrorDisplay'; +import { type AppErrorDisplayProps } from '@/error-handler/types/AppErrorDisplayProps'; import styled from '@emotion/styled'; const StyledWorkflowStepBody = styled.div` @@ -12,4 +15,29 @@ const StyledWorkflowStepBody = styled.div` row-gap: ${({ theme }) => theme.spacing(4)}; `; -export { StyledWorkflowStepBody as WorkflowStepBody }; +export const WorkflowStepBody = ({ + children, +}: { + children: React.ReactNode; +}) => { + return ( + + ( + + )} + > + {children} + + + ); +}; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepDetail.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepDetail.tsx index b1fa667c755..f221a084168 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepDetail.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepDetail.tsx @@ -16,7 +16,7 @@ import { WorkflowEditActionFilter } from '@/workflow/workflow-steps/workflow-act import { WorkflowEditActionFindRecords } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords'; import { WorkflowEditActionFormBuilder } from '@/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder'; import { WorkflowEditActionHttpRequest } from '@/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest'; -import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-actions/iterator-action/WorkflowEditActionIterator'; +import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowEditActionIterator'; import { WorkflowEditTriggerCronForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm'; import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm'; import { WorkflowEditTriggerManual } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManual'; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowActionFooter.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepFooter.tsx similarity index 72% rename from packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowActionFooter.tsx rename to packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepFooter.tsx index ee7b42e8155..da70f3e9431 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowActionFooter.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepFooter.tsx @@ -6,16 +6,18 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown'; import { RightDrawerFooter } from '@/ui/layout/right-drawer/components/RightDrawerFooter'; import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList'; +import { useDeleteStep } from '@/workflow/workflow-steps/hooks/useDeleteStep'; import { useDuplicateStep } from '@/workflow/workflow-steps/hooks/useDuplicateStep'; import { useTheme } from '@emotion/react'; import { useLingui } from '@lingui/react/macro'; import { useId } from 'react'; -import { IconCopyPlus, IconPencil } from 'twenty-ui/display'; +import { TRIGGER_STEP_ID } from 'twenty-shared/workflow'; +import { IconCopyPlus, IconPencil, IconTrash } from 'twenty-ui/display'; import { Button } from 'twenty-ui/input'; import { MenuItem } from 'twenty-ui/navigation'; import { getOsControlSymbol } from 'twenty-ui/utilities'; -export const WorkflowActionFooter = ({ +export const WorkflowStepFooter = ({ stepId, additionalActions, }: { @@ -28,7 +30,11 @@ export const WorkflowActionFooter = ({ const { duplicateStep } = useDuplicateStep(); const { closeDropdown } = useCloseDropdown(); const workflowId = useCommandMenuWorkflowIdOrThrow(); - const { openWorkflowEditStepTypeInCommandMenu } = useWorkflowCommandMenu(); + const { + openWorkflowEditStepTypeInCommandMenu, + openWorkflowTriggerTypeInCommandMenu, + } = useWorkflowCommandMenu(); + const { deleteStep } = useDeleteStep(); const OptionsDropdown = ( { closeDropdown(dropdownId); - openWorkflowEditStepTypeInCommandMenu(workflowId); + stepId === TRIGGER_STEP_ID + ? openWorkflowTriggerTypeInCommandMenu(workflowId) + : openWorkflowEditStepTypeInCommandMenu(workflowId); }} text={t`Change node type`} LeftIcon={IconPencil} /> + {stepId !== TRIGGER_STEP_ID && ( + { + closeDropdown(dropdownId); + duplicateStep({ stepId }); + }} + text={t`Duplicate node`} + LeftIcon={IconCopyPlus} + /> + )} { closeDropdown(dropdownId); - duplicateStep({ stepId }); + deleteStep(stepId); }} - text={t`Duplicate node`} - LeftIcon={IconCopyPlus} + text={t`Delete node`} + LeftIcon={IconTrash} /> diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowEditActionAiAgent.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowEditActionAiAgent.tsx index bb3210428ff..8adc346106f 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowEditActionAiAgent.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowEditActionAiAgent.tsx @@ -4,8 +4,8 @@ import { SidePanelHeader } from '@/command-menu/components/SidePanelHeader'; import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput'; import { Select } from '@/ui/input/components/Select'; import { type WorkflowAiAgentAction } from '@/workflow/types/Workflow'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { useWorkflowActionHeader } from '@/workflow/workflow-steps/workflow-actions/hooks/useWorkflowActionHeader'; import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker'; import { type AiAgentOutputSchema } from '@/workflow/workflow-variables/types/AiAgentOutputSchema'; @@ -146,7 +146,7 @@ export const WorkflowEditActionAiAgent = ({ readonly={actionOptions.readonly} /> - {!actionOptions.readonly && } + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionServerlessFunction.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionServerlessFunction.tsx index e2b8052ec52..d37bc841989 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionServerlessFunction.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowEditActionServerlessFunction.tsx @@ -38,7 +38,8 @@ import styled from '@emotion/styled'; import { useLingui } from '@lingui/react/macro'; import { SOURCE_FOLDER_NAME } from '@/serverless-functions/constants/SourceFolderName'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; +import { computeNewSources } from '@/serverless-functions/utils/computeNewSources'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { type Monaco } from '@monaco-editor/react'; import { type editor } from 'monaco-editor'; import { AutoTypings } from 'monaco-editor-auto-typings'; @@ -51,7 +52,6 @@ import { IconCode, IconPlayerPlay, useIcons } from 'twenty-ui/display'; import { CodeEditor } from 'twenty-ui/input'; import { useIsMobile } from 'twenty-ui/utilities'; import { useDebouncedCallback } from 'use-debounce'; -import { computeNewSources } from '@/serverless-functions/utils/computeNewSources'; const CODE_EDITOR_MIN_HEIGHT = 343; @@ -488,7 +488,7 @@ export const WorkflowEditActionServerlessFunction = ({ )} {!actionOptions.readonly && ( - - {!actionOptions.readonly && } + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx index 52a9667d54f..2fc76311ce2 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx @@ -6,8 +6,8 @@ import { type WorkflowDeleteRecordAction } from '@/workflow/types/Workflow'; import { useEffect, useState } from 'react'; import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { useWorkflowActionHeader } from '@/workflow/workflow-steps/workflow-actions/hooks/useWorkflowActionHeader'; import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker'; import { useTheme } from '@emotion/react'; @@ -180,7 +180,7 @@ export const WorkflowEditActionDeleteRecord = ({ /> )} - {!actionOptions.readonly && } + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsx index 159bd285182..bd66b323ed5 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsx @@ -17,8 +17,8 @@ import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/ho import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion'; import { workflowVisualizerWorkflowIdComponentState } from '@/workflow/states/workflowVisualizerWorkflowIdComponentState'; import { type WorkflowSendEmailAction } from '@/workflow/types/Workflow'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { useWorkflowActionHeader } from '@/workflow/workflow-steps/workflow-actions/hooks/useWorkflowActionHeader'; import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker'; import { useTheme } from '@emotion/react'; @@ -345,7 +345,7 @@ export const WorkflowEditActionSendEmail = ({ maxWidth={EMAIL_EDITOR_MAX_WIDTH} /> - {!actionOptions.readonly && } + {!actionOptions.readonly && } ) ); diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx index 72368471dde..13ebf67e9d6 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx @@ -1,6 +1,6 @@ import { SidePanelHeader } from '@/command-menu/components/SidePanelHeader'; import { type WorkflowUpdateRecordAction } from '@/workflow/types/Workflow'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { WorkflowUpdateRecordBody } from '@/workflow/workflow-steps/workflow-actions/components/WorkflowUpdateRecordBody'; import { useWorkflowActionHeader } from '@/workflow/workflow-steps/workflow-actions/hooks/useWorkflowActionHeader'; @@ -81,7 +81,7 @@ export const WorkflowEditActionUpdateRecord = ({ onUpdate={handleUpdate} shouldPickRecord={true} /> - {!actionOptions.readonly && } + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx index 3d4389eed2b..0cd503ed509 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx @@ -1,6 +1,6 @@ import { SidePanelHeader } from '@/command-menu/components/SidePanelHeader'; import { type WorkflowUpsertRecordAction } from '@/workflow/types/Workflow'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { WorkflowUpdateRecordBody } from '@/workflow/workflow-steps/workflow-actions/components/WorkflowUpdateRecordBody'; import { useWorkflowActionHeader } from '@/workflow/workflow-steps/workflow-actions/hooks/useWorkflowActionHeader'; @@ -79,7 +79,7 @@ export const WorkflowEditActionUpsertRecord = ({ onUpdate={handleUpdate} shouldPickRecord={false} /> - {!actionOptions.readonly && } + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx index 08a119b4ed8..d5306d9967d 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx @@ -4,8 +4,8 @@ import { FormNumberFieldInput } from '@/object-record/record-field/ui/form-types import { Select } from '@/ui/input/components/Select'; import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth'; import { type WorkflowDelayAction } from '@/workflow/types/Workflow'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { useWorkflowActionHeader } from '@/workflow/workflow-steps/workflow-actions/hooks/useWorkflowActionHeader'; import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker'; import { t } from '@lingui/core/macro'; @@ -219,7 +219,7 @@ export const WorkflowEditActionDelay = ({ )} - + ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilter.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilter.tsx index d95b8386137..4723ab470a1 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilter.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilter.tsx @@ -1,5 +1,6 @@ import { SidePanelHeader } from '@/command-menu/components/SidePanelHeader'; import { type WorkflowFilterAction } from '@/workflow/types/Workflow'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { WorkflowEditActionFilterBody } from '@/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilterBody'; import { WorkflowEditActionFilterBodyEffect } from '@/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilterBodyEffect'; import { StepFilterGroupsComponentInstanceContext } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/context/StepFilterGroupsComponentInstanceContext'; @@ -79,6 +80,7 @@ export const WorkflowEditActionFilter = ({ /> + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx index 66ca5d1c6d2..d677ad3e720 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx @@ -13,8 +13,8 @@ import { type RecordFilter } from '@/object-record/record-filter/types/RecordFil import { RecordIndexContextProvider } from '@/object-record/record-index/contexts/RecordIndexContext'; import { useRecordIndexFieldMetadataDerivedStates } from '@/object-record/record-index/hooks/useRecordIndexFieldMetadataDerivedStates'; import { InputLabel } from '@/ui/input/components/InputLabel'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { WorkflowFindRecordsFilters } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowFindRecordsFilters'; import { WorkflowFindRecordsFiltersEffect } from '@/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowFindRecordsFiltersEffect'; import { useWorkflowActionHeader } from '@/workflow/workflow-steps/workflow-actions/hooks/useWorkflowActionHeader'; @@ -247,7 +247,7 @@ export const WorkflowEditActionFindRecords = ({ }} /> - {!actionOptions.readonly && } + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx index 4df5ed95e33..fb90dfa4650 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx @@ -7,8 +7,8 @@ import { InputLabel } from '@/ui/input/components/InputLabel'; import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem'; import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList'; import { type WorkflowFormAction } from '@/workflow/types/Workflow'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { WorkflowEditActionFormFieldSettings } from '@/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings'; import { WorkflowFormEmptyMessage } from '@/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormEmptyMessage'; import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow-actions/form-action/types/WorkflowFormActionField'; @@ -399,7 +399,7 @@ export const WorkflowEditActionFormBuilder = ({ )} - {!actionOptions.readonly && } + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx index db7a54f3e8d..0e10d59a2e4 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx @@ -11,7 +11,7 @@ import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/Gene import { TabList } from '@/ui/layout/tab-list/components/TabList'; import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState'; import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue'; -import { WorkflowActionFooter } from '@/workflow/workflow-steps/components/WorkflowActionFooter'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { getBodyTypeFromHeaders } from '@/workflow/workflow-steps/workflow-actions/http-request-action/utils/getBodyTypeFromHeaders'; import { isMethodWithBody } from '@/workflow/workflow-steps/workflow-actions/http-request-action/utils/isMethodWithBody'; import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker'; @@ -221,7 +221,7 @@ export const WorkflowEditActionHttpRequest = ({ )} {!actionOptions.readonly && ( - + {!actionOptions.readonly && } ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowIteratorSubStepSwitcher.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx similarity index 100% rename from packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowIteratorSubStepSwitcher.tsx rename to packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx index e48a64c0cfa..03e43a71a2d 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm.tsx @@ -5,6 +5,7 @@ import { Select } from '@/ui/input/components/Select'; import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth'; import { type WorkflowCronTrigger } from '@/workflow/types/Workflow'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { CronExpressionHelperLazy } from '@/workflow/workflow-trigger/components/CronExpressionHelperLazy'; import { CRON_TRIGGER_INTERVAL_OPTIONS } from '@/workflow/workflow-trigger/constants/CronTriggerIntervalOptions'; import { getCronTriggerDefaultSettings } from '@/workflow/workflow-trigger/utils/getCronTriggerDefaultSettings'; @@ -17,6 +18,7 @@ import { t } from '@lingui/core/macro'; import { isNumber } from '@sniptt/guards'; import { useState } from 'react'; import { isDefined } from 'twenty-shared/utils'; +import { TRIGGER_STEP_ID } from 'twenty-shared/workflow'; import { useIcons } from 'twenty-ui/display'; type WorkflowEditTriggerCronFormProps = { @@ -468,6 +470,9 @@ export const WorkflowEditTriggerCronForm = ({ )} + {!triggerOptions.readonly && ( + + )} ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx index a20aeca73db..d59114d30c8 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx @@ -15,6 +15,7 @@ import { WorkflowFieldsMultiSelect } from '@/workflow/components/WorkflowEditUpd import { type WorkflowDatabaseEventTrigger } from '@/workflow/types/Workflow'; import { splitWorkflowTriggerEventName } from '@/workflow/utils/splitWorkflowTriggerEventName'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { getTriggerDefaultLabel } from '@/workflow/workflow-trigger/utils/getTriggerDefaultLabel'; import { getTriggerHeaderType } from '@/workflow/workflow-trigger/utils/getTriggerHeaderType'; import { getTriggerIcon } from '@/workflow/workflow-trigger/utils/getTriggerIcon'; @@ -24,6 +25,7 @@ import styled from '@emotion/styled'; import { Trans } from '@lingui/react/macro'; import { useCallback, useMemo, useState } from 'react'; import { isDefined } from 'twenty-shared/utils'; +import { TRIGGER_STEP_ID } from 'twenty-shared/workflow'; import { IconChevronLeft, IconSettings, useIcons } from 'twenty-ui/display'; import { MenuItem } from 'twenty-ui/navigation'; @@ -284,6 +286,9 @@ export const WorkflowEditTriggerDatabaseEventForm = ({ /> )} + {!triggerOptions.readonly && ( + + )} ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerManual.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerManual.tsx index 93b0b17e37b..127f2105dea 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerManual.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerManual.tsx @@ -6,6 +6,7 @@ import { SelectControl } from '@/ui/input/components/SelectControl'; import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth'; import { type WorkflowManualTrigger } from '@/workflow/types/Workflow'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { MANUAL_TRIGGER_AVAILABILITY_TYPE_OPTIONS } from '@/workflow/workflow-trigger/constants/ManualTriggerAvailabilityTypeOptions'; import { MANUAL_TRIGGER_IS_PINNED_OPTIONS } from '@/workflow/workflow-trigger/constants/ManualTriggerIsPinnedOptions'; import { getManualTriggerDefaultSettings } from '@/workflow/workflow-trigger/utils/getManualTriggerDefaultSettings'; @@ -16,6 +17,7 @@ import { getTriggerIconColor } from '@/workflow/workflow-trigger/utils/getTrigge import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { useLingui } from '@lingui/react/macro'; +import { TRIGGER_STEP_ID } from 'twenty-shared/workflow'; import { useIcons } from 'twenty-ui/display'; import { type SelectOption } from 'twenty-ui/input'; @@ -237,6 +239,9 @@ export const WorkflowEditTriggerManual = ({ dropdownWidth={GenericDropdownContentWidth.ExtraLarge} /> + {!triggerOptions.readonly && ( + + )} ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerWebhookForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerWebhookForm.tsx index 3db8fd2d804..8dfeb71aa0d 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerWebhookForm.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerWebhookForm.tsx @@ -9,6 +9,7 @@ import { workflowVisualizerWorkflowIdComponentState } from '@/workflow/states/wo import { type WorkflowWebhookTrigger } from '@/workflow/types/Workflow'; import { parseAndValidateVariableFriendlyStringifiedJson } from '@/workflow/utils/parseAndValidateVariableFriendlyStringifiedJson'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; +import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/WorkflowStepFooter'; import { WEBHOOK_TRIGGER_AUTHENTICATION_OPTIONS } from '@/workflow/workflow-trigger/constants/WebhookTriggerAuthenticationOptions'; import { WEBHOOK_TRIGGER_HTTP_METHOD_OPTIONS } from '@/workflow/workflow-trigger/constants/WebhookTriggerHttpMethodOptions'; import { getTriggerDefaultLabel } from '@/workflow/workflow-trigger/utils/getTriggerDefaultLabel'; @@ -21,8 +22,12 @@ import { isNonEmptyString } from '@sniptt/guards'; import { useState } from 'react'; import { useRecoilValue } from 'recoil'; import { isDefined } from 'twenty-shared/utils'; -import { buildOutputSchemaFromValue } from 'twenty-shared/workflow'; +import { + buildOutputSchemaFromValue, + TRIGGER_STEP_ID, +} from 'twenty-shared/workflow'; import { IconCopy, useIcons } from 'twenty-ui/display'; + import { useDebouncedCallback } from 'use-debounce'; import { REACT_APP_SERVER_BASE_URL } from '~/config'; import { useCopyToClipboard } from '~/hooks/useCopyToClipboard'; @@ -216,6 +221,9 @@ export const WorkflowEditTriggerWebhookForm = ({ }} /> + {!triggerOptions.readonly && ( + + )} ); };