From 80504d998ee02ac1858b7534759e6eb30210a021 Mon Sep 17 00:00:00 2001 From: Greg Solovyev Date: Thu, 5 Jan 2023 10:20:26 -0800 Subject: [PATCH] =?UTF-8?q?Switch=20order=20of=20namespaces=20and=20make?= =?UTF-8?q?=20Destination=20Default=20is=20the=20defaul=E2=80=A6=20(#21047?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Switch order of namespace options to make Destination Default appear as the first option * Destination Default is the default option * Update expected HTML --- .../CreateConnectionForm.test.tsx.snap | 8 ++++---- .../DestinationNamespaceModal.tsx | 20 +++++++++---------- .../components/NamespaceDefinitionField.tsx | 10 +++++----- .../Connection/ConnectionForm/formConfig.tsx | 4 ++-- tools/bin/load_test/connection_spec.json | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap b/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap index 52063787cf72..2c8b7bf76885 100644 --- a/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap +++ b/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap @@ -258,7 +258,7 @@ exports[`CreateConnectionForm should render 1`] = `
- Mirror source structure + Destination default
@@ -303,7 +303,7 @@ exports[`CreateConnectionForm should render 1`] = ` @@ -796,9 +796,9 @@ exports[`CreateConnectionForm should render 1`] = ` />
- '<source schema> + '<destination schema>
return ( - + } - value={NamespaceDefinitionType.source} - checked={field.value === NamespaceDefinitionType.source} + value={NamespaceDefinitionType.destination} + checked={field.value === NamespaceDefinitionType.destination} /> )} @@ -85,14 +85,14 @@ export const DestinationNamespaceModal: React.FC - + } - value={NamespaceDefinitionType.destination} - checked={field.value === NamespaceDefinitionType.destination} + value={NamespaceDefinitionType.source} + checked={field.value === NamespaceDefinitionType.source} /> )} diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.tsx b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.tsx index c56c0b26c035..6378495322df 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.tsx +++ b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.tsx @@ -10,16 +10,16 @@ import { NamespaceDefinitionType } from "../../../../core/request/AirbyteClient" import styles from "./NamespaceDefinitionField.module.scss"; export const StreamOptions = [ - { - value: NamespaceDefinitionType.source, - label: , - testId: "namespaceDefinition-source", - }, { value: NamespaceDefinitionType.destination, label: , testId: "namespaceDefinition-destination", }, + { + value: NamespaceDefinitionType.source, + label: , + testId: "namespaceDefinition-source", + }, { value: NamespaceDefinitionType.customformat, label: , diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.tsx b/airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.tsx index 8bc5d5d9db0c..22168ab51394 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.tsx +++ b/airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.tsx @@ -138,8 +138,8 @@ export const createConnectionValidationSchema = ({ namespaceDefinition: yup .string() .oneOf([ - NamespaceDefinitionType.source, NamespaceDefinitionType.destination, + NamespaceDefinitionType.source, NamespaceDefinitionType.customformat, ]) .required("form.empty.error"), @@ -365,7 +365,7 @@ export const useInitialValues = ( scheduleData: connection.connectionId ? connection.scheduleData ?? null : DEFAULT_SCHEDULE, nonBreakingChangesPreference: connection.nonBreakingChangesPreference ?? NonBreakingChangesPreference.ignore, prefix: connection.prefix || "", - namespaceDefinition: connection.namespaceDefinition || NamespaceDefinitionType.source, + namespaceDefinition: connection.namespaceDefinition || NamespaceDefinitionType.destination, namespaceFormat: connection.namespaceFormat ?? SOURCE_NAMESPACE_TAG, geography: connection.geography || workspace.defaultGeography || "auto", }; diff --git a/tools/bin/load_test/connection_spec.json b/tools/bin/load_test/connection_spec.json index b4678cf58a98..6e81bcbe8500 100644 --- a/tools/bin/load_test/connection_spec.json +++ b/tools/bin/load_test/connection_spec.json @@ -32,7 +32,7 @@ ] }, "prefix": "", - "namespaceDefinition": "source", + "namespaceDefinition": "destination", "namespaceFormat": "${SOURCE_NAMESPACE}", "scheduleType": "basic", "scheduleData": {