Disable variable picker when no available variables (#9894)
- Disable variable picker when no available variables (https://discord.com/channels/1130383047699738754/1331236819227906049) <img width="496" alt="image" src="https://github.com/user-attachments/assets/e4cb97c8-648c-4bdf-b230-49687113c9e6" />
This commit is contained in:
@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user