From 8513d14157dbe7fe0bb4a463736a24afad5430b1 Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Tue, 29 Jul 2025 10:46:34 +0200 Subject: [PATCH] Filter action fixes on select field (#13477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Capture d’écran 2025-07-28 à 18 45
51 Capture d’écran 2025-07-28 à 18 46
11 --- .../WorkflowEditActionFilterBody.tsx | 24 -------------- .../WorkflowStepFilterAddFilterRuleSelect.tsx | 3 +- .../WorkflowStepFilterFieldSelect.tsx | 31 ++++++++++++++++++- 3 files changed, 32 insertions(+), 26 deletions(-) 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 2a5796305c..b035683c96 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 @@ -10,9 +10,7 @@ import { useChildStepFiltersAndChildStepFilterGroups } from '@/workflow/workflow import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/workflow-actions/filter-action/states/context/WorkflowStepFilterContext'; 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 { useAvailableVariablesInWorkflowStep } from '@/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep'; import styled from '@emotion/styled'; -import { useLingui } from '@lingui/react/macro'; import { isDefined } from 'twenty-shared/utils'; const StyledContainer = styled.div` @@ -29,10 +27,6 @@ const StyledChildContainer = styled.div` width: 100%; `; -const StyledDangerContainer = styled.div` - color: ${({ theme }) => theme.font.color.danger}; -`; - type WorkflowEditActionFilterBodyProps = { action: WorkflowFilterAction; actionOptions: @@ -49,8 +43,6 @@ export const WorkflowEditActionFilterBody = ({ action, actionOptions, }: WorkflowEditActionFilterBodyProps) => { - const { t } = useLingui(); - const rootStepFilterGroup = useRecoilComponentValueV2( rootLevelStepFilterGroupComponentSelector, ); @@ -77,22 +69,6 @@ export const WorkflowEditActionFilterBody = ({ }); }; - const availableVariablesInWorkflowStep = useAvailableVariablesInWorkflowStep( - {}, - ); - - const noAvailableVariables = availableVariablesInWorkflowStep.length === 0; - - if (noAvailableVariables) { - return ( - - - {t`No Available Step Outputs`} - - - ); - } - return ( (variableName: string) => { @@ -103,9 +111,29 @@ export const WorkflowStepFilterFieldSelect = ({ }); const isSelectedFieldNotFound = !isDefined(variableLabel); - const label = isSelectedFieldNotFound ? t`No Field Selected` : variableLabel; + const label = isSelectedFieldNotFound + ? t`Select a field from a previous step` + : variableLabel; const dropdownId = `step-filter-field-${stepFilter.id}`; + if (noAvailableVariables) { + return ( + + } + dropdownComponents={[]} + /> + ); + } + return ( } />