diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 1119ebb89..a32acce57 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -413,6 +413,7 @@ export default function ParameterComponent({ disabled={disabled} password={data.node?.template[name].password ?? false} value={data.node?.template[name].value ?? ""} + options={globalVariablesEntries} onChange={(value) => { handleOnNewValue(value); if (globalVariablesEntries.includes(value)) { diff --git a/src/frontend/src/components/codeTabsComponent/index.tsx b/src/frontend/src/components/codeTabsComponent/index.tsx index 2bea4265f..8cc423725 100644 --- a/src/frontend/src/components/codeTabsComponent/index.tsx +++ b/src/frontend/src/components/codeTabsComponent/index.tsx @@ -28,8 +28,10 @@ import { TabsTrigger, } from "../../components/ui/tabs"; import { LANGFLOW_SUPPORTED_TYPES } from "../../constants/constants"; +import useAlertStore from "../../stores/alertStore"; import { useDarkStore } from "../../stores/darkStore"; import useFlowStore from "../../stores/flowStore"; +import { useGlobalVariablesStore } from "../../stores/globalVariables"; import { codeTabsPropsType } from "../../types/components"; import { convertObjToArray, @@ -54,8 +56,12 @@ export default function CodeTabsComponent({ const [openAccordion, setOpenAccordion] = useState([]); const dark = useDarkStore((state) => state.dark); const unselectAll = useFlowStore((state) => state.unselectAll); + const globalVariablesEntries = useGlobalVariablesStore( + (state) => state.globalVariablesEntries + ); const setNodes = useFlowStore((state) => state.setNodes); + const setNoticeData = useAlertStore((state) => state.setNoticeData); const [errorDuplicateKey, setErrorDuplicateKey] = useState(false); @@ -347,6 +353,9 @@ export default function CodeTabsComponent({ ) : ( (null); const [showOptions, setShowOptions] = useState(false); - const globalVariablesEntries = useGlobalVariablesStore( - (state) => state.globalVariablesEntries - ); - const [filteredOpts, setFilteredValue] = useState( - globalVariablesEntries - ); + const [filteredOpts, setFilteredValue] = useState(options); // Clear component state useEffect(() => { @@ -197,19 +191,21 @@ export default function InputComponent({ )} - - + {options.length > 0 && ( + + + )} {password && (