@@ -31,6 +31,7 @@ import { ControlParams, ControlType } from "comps/controls/controlParams";
3131import MarkdownTooltip from "lowcoder-design/src/components/MarkdownTooltip" ;
3232import { KeyValueControlParams , keyValueListControl } from "comps/controls/keyValueControl" ;
3333import { VariablesControl } from "../httpQuery/graphqlQuery" ;
34+ import { HttpHeaderPropertyView } from "../httpQuery/httpQueryConstants" ;
3435
3536function wrapConfig < CP extends { } = ControlParams > (
3637 paramsControl : ControlType ,
@@ -144,18 +145,21 @@ function ActionSelectView(props: ActionSelectViewProps) {
144145 ) ;
145146}
146147
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+ } ;
149151 config . actions . forEach ( ( child ) => {
150152 childrenMap [ child . actionName ] = configToComp ( child . params ) ;
151153 } ) ;
152154
153155 const TmpComp = withTypeAndChildrenAbstract (
154156 childrenMap ,
155157 config . actions [ 0 ] . actionName ,
156- { } ,
158+ {
159+ headers : withDefault ( keyValueListControl ( ) , [ { key : "" , value : "" } ] ) ,
160+ } ,
157161 "actionName" ,
158- "action"
162+ "action" ,
159163 ) ;
160164
161165 return class extends TmpComp {
@@ -171,6 +175,14 @@ function unionConfigToComp(config: QueryConfig): CompConstructor {
171175 currentActionName = { currentActionName }
172176 onActionChange = { ( value ) => this . dispatchChangeAndPreserveAction ( { actionName : value } ) }
173177 />
178+ { /* Headers */ }
179+ < QueryConfigWrapper >
180+ < QueryConfigLabel > Headers</ QueryConfigLabel >
181+ < QueryConfigItemWrapper >
182+ { this . children . headers . propertyView ( { keyFlexBasics : 184 , valueFlexBasics : 232 } ) }
183+ </ QueryConfigItemWrapper >
184+ </ QueryConfigWrapper >
185+
174186 { this . children . action . getPropertyView ( ) }
175187 </ >
176188 ) ;
0 commit comments