Skip to content

Commit a659b8c

Browse files
authored
Fix error highlighting (#11469)
1 parent ed95464 commit a659b8c

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

airbyte-webapp/src/core/domain/catalog/api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export type SyncSchemaStream = {
2828
stream: AirbyteStream;
2929
config: AirbyteStreamConfiguration;
3030

31+
/**
32+
* This field is not returned from API and is used to track unique objects
33+
*/
3134
id: string;
3235
};
3336

airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionForm.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ const ConnectionForm: React.FC<ConnectionFormProps> = ({
140140
const onFormSubmit = useCallback(
141141
async (values: FormikConnectionFormValues) => {
142142
const formValues: ConnectionFormValues = (connectionValidationSchema.cast(
143-
values
143+
values,
144+
{
145+
context: { isRequest: true },
146+
}
144147
) as unknown) as ConnectionFormValues;
145148

146149
formValues.operations = mapFormPropsToOperation(

airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ const connectionValidationSchema = yup
9898
id: yup
9999
.string()
100100
// This is required to get rid of id fields we are using to detect stream for edition
101-
.strip(true),
101+
.when(
102+
"$isRequest",
103+
(isRequest: boolean, schema: yup.StringSchema) =>
104+
isRequest ? schema.strip(true) : schema
105+
),
102106
stream: yup.object(),
103107
config: yup
104108
.object({

0 commit comments

Comments
 (0)