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,
|
objectNameSingularToSelect,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const noAvailableVariables = availableVariablesInWorkflowStep.length === 0;
|
||||||
|
|
||||||
const initialStep =
|
const initialStep =
|
||||||
availableVariablesInWorkflowStep.length === 1
|
availableVariablesInWorkflowStep.length === 1
|
||||||
? availableVariablesInWorkflowStep[0]
|
? availableVariablesInWorkflowStep[0]
|
||||||
@ -72,11 +74,11 @@ export const WorkflowVariablesDropdown = ({
|
|||||||
setSelectedStep(undefined);
|
setSelectedStep(undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (disabled === true) {
|
if (disabled === true || noAvailableVariables) {
|
||||||
return (
|
return (
|
||||||
<StyledDropdownVariableButtonContainer
|
<StyledDropdownVariableButtonContainer
|
||||||
isUnfolded={isDropdownOpen}
|
isUnfolded={isDropdownOpen}
|
||||||
disabled={disabled}
|
disabled={true}
|
||||||
transparentBackground
|
transparentBackground
|
||||||
>
|
>
|
||||||
<IconVariablePlus
|
<IconVariablePlus
|
||||||
@ -97,7 +99,6 @@ export const WorkflowVariablesDropdown = ({
|
|||||||
clickableComponent={
|
clickableComponent={
|
||||||
<StyledDropdownVariableButtonContainer
|
<StyledDropdownVariableButtonContainer
|
||||||
isUnfolded={isDropdownOpen}
|
isUnfolded={isDropdownOpen}
|
||||||
disabled={disabled}
|
|
||||||
transparentBackground
|
transparentBackground
|
||||||
>
|
>
|
||||||
<IconVariablePlus size={theme.icon.size.sm} />
|
<IconVariablePlus size={theme.icon.size.sm} />
|
||||||
|
|||||||
Reference in New Issue
Block a user