From e501c9ce3c28abe04f81a57adedfe2f859958a12 Mon Sep 17 00:00:00 2001 From: Lake Mossman Date: Thu, 19 Jan 2023 09:57:15 -0800 Subject: [PATCH] [Connector Builder]Add ability to convert from YAML manifest to UI (#21142) * save * save more progress * try setting values directly * toggle editor * fix primary key * enforce consistency in name and primary key * refactor conversion method to be more readable * save progress * allow custom input keys to be used for inferred auth values * fix isMatch bug and remove console logs * fix type issues with reflect * properly handle undefined * format schema and gracefully handle non-inline schemas * verify no custom components * refactor and fix request options type * rest of refactor * move manifest to builder form conversion logic into its own file, and handle inferred input overrides properly * convert substream slicers * restore warning modal for switching back to UI * remove console logs * remove unneeded traceback filtering * set http method when converting to manifest * remove commented import * add unsupported fields to builder form values * save check stream values from manifest * save progress * add more tests * save record filter in unsupported fields * use type coersion instead of yaml strings --- .../ConfirmationModal/ConfirmationModal.tsx | 4 +- .../Builder/AuthenticationSection.tsx | 90 +++- .../YamlEditor/YamlEditor.tsx | 39 +- .../manifestToBuilderForm.test.ts | 457 ++++++++++++++++++ .../connectorBuilder/manifestToBuilderForm.ts | 408 ++++++++++++++++ .../src/components/connectorBuilder/types.ts | 284 ++++++----- .../ConfirmationModalService.tsx | 1 + airbyte-webapp/src/locales/en.json | 4 +- 8 files changed, 1129 insertions(+), 158 deletions(-) create mode 100644 airbyte-webapp/src/components/connectorBuilder/manifestToBuilderForm.test.ts create mode 100644 airbyte-webapp/src/components/connectorBuilder/manifestToBuilderForm.ts diff --git a/airbyte-webapp/src/components/common/ConfirmationModal/ConfirmationModal.tsx b/airbyte-webapp/src/components/common/ConfirmationModal/ConfirmationModal.tsx index 90c3d3f27b880..ee1bcd8312118 100644 --- a/airbyte-webapp/src/components/common/ConfirmationModal/ConfirmationModal.tsx +++ b/airbyte-webapp/src/components/common/ConfirmationModal/ConfirmationModal.tsx @@ -11,6 +11,7 @@ export interface ConfirmationModalProps { onClose: () => void; title: string; text: string; + textValues?: Record; submitButtonText: string; onSubmit: () => void; submitButtonDataId?: string; @@ -21,6 +22,7 @@ export const ConfirmationModal: React.FC = ({ onClose, title, text, + textValues, onSubmit, submitButtonText, submitButtonDataId, @@ -32,7 +34,7 @@ export const ConfirmationModal: React.FC = ({ return ( } testId="confirmationModal">
- +