File tree 11 files changed +26
-3
lines changed
web/app/components/workflow/nodes
11 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ type Props = {
17
17
children ?: React . JSX . Element | string | null
18
18
operations ?: React . JSX . Element
19
19
inline ?: boolean
20
+ required ?: boolean
20
21
}
21
22
22
23
const Field : FC < Props > = ( {
@@ -28,6 +29,7 @@ const Field: FC<Props> = ({
28
29
operations,
29
30
inline,
30
31
supportFold,
32
+ required,
31
33
} ) => {
32
34
const [ fold , {
33
35
toggle : toggleFold ,
@@ -38,7 +40,9 @@ const Field: FC<Props> = ({
38
40
onClick = { ( ) => supportFold && toggleFold ( ) }
39
41
className = { cn ( 'flex items-center justify-between' , supportFold && 'cursor-pointer' ) } >
40
42
< div className = 'flex h-6 items-center' >
41
- < div className = { cn ( isSubTitle ? 'system-xs-medium-uppercase text-text-tertiary' : 'system-sm-semibold-uppercase text-text-secondary' ) } > { title } </ div >
43
+ < div className = { cn ( isSubTitle ? 'system-xs-medium-uppercase text-text-tertiary' : 'system-sm-semibold-uppercase text-text-secondary' ) } >
44
+ { title } { required && < span className = 'text-text-destructive' > *</ span > }
45
+ </ div >
42
46
{ tooltip && (
43
47
< Tooltip
44
48
popupContent = { tooltip }
Original file line number Diff line number Diff line change @@ -81,7 +81,11 @@ const AgentPanel: FC<NodePanelProps<AgentNodeType>> = (props) => {
81
81
const resetEditor = useStore ( s => s . setControlPromptEditorRerenderKey )
82
82
83
83
return < div className = 'my-2' >
84
- < Field title = { t ( 'workflow.nodes.agent.strategy.label' ) } className = 'px-4 py-2' tooltip = { t ( 'workflow.nodes.agent.strategy.tooltip' ) } >
84
+ < Field
85
+ required
86
+ title = { t ( 'workflow.nodes.agent.strategy.label' ) }
87
+ className = 'px-4 py-2'
88
+ tooltip = { t ( 'workflow.nodes.agent.strategy.tooltip' ) } >
85
89
< AgentStrategy
86
90
strategy = { inputs . agent_strategy_name ? {
87
91
agent_strategy_provider_name : inputs . agent_strategy_provider_name ! ,
Original file line number Diff line number Diff line change @@ -117,8 +117,8 @@ const Panel: FC<NodePanelProps<CodeNodeType>> = ({
117
117
operations = {
118
118
< AddButton onClick = { handleAddOutputVariable } />
119
119
}
120
+ required
120
121
>
121
-
122
122
< OutputVarList
123
123
readonly = { readOnly }
124
124
outputs = { inputs . outputs }
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ const Panel: FC<NodePanelProps<DocExtractorNodeType>> = ({
64
64
< div className = 'space-y-4 px-4 pb-4' >
65
65
< Field
66
66
title = { t ( `${ i18nPrefix } .inputVar` ) }
67
+ required
67
68
>
68
69
< >
69
70
< VarReferencePicker
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
69
69
< div className = 'space-y-4 px-4 pb-4' >
70
70
< Field
71
71
title = { t ( `${ i18nPrefix } .api` ) }
72
+ required
72
73
operations = {
73
74
< div className = 'flex' >
74
75
< div
@@ -126,6 +127,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
126
127
</ Field >
127
128
< Field
128
129
title = { t ( `${ i18nPrefix } .body` ) }
130
+ required
129
131
>
130
132
< EditBody
131
133
nodeId = { id }
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ const Panel: FC<NodePanelProps<IterationNodeType>> = ({
73
73
< div className = 'space-y-4 px-4 pb-4' >
74
74
< Field
75
75
title = { t ( `${ i18nPrefix } .input` ) }
76
+ required
76
77
operations = { (
77
78
< div className = 'system-2xs-medium-uppercase flex h-[18px] items-center rounded-[5px] border border-divider-deep px-1 capitalize text-text-tertiary' > Array</ div >
78
79
) }
@@ -91,6 +92,7 @@ const Panel: FC<NodePanelProps<IterationNodeType>> = ({
91
92
< div className = 'mt-2 space-y-4 px-4 pb-4' >
92
93
< Field
93
94
title = { t ( `${ i18nPrefix } .output` ) }
95
+ required
94
96
operations = { (
95
97
< div className = 'system-2xs-medium-uppercase flex h-[18px] items-center rounded-[5px] border border-divider-deep px-1 capitalize text-text-tertiary' > Array</ div >
96
98
) }
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ const Panel: FC<NodePanelProps<KnowledgeRetrievalNodeType>> = ({
81
81
{ /* {JSON.stringify(inputs, null, 2)} */ }
82
82
< Field
83
83
title = { t ( `${ i18nPrefix } .queryVariable` ) }
84
+ required
84
85
>
85
86
< VarReferencePicker
86
87
nodeId = { id }
@@ -94,6 +95,7 @@ const Panel: FC<NodePanelProps<KnowledgeRetrievalNodeType>> = ({
94
95
95
96
< Field
96
97
title = { t ( `${ i18nPrefix } .knowledge` ) }
98
+ required
97
99
operations = {
98
100
< div className = 'flex items-center space-x-1' >
99
101
< RetrievalConfig
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ const Panel: FC<NodePanelProps<ListFilterNodeType>> = ({
46
46
< div className = 'space-y-4 px-4' >
47
47
< Field
48
48
title = { t ( `${ i18nPrefix } .inputVar` ) }
49
+ required
49
50
>
50
51
< VarReferencePicker
51
52
readonly = { readOnly }
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
147
147
< div className = 'space-y-4 px-4 pb-4' >
148
148
< Field
149
149
title = { t ( `${ i18nPrefix } .model` ) }
150
+ required
150
151
>
151
152
< ModelParameterModal
152
153
popupClassName = '!w-[387px]'
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
115
115
< div className = 'space-y-4 px-4' >
116
116
< Field
117
117
title = { t ( `${ i18nCommonPrefix } .model` ) }
118
+ required
118
119
>
119
120
< ModelParameterModal
120
121
popupClassName = '!w-[387px]'
@@ -133,6 +134,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
133
134
</ Field >
134
135
< Field
135
136
title = { t ( `${ i18nPrefix } .inputVar` ) }
137
+ required
136
138
>
137
139
< >
138
140
< VarReferencePicker
@@ -157,6 +159,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
157
159
/>
158
160
< Field
159
161
title = { t ( `${ i18nPrefix } .extractParameters` ) }
162
+ required
160
163
operations = {
161
164
! readOnly
162
165
? (
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
103
103
< div className = 'space-y-4 px-4' >
104
104
< Field
105
105
title = { t ( `${ i18nPrefix } .model` ) }
106
+ required
106
107
>
107
108
< ModelParameterModal
108
109
popupClassName = '!w-[387px]'
@@ -121,6 +122,7 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
121
122
</ Field >
122
123
< Field
123
124
title = { t ( `${ i18nPrefix } .inputVars` ) }
125
+ required
124
126
>
125
127
< VarReferencePicker
126
128
readonly = { readOnly }
@@ -143,6 +145,7 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
143
145
/>
144
146
< Field
145
147
title = { t ( `${ i18nPrefix } .class` ) }
148
+ required
146
149
>
147
150
< ClassList
148
151
nodeId = { id }
You can’t perform that action at this time.
0 commit comments