From 664fd9fabd46314343ded23af7ecb38cbb6ef616 Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Thu, 31 Jul 2025 15:40:41 +0200 Subject: [PATCH] Do not enrich relations when id undefined (#13530) Fixes https://github.com/twentyhq/twenty/issues/13428 We perform the call enrichment even with id undefined. It returns the first item in DB. Adding two more fixes related to filters: - Conditions title - Fixing placeholder color for select control (only other impacted field is in Advanced filters) --- .../src/modules/ui/input/components/SelectControl.tsx | 2 +- .../components/WorkflowEditActionFilterBody.tsx | 11 +++++++++-- .../WorkflowStepFilterAddRootStepFilterButton.tsx | 7 ++++++- .../listeners/database-event-trigger.listener.ts | 5 +++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/twenty-front/src/modules/ui/input/components/SelectControl.tsx b/packages/twenty-front/src/modules/ui/input/components/SelectControl.tsx index 91c8f05f53..03e4791993 100644 --- a/packages/twenty-front/src/modules/ui/input/components/SelectControl.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/SelectControl.tsx @@ -48,7 +48,7 @@ const StyledControlContainer = styled.div<{ ? theme.font.color.tertiary : textAccent === 'default' ? theme.font.color.primary - : theme.font.color.secondary}; + : theme.font.color.tertiary}; cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')}; text-align: left; `; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilterBody.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilterBody.tsx index b035683c96..8518baf7f1 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilterBody.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowEditActionFilterBody.tsx @@ -1,3 +1,4 @@ +import { InputLabel } from '@/ui/input/components/InputLabel'; import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2'; import { WorkflowFilterAction } from '@/workflow/types/Workflow'; import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody'; @@ -11,6 +12,7 @@ import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/workflow-ac import { rootLevelStepFilterGroupComponentSelector } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/rootLevelStepFilterGroupComponentSelector'; import { isStepFilterGroupChildAStepFilterGroup } from '@/workflow/workflow-steps/workflow-actions/filter-action/utils/isStepFilterGroupChildAStepFilterGroup'; import styled from '@emotion/styled'; +import { t } from '@lingui/core/macro'; import { isDefined } from 'twenty-shared/utils'; const StyledContainer = styled.div` @@ -27,6 +29,10 @@ const StyledChildContainer = styled.div` width: 100%; `; +const StyledFilterBodyContainer = styled(WorkflowStepBody)` + gap: ${({ theme }) => theme.spacing(0)}; +`; + type WorkflowEditActionFilterBodyProps = { action: WorkflowFilterAction; actionOptions: @@ -77,7 +83,8 @@ export const WorkflowEditActionFilterBody = ({ onFilterSettingsUpdate, }} > - + + {t`Conditions`} {isDefined(rootStepFilterGroup) ? ( @@ -111,7 +118,7 @@ export const WorkflowEditActionFilterBody = ({ ) : ( )} - + ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowStepFilterAddRootStepFilterButton.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowStepFilterAddRootStepFilterButton.tsx index 38680a8d46..f064d79d5d 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowStepFilterAddRootStepFilterButton.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/filter-action/components/WorkflowStepFilterAddRootStepFilterButton.tsx @@ -1,17 +1,22 @@ import { useAddRootStepFilter } from '@/workflow/workflow-steps/workflow-actions/filter-action/hooks/useAddRootStepFilter'; import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/context/WorkflowStepFilterContext'; +import styled from '@emotion/styled'; import { useLingui } from '@lingui/react/macro'; import { useContext } from 'react'; import { IconFilter } from 'twenty-ui/display'; import { Button } from 'twenty-ui/input'; +const StyledButton = styled(Button)` + margin-top: ${({ theme }) => theme.spacing(2)}; +`; + export const WorkflowStepFilterAddRootStepFilterButton = () => { const { t } = useLingui(); const { readonly } = useContext(WorkflowStepFilterContext); const { addRootStepFilter } = useAddRootStepFilter(); return ( -