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
cffaf307
Commit
cffaf307
authored
Feb 21, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: if types
parent
bc60cf0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
2 deletions
+62
-2
page.tsx
web/app/(commonLayout)/workflow/nodes/page.tsx
+2
-2
mock.ts
web/app/components/workflow/nodes/if-else/mock.ts
+23
-0
types.ts
web/app/components/workflow/nodes/if-else/types.ts
+37
-0
No files found.
web/app/(commonLayout)/workflow/nodes/page.tsx
View file @
cffaf307
...
...
@@ -46,9 +46,9 @@ const Page: FC = () => {
/*
* TODO: for debug.
* 2 directAnswer 3: llm 5: questionClassifier
* 7 Code, 8 TemplateTransform 9 http
*
6 if else
7 Code, 8 TemplateTransform 9 http
*/
selectedNodeId=
'
9
'
selectedNodeId=
'
6
'
/>
</
div
>
)
...
...
web/app/components/workflow/nodes/if-else/mock.ts
0 → 100644
View file @
cffaf307
import
type
{
IfElseType
}
from
'./types'
import
{
ComparisonOperator
,
LogicalOperator
}
from
'./types'
export
const
mockData
:
IfElseType
=
{
title
:
'Test'
,
desc
:
'Test'
,
type
:
'Test'
,
logical_operator
:
LogicalOperator
.
and
,
conditions
:
[
{
id
:
'1'
,
variable_selector
:
[
'aaa'
,
'name'
],
comparison_operator
:
ComparisonOperator
.
contains
,
value
:
'22'
,
},
{
id
:
'2'
,
variable_selector
:
[
'bbb'
,
'b'
,
'c'
],
comparison_operator
:
ComparisonOperator
.
equal
,
value
:
'b'
,
},
],
}
web/app/components/workflow/nodes/if-else/types.ts
0 → 100644
View file @
cffaf307
import
type
{
CommonNodeType
,
ValueSelector
}
from
'@/app/components/workflow/types'
export
enum
LogicalOperator
{
and
=
'and'
,
or
=
'or'
,
}
export
enum
ComparisonOperator
{
contains
=
'contains'
,
notContains
=
'not contains'
,
startWith
=
'start with'
,
endWith
=
'end with'
,
is
=
'is'
,
isNot
=
'is not'
,
empty
=
'empty'
,
notEmpty
=
'not empty'
,
equal
=
'='
,
notEqual
=
'≠'
,
largerThan
=
'>'
,
lessThan
=
'<'
,
largerThanOrEqual
=
'≥'
,
lessThanOrEqual
=
'≤'
,
isNull
=
'is null'
,
isNotNull
=
'is not null'
,
}
export
type
Condition
=
{
id
:
string
variable_selector
:
ValueSelector
comparison_operator
:
ComparisonOperator
value
:
string
}
export
type
IfElseType
=
CommonNodeType
&
{
logical_operator
:
LogicalOperator
conditions
:
Condition
[]
}
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