The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix(workflow): add tooltip explaining why the variable picker is disabled (#21862)
Thomas Trompette15fd236ad0b3
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsxindex 3c4f218b581..42a17a8cc01 100644--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx@@ -7,10 +7,12 @@ import { type InputSchemaPropertyType } from 'twenty-shared/workflow';import { useAvailableVariablesInWorkflowStep } from '@/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep';import { type StepOutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';+import { t } from '@lingui/core/macro';import { styled } from '@linaria/react';import { useContext, useState } from 'react';import { isDefined } from 'twenty-shared/utils';import { IconVariablePlus } from 'twenty-ui/icon';+import { AppTooltip, TooltipDelay, TooltipPosition } from 'twenty-ui/surfaces';import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';const StyledDropdownVariableButtonContainer = styled.div<{@@ -85,12 +87,25 @@ export const WorkflowVariablesDropdown = ({if (disabled === true || noAvailableVariables) {return (- <StyledDropdownVariableButtonContainer disabled={true}>- <IconVariablePlus- size={theme.icon.size.md}- color={theme.font.color.light}+ <>+ <StyledDropdownVariableButtonContainer+ disabled={true}+ data-variable-picker-disabled-anchor={dropdownId}+ >+ <IconVariablePlus+ size={theme.icon.size.md}+ color={theme.font.color.light}+ />+ </StyledDropdownVariableButtonContainer>+ <AppTooltip+ anchorSelect={`[data-variable-picker-disabled-anchor="${dropdownId}"]`}+ content={t`No variables are available yet. Variables come from the workflow trigger and previous steps.`}+ place={TooltipPosition.Top}+ delay={TooltipDelay.mediumDelay}+ offset={5}+ noArrow/>- </StyledDropdownVariableButtonContainer>+ </>);}