@@ -31,6 +31,7 @@ import { ControlParams, ControlType } from "comps/controls/controlParams";
31
31
import MarkdownTooltip from "lowcoder-design/src/components/MarkdownTooltip" ;
32
32
import { KeyValueControlParams , keyValueListControl } from "comps/controls/keyValueControl" ;
33
33
import { VariablesControl } from "../httpQuery/graphqlQuery" ;
34
+ import { HttpHeaderPropertyView } from "../httpQuery/httpQueryConstants" ;
34
35
35
36
function wrapConfig < CP extends { } = ControlParams > (
36
37
paramsControl : ControlType ,
@@ -144,18 +145,21 @@ function ActionSelectView(props: ActionSelectViewProps) {
144
145
) ;
145
146
}
146
147
147
- function unionConfigToComp ( config : QueryConfig ) : CompConstructor {
148
- const childrenMap : Record < string , CompConstructor > = { } ;
148
+ export function unionConfigToComp ( config : QueryConfig ) : CompConstructor {
149
+ const childrenMap : Record < string , CompConstructor > = {
150
+ } ;
149
151
config . actions . forEach ( ( child ) => {
150
152
childrenMap [ child . actionName ] = configToComp ( child . params ) ;
151
153
} ) ;
152
154
153
155
const TmpComp = withTypeAndChildrenAbstract (
154
156
childrenMap ,
155
157
config . actions [ 0 ] . actionName ,
156
- { } ,
158
+ {
159
+ headers : withDefault ( keyValueListControl ( ) , [ { key : "" , value : "" } ] ) ,
160
+ } ,
157
161
"actionName" ,
158
- "action"
162
+ "action" ,
159
163
) ;
160
164
161
165
return class extends TmpComp {
@@ -171,6 +175,14 @@ function unionConfigToComp(config: QueryConfig): CompConstructor {
171
175
currentActionName = { currentActionName }
172
176
onActionChange = { ( value ) => this . dispatchChangeAndPreserveAction ( { actionName : value } ) }
173
177
/>
178
+ { /* Headers */ }
179
+ < QueryConfigWrapper >
180
+ < QueryConfigLabel > Headers</ QueryConfigLabel >
181
+ < QueryConfigItemWrapper >
182
+ { this . children . headers . propertyView ( { keyFlexBasics : 184 , valueFlexBasics : 232 } ) }
183
+ </ QueryConfigItemWrapper >
184
+ </ QueryConfigWrapper >
185
+
174
186
{ this . children . action . getPropertyView ( ) }
175
187
</ >
176
188
) ;
0 commit comments