@@ -181,118 +181,117 @@ const InputModal = ({
181
181
id = { inputInEditing . isNew ? "connectorBuilder.inputModal.newTitle" : "connectorBuilder.inputModal.editTitle" }
182
182
/>
183
183
}
184
+ wrapIn = { Form }
184
185
onClose = { onClose }
185
186
>
186
- < Form >
187
- < ModalBody className = { styles . inputForm } >
188
- < BuilderField
189
- path = "definition.title"
190
- type = "string"
191
- onChange = { ( newValue ) => {
192
- if ( ! isInferredInputOverride ) {
193
- setFieldValue ( "key" , sluggify ( newValue || "" ) , true ) ;
194
- }
195
- } }
196
- label = { formatMessage ( { id : "connectorBuilder.inputModal.inputName" } ) }
197
- tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.inputNameTooltip" } ) }
198
- />
199
- < BuilderField
200
- path = "key"
201
- type = "string"
202
- readOnly
203
- label = { formatMessage ( { id : "connectorBuilder.inputModal.fieldId" } ) }
204
- tooltip = { formatMessage (
205
- { id : "connectorBuilder.inputModal.fieldIdTooltip" } ,
206
- {
207
- syntaxExample : `{{config['${ values . key || "my_input" } ']}}` ,
208
- }
209
- ) }
210
- />
211
- < BuilderField
212
- path = "definition.description"
213
- optional
214
- type = "string"
215
- label = { formatMessage ( { id : "connectorBuilder.inputModal.description" } ) }
216
- tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.descriptionTooltip" } ) }
217
- />
218
- { values . type !== "unknown" && ! isInferredInputOverride ? (
219
- < >
220
- < BuilderField
221
- path = "type"
222
- type = "enum"
223
- options = { [ "string" , "number" , "integer" , "array" , "boolean" , "enum" ] }
224
- onChange = { ( ) => {
225
- setFieldValue ( "definition.default" , undefined ) ;
226
- } }
227
- label = { formatMessage ( { id : "connectorBuilder.inputModal.type" } ) }
228
- tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.typeTooltip" } ) }
229
- />
230
- { values . type === "enum" && (
231
- < BuilderField
232
- path = "definition.enum"
233
- type = "array"
234
- optional
235
- label = { formatMessage ( { id : "connectorBuilder.inputModal.enum" } ) }
236
- tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.enumTooltip" } ) }
237
- />
238
- ) }
239
- < BuilderField
240
- path = "definition.airbyte_secret"
241
- type = "boolean"
242
- optional
243
- label = { formatMessage ( { id : "connectorBuilder.inputModal.secret" } ) }
244
- tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.secretTooltip" } ) }
245
- />
187
+ < ModalBody className = { styles . inputFormBody } >
188
+ < BuilderField
189
+ path = "definition.title"
190
+ type = "string"
191
+ onChange = { ( newValue ) => {
192
+ if ( ! isInferredInputOverride ) {
193
+ setFieldValue ( "key" , sluggify ( newValue || "" ) , true ) ;
194
+ }
195
+ } }
196
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.inputName" } ) }
197
+ tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.inputNameTooltip" } ) }
198
+ />
199
+ < BuilderField
200
+ path = "key"
201
+ type = "string"
202
+ readOnly
203
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.fieldId" } ) }
204
+ tooltip = { formatMessage (
205
+ { id : "connectorBuilder.inputModal.fieldIdTooltip" } ,
206
+ {
207
+ syntaxExample : `{{config['${ values . key || "my_input" } ']}}` ,
208
+ }
209
+ ) }
210
+ />
211
+ < BuilderField
212
+ path = "definition.description"
213
+ optional
214
+ type = "string"
215
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.description" } ) }
216
+ tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.descriptionTooltip" } ) }
217
+ />
218
+ { values . type !== "unknown" && ! isInferredInputOverride ? (
219
+ < >
220
+ < BuilderField
221
+ path = "type"
222
+ type = "enum"
223
+ options = { [ "string" , "number" , "integer" , "array" , "boolean" , "enum" ] }
224
+ onChange = { ( ) => {
225
+ setFieldValue ( "definition.default" , undefined ) ;
226
+ } }
227
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.type" } ) }
228
+ tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.typeTooltip" } ) }
229
+ />
230
+ { values . type === "enum" && (
246
231
< BuilderField
247
- path = "required "
248
- type = "boolean "
232
+ path = "definition.enum "
233
+ type = "array "
249
234
optional
250
- label = { formatMessage ( { id : "connectorBuilder.inputModal.required " } ) }
251
- tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.requiredTooltip " } ) }
235
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.enum " } ) }
236
+ tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.enumTooltip " } ) }
252
237
/>
238
+ ) }
239
+ < BuilderField
240
+ path = "definition.airbyte_secret"
241
+ type = "boolean"
242
+ optional
243
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.secret" } ) }
244
+ tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.secretTooltip" } ) }
245
+ />
246
+ < BuilderField
247
+ path = "required"
248
+ type = "boolean"
249
+ optional
250
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.required" } ) }
251
+ tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.requiredTooltip" } ) }
252
+ />
253
+ < BuilderField
254
+ path = "showDefaultValueField"
255
+ type = "boolean"
256
+ optional
257
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.showDefaultValueField" } ) }
258
+ tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.showDefaultValueFieldTooltip" } ) }
259
+ />
260
+ { values . showDefaultValueField && (
253
261
< BuilderField
254
- path = "showDefaultValueField"
255
- type = "boolean"
262
+ path = "definition.default"
263
+ type = { values . type }
264
+ options = { ( values . definition . enum || [ ] ) as string [ ] }
256
265
optional
257
- label = { formatMessage ( { id : "connectorBuilder.inputModal.showDefaultValueField" } ) }
258
- tooltip = { formatMessage ( { id : "connectorBuilder.inputModal.showDefaultValueFieldTooltip" } ) }
266
+ label = { formatMessage ( { id : "connectorBuilder.inputModal.default" } ) }
259
267
/>
260
- { values . showDefaultValueField && (
261
- < BuilderField
262
- path = "definition.default"
263
- type = { values . type }
264
- options = { ( values . definition . enum || [ ] ) as string [ ] }
265
- optional
266
- label = { formatMessage ( { id : "connectorBuilder.inputModal.default" } ) }
267
- />
268
- ) }
269
- </ >
270
- ) : (
271
- < Callout className = { styles . calloutContainer } >
272
- { isInferredInputOverride ? (
273
- < FormattedMessage id = "connectorBuilder.inputModal.inferredInputMessage" />
274
- ) : (
275
- < FormattedMessage id = "connectorBuilder.inputModal.unsupportedInput" />
276
- ) }
277
- </ Callout >
278
- ) }
279
- </ ModalBody >
280
- < ModalFooter >
281
- { ! inputInEditing . isNew && ! inputInEditing . isInferredInputOverride && (
282
- < div className = { styles . deleteButtonContainer } >
283
- < Button variant = "danger" type = "button" onClick = { onDelete } >
284
- < FormattedMessage id = "form.delete" />
285
- </ Button >
286
- </ div >
287
- ) }
288
- < Button variant = "secondary" type = "reset" onClick = { onClose } >
289
- < FormattedMessage id = "form.cancel" />
290
- </ Button >
291
- < Button type = "submit" disabled = { ! isValid } >
292
- < FormattedMessage id = { inputInEditing . isNew ? "form.create" : "form.saveChanges" } />
293
- </ Button >
294
- </ ModalFooter >
295
- </ Form >
268
+ ) }
269
+ </ >
270
+ ) : (
271
+ < Callout className = { styles . calloutContainer } >
272
+ { isInferredInputOverride ? (
273
+ < FormattedMessage id = "connectorBuilder.inputModal.inferredInputMessage" />
274
+ ) : (
275
+ < FormattedMessage id = "connectorBuilder.inputModal.unsupportedInput" />
276
+ ) }
277
+ </ Callout >
278
+ ) }
279
+ </ ModalBody >
280
+ < ModalFooter >
281
+ { ! inputInEditing . isNew && ! inputInEditing . isInferredInputOverride && (
282
+ < div className = { styles . deleteButtonContainer } >
283
+ < Button variant = "danger" type = "button" onClick = { onDelete } >
284
+ < FormattedMessage id = "form.delete" />
285
+ </ Button >
286
+ </ div >
287
+ ) }
288
+ < Button variant = "secondary" type = "reset" onClick = { onClose } >
289
+ < FormattedMessage id = "form.cancel" />
290
+ </ Button >
291
+ < Button type = "submit" disabled = { ! isValid } >
292
+ < FormattedMessage id = { inputInEditing . isNew ? "form.create" : "form.saveChanges" } />
293
+ </ Button >
294
+ </ ModalFooter >
296
295
</ Modal >
297
296
) ;
298
297
} ;
0 commit comments