Skip to content

The open alternative to Salesforce, designed for AI.

Disable variable picker when no available variables (#9894)

martmull5329dd0c637a
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.tsx
index 9a4aba81b9e..300da804092 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
@@ -47,6 +47,8 @@ export const WorkflowVariablesDropdown = ({
objectNameSingularToSelect,
});
+ const noAvailableVariables = availableVariablesInWorkflowStep.length === 0;
+
const initialStep =
availableVariablesInWorkflowStep.length === 1
? availableVariablesInWorkflowStep[0]
@@ -72,11 +74,11 @@ export const WorkflowVariablesDropdown = ({
setSelectedStep(undefined);
};
- if (disabled === true) {
+ if (disabled === true || noAvailableVariables) {
return (
<StyledDropdownVariableButtonContainer
isUnfolded={isDropdownOpen}
- disabled={disabled}
+ disabled={true}
transparentBackground
>
<IconVariablePlus
@@ -97,7 +99,6 @@ export const WorkflowVariablesDropdown = ({
clickableComponent={
<StyledDropdownVariableButtonContainer
isUnfolded={isDropdownOpen}
- disabled={disabled}
transparentBackground
>
<IconVariablePlus size={theme.icon.size.sm} />