Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
b2ae7089
Commit
b2ae7089
authored
Mar 05, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: var assigner
parent
d4ab6b29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
node.tsx
web/app/components/workflow/nodes/variable-assigner/node.tsx
+1
-10
panel.tsx
...app/components/workflow/nodes/variable-assigner/panel.tsx
+1
-1
No files found.
web/app/components/workflow/nodes/variable-assigner/node.tsx
View file @
b2ae7089
import
type
{
FC
}
from
'react'
import
{
useState
}
from
'react'
import
type
{
NodeProps
}
from
'reactflow'
import
{
useTranslation
}
from
'react-i18next'
import
{
NodeTargetHandle
}
from
'../_base/components/node-handle'
...
...
@@ -13,8 +12,7 @@ const i18nPrefix = 'workflow.nodes.variableAssigner'
const
Node
:
FC
<
NodeProps
<
VariableAssignerNodeType
>>
=
(
props
)
=>
{
const
{
t
}
=
useTranslation
()
const
{
data
}
=
props
const
{
variables
:
tempVar
,
output_type
}
=
data
const
[
variables
,
setVariables
]
=
useState
(
tempVar
)
const
{
variables
,
output_type
}
=
data
// TODO: get var type through node and value
const
getVarType
=
()
=>
{
...
...
@@ -65,13 +63,6 @@ const Node: FC<NodeProps<VariableAssignerNodeType>> = (props) => {
)
}
</
div
>
{
/* For test */
}
<
div
className=
'mt-1 flex items-center h-6 justify-center bg-gray-100 rounded-md px-1 space-x-1 text-xs font-normal text-gray-700'
onClick=
{
()
=>
{
setVariables
([...
variables
,
[]])
}
}
>
Add
</
div
>
<
div
className=
'mt-2 flex items-center h-6 justify-between bg-gray-100 rounded-md px-1 space-x-1 text-xs font-normal text-gray-700'
>
<
div
className=
'text-xs font-medium text-gray-500 uppercase'
>
{
t
(
`${i18nPrefix}.outputType`
)
}
...
...
web/app/components/workflow/nodes/variable-assigner/panel.tsx
View file @
b2ae7089
...
...
@@ -27,7 +27,7 @@ const Panel: FC<NodeProps<VariableAssignerNodeType>> = ({
const
typeOptions
=
[
{
label
:
t
(
`
${
i18nPrefix
}
.type.string`
),
value
:
'string'
},
{
label
:
t
(
`
${
i18nPrefix
}
.type.number`
),
value
:
'number'
},
{
label
:
t
(
`
${
i18nPrefix
}
.type.object`
),
value
:
'
O
bject'
},
{
label
:
t
(
`
${
i18nPrefix
}
.type.object`
),
value
:
'
o
bject'
},
{
label
:
t
(
`
${
i18nPrefix
}
.type.array`
),
value
:
'array'
},
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment