From 75dcf8202a19d0e107c0fe592999fe41992d350d Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Tue, 13 Dec 2022 11:00:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9F=F0=9F=94=A7=20=20Remove=20top=20le?= =?UTF-8?q?vel=20state=20for=20unfinished=20flows=20in=20connector=20form?= =?UTF-8?q?=20(#20135)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor loading state --- .../ConnectorForm/components/EditControls.tsx | 5 +- .../Property/ConfirmationControl.tsx | 71 ------------ .../components/Property/Control.tsx | 56 +-------- .../SecretConfirmationControl.module.scss | 8 ++ .../Property/SecretConfirmationControl.tsx | 108 ++++++++++++++++++ .../components/Sections/PropertySection.tsx | 12 +- .../ConnectorForm/connectorFormContext.tsx | 15 --- 7 files changed, 125 insertions(+), 150 deletions(-) delete mode 100644 airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/ConfirmationControl.tsx create mode 100644 airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/SecretConfirmationControl.module.scss create mode 100644 airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/SecretConfirmationControl.tsx diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/EditControls.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/EditControls.tsx index 46f921fa2ff85..dcd6650625610 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/EditControls.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/EditControls.tsx @@ -4,7 +4,6 @@ import styled from "styled-components"; import { Button } from "components/ui/Button"; -import { useConnectorForm } from "../connectorFormContext"; import styles from "./EditControls.module.scss"; import { TestingConnectionError } from "./TestingConnectionError"; import { TestingConnectionSpinner } from "./TestingConnectionSpinner"; @@ -42,8 +41,6 @@ const EditControls: React.FC = ({ errorMessage, onCancelTesting, }) => { - const { unfinishedFlows } = useConnectorForm(); - if (isSubmitting) { return ; } @@ -63,7 +60,7 @@ const EditControls: React.FC = ({ {renderStatusMessage()}
- - - - ) : ( - - )} - - ); -}; - -export default ConfirmationControl; diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx index 2208ee16b9796..a6b9c1d1c3968 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx @@ -5,7 +5,6 @@ import { DatePicker } from "components/ui/DatePicker"; import { DropDown } from "components/ui/DropDown"; import { Input } from "components/ui/Input"; import { Multiselect } from "components/ui/Multiselect"; -import { SecretTextArea } from "components/ui/SecretTextArea"; import { TagInput } from "components/ui/TagInput/TagInput"; import { TextArea } from "components/ui/TextArea"; @@ -13,27 +12,16 @@ import { FormBaseItem } from "core/form/types"; import { useExperiment } from "hooks/services/Experiment"; import { isDefined } from "utils/common"; -import ConfirmationControl from "./ConfirmationControl"; +import SecretConfirmationControl from "./SecretConfirmationControl"; interface ControlProps { property: FormBaseItem; name: string; - unfinishedFlows: Record; - addUnfinishedFlow: (key: string, info?: Record) => void; - removeUnfinishedFlow: (key: string) => void; disabled?: boolean; error?: boolean; } -export const Control: React.FC = ({ - property, - name, - addUnfinishedFlow, - removeUnfinishedFlow, - unfinishedFlows, - disabled, - error, -}) => { +export const Control: React.FC = ({ property, name, disabled, error }) => { const [field, meta, helpers] = useField(name); const useDatepickerExperiment = useExperiment("connector.form.useDatepicker", true); @@ -107,46 +95,14 @@ export const Control: React.FC = ({ } else if (property.multiline && !property.isSecret) { return