Skip to content

Commit

Permalink
Fix error highlighting (#11469)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase authored Mar 30, 2022
1 parent ed95464 commit a659b8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions airbyte-webapp/src/core/domain/catalog/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export type SyncSchemaStream = {
stream: AirbyteStream;
config: AirbyteStreamConfiguration;

/**
* This field is not returned from API and is used to track unique objects
*/
id: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ const ConnectionForm: React.FC<ConnectionFormProps> = ({
const onFormSubmit = useCallback(
async (values: FormikConnectionFormValues) => {
const formValues: ConnectionFormValues = (connectionValidationSchema.cast(
values
values,
{
context: { isRequest: true },
}
) as unknown) as ConnectionFormValues;

formValues.operations = mapFormPropsToOperation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ const connectionValidationSchema = yup
id: yup
.string()
// This is required to get rid of id fields we are using to detect stream for edition
.strip(true),
.when(
"$isRequest",
(isRequest: boolean, schema: yup.StringSchema) =>
isRequest ? schema.strip(true) : schema
),
stream: yup.object(),
config: yup
.object({
Expand Down

0 comments on commit a659b8c

Please sign in to comment.