Skip to content

Commit

Permalink
Fix order of oneOf (airbytehq#11309)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase authored Mar 24, 2022
1 parent f341578 commit 0aa27c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions airbyte-webapp/src/core/jsonSchema/schemaToUiWidget.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ test("should reformat jsonSchema to internal widget representation when has oneO
type: "object",
title: "Credentials Condition",
description: "Credentials Condition Description",
order: 0,
oneOf: [
{
title: "api key",
Expand Down Expand Up @@ -215,6 +216,7 @@ test("should reformat jsonSchema to internal widget representation when has oneO
type: "object",
description: "Credentials Condition Description",
title: "Credentials Condition",
order: 0,
oneOf: [
{
title: "api key",
Expand Down Expand Up @@ -252,6 +254,7 @@ test("should reformat jsonSchema to internal widget representation when has oneO
path: "key.credentials",
description: "Credentials Condition Description",
title: "Credentials Condition",
order: 0,
fieldKey: "credentials",
conditions: {
"api key": {
Expand Down
5 changes: 2 additions & 3 deletions airbyte-webapp/src/core/jsonSchema/schemaToUiWidget.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormBlock } from "core/form/types";
import { AirbyteJSONSchemaDefinition, AirbyteJSONSchema } from "./types";
import { isDefined } from "../../utils/common";
import { isDefined } from "utils/common";

/**
* Returns {@link FormBlock} representation of jsonSchema
Expand Down Expand Up @@ -51,9 +51,8 @@ export const jsonSchemaToUiWidget = (
);

return {
...pickDefaultFields(jsonSchema),
_type: "formCondition",
title: jsonSchema.title,
description: jsonSchema.description,
path: path || key,
fieldKey: key,
conditions,
Expand Down

0 comments on commit 0aa27c3

Please sign in to comment.