From 7a438f89991c9f07a1547252b59eeb132840cc5b Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 28 Feb 2024 19:49:01 +0800 Subject: [PATCH] chore: assign var --- .../workflow/nodes/variable-assigner/node.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/nodes/variable-assigner/node.tsx b/web/app/components/workflow/nodes/variable-assigner/node.tsx index 37922e4209..51b762f777 100644 --- a/web/app/components/workflow/nodes/variable-assigner/node.tsx +++ b/web/app/components/workflow/nodes/variable-assigner/node.tsx @@ -1,4 +1,5 @@ import type { FC } from 'react' +import { useState } from 'react' import { useTranslation } from 'react-i18next' import { mockData } from './mock' import { getNodeInfoById } from '@/app/components/workflow/nodes/_base/components/variable/var-reference-picker' @@ -9,7 +10,9 @@ const i18nPrefix = 'workflow.nodes.variableAssigner' const Node: FC = () => { const { t } = useTranslation() - const { variables, output_type } = mockData + const { variables: tempVar, output_type } = mockData + const [variables, setVariables] = useState(tempVar) + // TODO: get var type through node and value const getVarType = () => { return 'string' @@ -54,6 +57,12 @@ const Node: FC = () => { )} +
{ + setVariables([...variables, []]) + }} + >Add
{t(`${i18nPrefix}.outputType`)}