From 94cb5e2f76ec9bafcb03e7e2610f4e013afdc9ef Mon Sep 17 00:00:00 2001 From: Edmundo Ruiz Ghanem Date: Sat, 17 Dec 2022 18:53:56 -0500 Subject: [PATCH 1/2] Add i18n for disabling the connection, limit supported preferences --- airbyte-webapp/src/locales/en.json | 1 + .../components/NonBreakingChangesPreferenceField.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/airbyte-webapp/src/locales/en.json b/airbyte-webapp/src/locales/en.json index ba74f8919b3e..d676dc36bda3 100644 --- a/airbyte-webapp/src/locales/en.json +++ b/airbyte-webapp/src/locales/en.json @@ -153,6 +153,7 @@ "connectionForm.nonBreakingChangesPreference.label": "Non-breaking schema updates detected*", "connectionForm.nonBreakingChangesPreference.message": "Set how Airbyte handles syncs when it detects a non-breaking schema change in the source", "connectionForm.nonBreakingChangesPreference.ignore": "Ignore", + "connectionForm.nonBreakingChangesPreference.disable": "Disable connection", "connectionForm.schemaChangesBackdrop.message": "Please review the schema updates before making changes to the connection", "connectionForm.modal.destinationNamespace.title": "Destination namespace", diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx index bbaf9f786e3c..9c966156572d 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx +++ b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx @@ -11,12 +11,13 @@ import { useConnectionFormService } from "hooks/services/ConnectionForm/Connecti import styles from "./NonBreakingChangesPreferenceField.module.scss"; +const SUPPORTED_PREFERENCES = [NonBreakingChangesPreference.ignore, NonBreakingChangesPreference.disable]; + export const NonBreakingChangesPreferenceField: React.FC> = ({ field, form }) => { const { formatMessage } = useIntl(); const preferenceOptions = useMemo(() => { - const values = Object.values(NonBreakingChangesPreference); - return values.map((value) => ({ + return SUPPORTED_PREFERENCES.map((value) => ({ value, label: formatMessage({ id: `connectionForm.nonBreakingChangesPreference.${value}` }), testId: `nonBreakingChangesPreference-${value}`, From 129e378869161b544caa3d16a47285ef958f858c Mon Sep 17 00:00:00 2001 From: Edmundo Ruiz Ghanem Date: Sat, 17 Dec 2022 19:00:24 -0500 Subject: [PATCH 2/2] Remove custom style from NonBreakingChangsPreferenceField control label - not needed --- .../NonBreakingChangesPreferenceField.module.scss | 6 ------ .../components/NonBreakingChangesPreferenceField.tsx | 1 - 2 files changed, 7 deletions(-) diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.module.scss b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.module.scss index 048cc29205f6..2ed03bedffaa 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.module.scss +++ b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.module.scss @@ -9,12 +9,6 @@ gap: variables.$spacing-md; } -.connectorLabel { - max-width: 328px; - margin-right: variables.$spacing-xl; - vertical-align: top; -} - .leftFieldCol { flex: 1; max-width: 640px; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx index 9c966156572d..35d7b9c29794 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx +++ b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx @@ -30,7 +30,6 @@ export const NonBreakingChangesPreferenceField: React.FC> = (