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
77c8261f
Commit
77c8261f
authored
Feb 27, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: if not align
parent
91a2e71f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
selector.tsx
...p/components/workflow/nodes/_base/components/selector.tsx
+3
-1
condition-item.tsx
...ents/workflow/nodes/if-else/components/condition-item.tsx
+7
-5
workflow.ts
web/i18n/en-US/workflow.ts
+2
-2
No files found.
web/app/components/workflow/nodes/_base/components/selector.tsx
View file @
77c8261f
...
@@ -16,6 +16,7 @@ type Props = {
...
@@ -16,6 +16,7 @@ type Props = {
onChange
:
(
value
:
any
)
=>
void
onChange
:
(
value
:
any
)
=>
void
uppercase
?:
boolean
uppercase
?:
boolean
popupClassName
?:
string
popupClassName
?:
string
itemClassName
?:
string
readonly
?:
boolean
readonly
?:
boolean
showChecked
?:
boolean
showChecked
?:
boolean
}
}
...
@@ -27,6 +28,7 @@ const TypeSelector: FC<Props> = ({
...
@@ -27,6 +28,7 @@ const TypeSelector: FC<Props> = ({
onChange
,
onChange
,
uppercase
,
uppercase
,
popupClassName
,
popupClassName
,
itemClassName
,
readonly
,
readonly
,
showChecked
,
showChecked
,
})
=>
{
})
=>
{
...
@@ -64,7 +66,7 @@ const TypeSelector: FC<Props> = ({
...
@@ -64,7 +66,7 @@ const TypeSelector: FC<Props> = ({
setHide
()
setHide
()
onChange
(
item
.
value
)
onChange
(
item
.
value
)
}
}
}
}
className=
{
cn
(
uppercase
&&
'uppercase'
,
'flex items-center h-[30px] justify-between min-w-[44px] px-3 rounded-lg cursor-pointer text-[13px] font-medium text-gray-700 hover:bg-gray-50'
)
}
className=
{
cn
(
itemClassName
,
uppercase
&&
'uppercase'
,
'flex items-center h-[30px] justify-between min-w-[44px] px-3 rounded-lg cursor-pointer text-[13px] font-medium text-gray-700 hover:bg-gray-50'
)
}
>
>
<
div
>
{
item
.
label
}
</
div
>
<
div
>
{
item
.
label
}
</
div
>
{
showChecked
&&
item
.
value
===
value
&&
<
Check
className=
'text-primary-600 w-4 h-4'
/>
}
{
showChecked
&&
item
.
value
===
value
&&
<
Check
className=
'text-primary-600 w-4 h-4'
/>
}
...
...
web/app/components/workflow/nodes/if-else/components/condition-item.tsx
View file @
77c8261f
...
@@ -85,6 +85,7 @@ const Item: FC<ItemProps> = ({
...
@@ -85,6 +85,7 @@ const Item: FC<ItemProps> = ({
onLogicalOperatorToggle
,
onLogicalOperatorToggle
,
})
=>
{
})
=>
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
isValueReadOnly
=
[
ComparisonOperator
.
empty
,
ComparisonOperator
.
notEmpty
,
ComparisonOperator
.
isNull
,
ComparisonOperator
.
isNotNull
].
includes
(
payload
.
comparison_operator
)
const
handleVarReferenceChange
=
useCallback
((
value
:
ValueSelector
)
=>
{
const
handleVarReferenceChange
=
useCallback
((
value
:
ValueSelector
)
=>
{
onChange
({
onChange
({
...
@@ -140,8 +141,9 @@ const Item: FC<ItemProps> = ({
...
@@ -140,8 +141,9 @@ const Item: FC<ItemProps> = ({
<
Selector
<
Selector
popupClassName=
'top-[34px]'
popupClassName=
'top-[34px]'
itemClassName=
'capitalize'
trigger=
{
trigger=
{
<
div
className=
'shrink-0 w
hitespace-nowrap flex items-center h-8 justify-between px-2.5 rounded-lg bg-gray-100 capitalize
'
>
<
div
className=
'shrink-0 w
-[100px] whitespace-nowrap flex items-center h-8 justify-between px-2.5 rounded-lg bg-gray-100 capitalize cursor-pointer
'
>
<
div
className=
'text-[13px] font-normal text-gray-900'
>
{
isComparisonOperatorNeedTranslate
(
payload
.
comparison_operator
)
?
t
(
`${i18nPrefix}.comparisonOperator.${payload.comparison_operator}`
)
:
payload
.
comparison_operator
}
</
div
>
<
div
className=
'text-[13px] font-normal text-gray-900'
>
{
isComparisonOperatorNeedTranslate
(
payload
.
comparison_operator
)
?
t
(
`${i18nPrefix}.comparisonOperator.${payload.comparison_operator}`
)
:
payload
.
comparison_operator
}
</
div
>
</
div
>
</
div
>
}
}
...
@@ -157,11 +159,11 @@ const Item: FC<ItemProps> = ({
...
@@ -157,11 +159,11 @@ const Item: FC<ItemProps> = ({
/>
/>
<
input
<
input
readOnly=
{
readonly
}
readOnly=
{
readonly
||
isValueReadOnly
}
value=
{
payload
.
value
}
value=
{
!
isValueReadOnly
?
payload
.
value
:
''
}
onChange=
{
handleValueChange
}
onChange=
{
handleValueChange
}
placeholder=
{
t
(
`${i18nPrefix}.enterValue`
)
!
}
placeholder=
{
!
isValueReadOnly
?
t
(
`${i18nPrefix}.enterValue`
)
!
:
''
}
className=
'
max-w-[144
px] h-8 leading-8 px-2.5 rounded-lg border-0 bg-gray-100 text-gray-900 text-[13px] placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200'
className=
'
w-[80
px] h-8 leading-8 px-2.5 rounded-lg border-0 bg-gray-100 text-gray-900 text-[13px] placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200'
type=
'text'
type=
'text'
/>
/>
...
...
web/i18n/en-US/workflow.ts
View file @
77c8261f
...
@@ -84,8 +84,8 @@ const translation = {
...
@@ -84,8 +84,8 @@ const translation = {
'end with'
:
'end with'
,
'end with'
:
'end with'
,
'is'
:
'is'
,
'is'
:
'is'
,
'is not'
:
'is not'
,
'is not'
:
'is not'
,
'empty'
:
'empty'
,
'empty'
:
'
is
empty'
,
'not empty'
:
'not empty'
,
'not empty'
:
'
is
not empty'
,
'null'
:
'is null'
,
'null'
:
'is null'
,
'not null'
:
'is not null'
,
'not null'
:
'is not null'
,
},
},
...
...
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