diff --git a/airbyte-webapp/src/components/CreateConnection/CreateConnectionNameField.module.scss b/airbyte-webapp/src/components/CreateConnection/CreateConnectionNameField.module.scss deleted file mode 100644 index 5ef27259b6ec3..0000000000000 --- a/airbyte-webapp/src/components/CreateConnection/CreateConnectionNameField.module.scss +++ /dev/null @@ -1 +0,0 @@ -@forward "../../views/Connection/ConnectionForm/ConnectionFormFields.module.scss"; diff --git a/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx b/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx index 07e5cf648c450..cf9e291728f11 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx @@ -3,6 +3,7 @@ import React, { useMemo } from "react"; import { FormattedMessage } from "react-intl"; import { Cell, Header } from "components"; +import { SUPPORTED_MODES } from "components/connection/ConnectionForm/formConfig"; import { Button } from "components/ui/Button"; import { Switch } from "components/ui/Switch"; @@ -10,7 +11,6 @@ import { SyncSchemaField, SyncSchemaFieldObject, SyncSchemaStream, traverseSchem import { DestinationSyncMode, SyncMode } from "core/request/AirbyteClient"; import { useBulkEditService } from "hooks/services/BulkEdit/BulkEditService"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; -import { SUPPORTED_MODES } from "views/Connection/ConnectionForm/formConfig"; import styles from "./BulkHeader.module.scss"; import { pathDisplayName, PathPopout } from "./PathPopout"; diff --git a/airbyte-webapp/src/components/connection/CatalogTree/CatalogSection.tsx b/airbyte-webapp/src/components/connection/CatalogTree/CatalogSection.tsx index 3e57e6895d3a8..b1f5fb973048e 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/CatalogSection.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/CatalogSection.tsx @@ -3,6 +3,7 @@ import isEqual from "lodash/isEqual"; import React, { memo, useCallback, useMemo } from "react"; import { useToggle } from "react-use"; +import { ConnectionFormValues, SUPPORTED_MODES } from "components/connection/ConnectionForm/formConfig"; import { DropDownOptionDataItem } from "components/ui/DropDown"; import { SyncSchemaField, SyncSchemaFieldObject, SyncSchemaStream } from "core/domain/catalog"; @@ -18,7 +19,6 @@ import { useDestinationNamespace } from "hooks/connection/useDestinationNamespac import { useNewTableDesignExperiment } from "hooks/connection/useNewTableDesignExperiment"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; import { naturalComparatorBy } from "utils/objects"; -import { ConnectionFormValues, SUPPORTED_MODES } from "views/Connection/ConnectionForm/formConfig"; import styles from "./CatalogSection.module.scss"; import { CatalogTreeTableRow } from "./next/CatalogTreeTableRow"; diff --git a/airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeBody.tsx b/airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeBody.tsx index 95996bb2c6c39..da13166480e97 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeBody.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeBody.tsx @@ -1,11 +1,12 @@ import { Field, FieldProps, setIn } from "formik"; import React, { useCallback } from "react"; +import { FormikConnectionFormValues } from "components/connection/ConnectionForm/formConfig"; + import { SyncSchemaStream } from "core/domain/catalog"; import { AirbyteStreamConfiguration } from "core/request/AirbyteClient"; import { useNewTableDesignExperiment } from "hooks/connection/useNewTableDesignExperiment"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; -import { FormikConnectionFormValues } from "views/Connection/ConnectionForm/formConfig"; import { BulkHeader } from "./BulkHeader"; import { CatalogSection } from "./CatalogSection"; diff --git a/airbyte-webapp/src/components/connection/CatalogTree/next/BulkEditPanel.tsx b/airbyte-webapp/src/components/connection/CatalogTree/next/BulkEditPanel.tsx index 662f412b1864a..15d99015490cb 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/next/BulkEditPanel.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/next/BulkEditPanel.tsx @@ -6,6 +6,7 @@ import { FormattedMessage } from "react-intl"; import styled from "styled-components"; import { Header } from "components"; +import { SUPPORTED_MODES } from "components/connection/ConnectionForm/formConfig"; import { Button } from "components/ui/Button"; import { Switch } from "components/ui/Switch"; @@ -13,7 +14,6 @@ import { SyncSchemaField, SyncSchemaFieldObject, SyncSchemaStream, traverseSchem import { DestinationSyncMode, SyncMode } from "core/request/AirbyteClient"; import { useBulkEditService } from "hooks/services/BulkEdit/BulkEditService"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; -import { SUPPORTED_MODES } from "views/Connection/ConnectionForm/formConfig"; import { pathDisplayName } from "../PathPopout"; import { HeaderCell } from "../styles"; diff --git a/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableHeader.tsx b/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableHeader.tsx index a6abcd8169e59..4f48bb8b1db31 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableHeader.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableHeader.tsx @@ -5,6 +5,7 @@ import { useFormikContext } from "formik"; import React from "react"; import { FormattedMessage } from "react-intl"; +import { FormikConnectionFormValues } from "components/connection/ConnectionForm/formConfig"; import { Header } from "components/SimpleTableComponents"; import { Button } from "components/ui/Button"; import { CheckBox } from "components/ui/CheckBox"; @@ -17,7 +18,6 @@ import { useBulkEditService } from "hooks/services/BulkEdit/BulkEditService"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; import { useModalService } from "hooks/services/Modal"; import { links } from "utils/links"; -import { FormikConnectionFormValues } from "views/Connection/ConnectionForm/formConfig"; import { DestinationNamespaceFormValueType, diff --git a/airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.test.tsx b/airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.test.tsx index 191eefe324022..f3c15c9687295 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.test.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/next/useCatalogTreeTableRowProps.test.tsx @@ -1,10 +1,11 @@ import { renderHook } from "@testing-library/react-hooks"; import * as formik from "formik"; +import { FormikConnectionFormValues } from "components/connection/ConnectionForm/formConfig"; + import { AirbyteStreamAndConfiguration } from "core/request/AirbyteClient"; import * as bulkEditService from "hooks/services/BulkEdit/BulkEditService"; import * as connectionFormService from "hooks/services/ConnectionForm/ConnectionFormService"; -import { FormikConnectionFormValues } from "views/Connection/ConnectionForm/formConfig"; // eslint-disable-next-line css-modules/no-unused-class import { useCatalogTreeTableRowProps } from "./useCatalogTreeTableRowProps"; diff --git a/airbyte-webapp/src/views/Connection/FormCard.module.scss b/airbyte-webapp/src/components/connection/ConnectionEditFormCard/ConnectionEditFormCard.module.scss similarity index 68% rename from airbyte-webapp/src/views/Connection/FormCard.module.scss rename to airbyte-webapp/src/components/connection/ConnectionEditFormCard/ConnectionEditFormCard.module.scss index bcb8d01884c5d..ce45b41bb4f7d 100644 --- a/airbyte-webapp/src/views/Connection/FormCard.module.scss +++ b/airbyte-webapp/src/components/connection/ConnectionEditFormCard/ConnectionEditFormCard.module.scss @@ -1,4 +1,4 @@ -@use "../../scss/variables"; +@use "scss/variables"; .formCard { padding: 22px 27px variables.$spacing-xl 24px; diff --git a/airbyte-webapp/src/views/Connection/FormCard.tsx b/airbyte-webapp/src/components/connection/ConnectionEditFormCard/ConnectionEditFormCard.tsx similarity index 89% rename from airbyte-webapp/src/views/Connection/FormCard.tsx rename to airbyte-webapp/src/components/connection/ConnectionEditFormCard/ConnectionEditFormCard.tsx index 22d6a7157d2e2..a0be5283d3338 100644 --- a/airbyte-webapp/src/views/Connection/FormCard.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionEditFormCard/ConnectionEditFormCard.tsx @@ -4,13 +4,13 @@ import { useIntl } from "react-intl"; import { useMutation } from "react-query"; import { FormChangeTracker } from "components/common/FormChangeTracker"; +import { CollapsibleCardProps, CollapsibleCard } from "components/ui/CollapsibleCard"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; import { generateMessageFromError } from "utils/errorStatusMessage"; -import { CollapsibleCardProps, CollapsibleCard } from "views/Connection/CollapsibleCard"; -import EditControls from "views/Connection/ConnectionForm/components/EditControls"; -import styles from "./FormCard.module.scss"; +import EditControls from "../ConnectionForm/EditControls"; +import styles from "./ConnectionEditFormCard.module.scss"; interface FormCardProps extends CollapsibleCardProps { bottomSeparator?: boolean; @@ -18,7 +18,7 @@ interface FormCardProps extends CollapsibleCardProps { submitDisabled?: boolean; } -export const FormCard = ({ +export const ConnectionEditFormCard = ({ children, form, bottomSeparator = true, diff --git a/airbyte-webapp/src/components/connection/ConnectionEditFormCard/index.ts b/airbyte-webapp/src/components/connection/ConnectionEditFormCard/index.ts new file mode 100644 index 0000000000000..eab9ebf0515ca --- /dev/null +++ b/airbyte-webapp/src/components/connection/ConnectionEditFormCard/index.ts @@ -0,0 +1 @@ +export * from "./ConnectionEditFormCard"; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionForm.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/ConnectionForm.module.scss similarity index 89% rename from airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionForm.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/ConnectionForm.module.scss index cfefbbda849bc..bab2c348a160d 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionForm.module.scss +++ b/airbyte-webapp/src/components/connection/ConnectionForm/ConnectionForm.module.scss @@ -1,4 +1,4 @@ -@use "../../../scss/variables"; +@use "scss/variables"; .formContainer { display: flex; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionFormFields.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/ConnectionFormFields.module.scss similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionFormFields.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/ConnectionFormFields.module.scss diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionFormFields.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/ConnectionFormFields.tsx similarity index 94% rename from airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionFormFields.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/ConnectionFormFields.tsx index 4f1e923127dab..a203ced39949d 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/ConnectionFormFields.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionForm/ConnectionFormFields.tsx @@ -19,14 +19,14 @@ import { FeatureItem, useFeature } from "hooks/services/Feature"; import { useFormChangeTrackerService } from "hooks/services/FormChangeTracker"; import { ValuesProps } from "hooks/services/useConnectionHook"; -import { NamespaceDefinitionField } from "./components/NamespaceDefinitionField"; -import { NonBreakingChangesPreferenceField } from "./components/NonBreakingChangesPreferenceField"; -import { useRefreshSourceSchemaWithConfirmationOnDirty } from "./components/refreshSourceSchemaWithConfirmationOnDirty"; -import { Section } from "./components/Section"; -import { SyncCatalogField } from "./components/SyncCatalogField"; import styles from "./ConnectionFormFields.module.scss"; import { FormikConnectionFormValues } from "./formConfig"; +import { NamespaceDefinitionField } from "./NamespaceDefinitionField"; +import { NonBreakingChangesPreferenceField } from "./NonBreakingChangesPreferenceField"; +import { useRefreshSourceSchemaWithConfirmationOnDirty } from "./refreshSourceSchemaWithConfirmationOnDirty"; import { ScheduleField } from "./ScheduleField"; +import { Section } from "./Section"; +import { SyncCatalogField } from "./SyncCatalogField"; interface ConnectionFormFieldsProps { values: ValuesProps | FormikConnectionFormValues; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/CreateControls.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/CreateControls.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/CreateControls.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/CreateControls.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/EditControls.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/EditControls.module.scss similarity index 89% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/EditControls.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/EditControls.module.scss index f3facf6c193ae..2afd4f0946a34 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/EditControls.module.scss +++ b/airbyte-webapp/src/components/connection/ConnectionForm/EditControls.module.scss @@ -1,5 +1,5 @@ -@use "../../../../scss/colors"; -@use "../../../../scss/variables"; +@use "scss/colors"; +@use "scss/variables"; .content { display: flex; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/EditControls.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/EditControls.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/EditControls.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/EditControls.tsx diff --git a/airbyte-webapp/src/components/connection/ConnectionForm/NamespaceDefinitionField.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/NamespaceDefinitionField.module.scss new file mode 100644 index 0000000000000..563d2e39f88e6 --- /dev/null +++ b/airbyte-webapp/src/components/connection/ConnectionForm/NamespaceDefinitionField.module.scss @@ -0,0 +1 @@ +@forward "./ConnectionFormFields.module.scss"; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/NamespaceDefinitionField.tsx similarity index 95% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/NamespaceDefinitionField.tsx index 75cbf5cd1b682..56cdf8822e18d 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionForm/NamespaceDefinitionField.tsx @@ -6,7 +6,8 @@ import { ControlLabels } from "components/LabeledControl"; import { DropDown } from "components/ui/DropDown"; import { FlexContainer } from "components/ui/Flex"; -import { NamespaceDefinitionType } from "../../../../core/request/AirbyteClient"; +import { NamespaceDefinitionType } from "core/request/AirbyteClient"; + import styles from "./NamespaceDefinitionField.module.scss"; export const StreamOptions = [ diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/NonBreakingChangesPreferenceField.module.scss similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/NonBreakingChangesPreferenceField.module.scss diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/NonBreakingChangesPreferenceField.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/NonBreakingChangesPreferenceField.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/NonBreakingChangesPreferenceField.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NormalizationField.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/NormalizationField.module.scss similarity index 63% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/NormalizationField.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/NormalizationField.module.scss index 044bcdd2bf939..b5ddcbf376933 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NormalizationField.module.scss +++ b/airbyte-webapp/src/components/connection/ConnectionForm/NormalizationField.module.scss @@ -1,4 +1,4 @@ -@use "../../../../scss/variables"; +@use "scss/variables"; .normalizationField { margin: variables.$spacing-lg 0; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NormalizationField.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/NormalizationField.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/NormalizationField.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/NormalizationField.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/OctaviaRedFlag.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/OctaviaRedFlag.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/OctaviaRedFlag.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/OctaviaRedFlag.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/OctaviaYellowFlag.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/OctaviaYellowFlag.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/OctaviaYellowFlag.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/OctaviaYellowFlag.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/OperationsSection.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/OperationsSection.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/OperationsSection.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/OperationsSection.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/ResponseMessage.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/ResponseMessage.module.scss similarity index 83% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/ResponseMessage.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/ResponseMessage.module.scss index c25439ef2ed53..0129d653d504c 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/ResponseMessage.module.scss +++ b/airbyte-webapp/src/components/connection/ConnectionForm/ResponseMessage.module.scss @@ -1,4 +1,4 @@ -@use "../../../../scss/colors"; +@use "scss/colors"; .message { overflow: hidden; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/ResponseMessage.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/ResponseMessage.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/ResponseMessage.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/ResponseMessage.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/ScheduleField.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/ScheduleField.module.scss similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/ScheduleField.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/ScheduleField.module.scss diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/ScheduleField.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/ScheduleField.tsx similarity index 98% rename from airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/ScheduleField.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/ScheduleField.tsx index 368c39c97576a..4af82c1b81ac2 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/ScheduleField.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionForm/ScheduleField.tsx @@ -8,14 +8,14 @@ import { FlexContainer } from "components/ui/Flex"; import { Input } from "components/ui/Input"; import { Text } from "components/ui/Text"; +import availableCronTimeZones from "config/availableCronTimeZones.json"; import { Action, Namespace } from "core/analytics"; import { ConnectionScheduleData, ConnectionScheduleType } from "core/request/AirbyteClient"; import { useAnalyticsService } from "hooks/services/Analytics"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; import { links } from "utils/links"; -import availableCronTimeZones from "../../../../config/availableCronTimeZones.json"; -import { FormikConnectionFormValues, useFrequencyDropdownData } from "../formConfig"; +import { FormikConnectionFormValues, useFrequencyDropdownData } from "./formConfig"; import styles from "./ScheduleField.module.scss"; const CRON_DEFAULT_VALUE = { diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/SchemaChangeBackdrop.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/SchemaChangeBackdrop.module.scss similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/SchemaChangeBackdrop.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/SchemaChangeBackdrop.module.scss diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/SchemaChangeBackdrop.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/SchemaChangeBackdrop.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/SchemaChangeBackdrop.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/SchemaChangeBackdrop.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/SchemaChangesBackdrop.test.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/SchemaChangesBackdrop.test.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/SchemaChangesBackdrop.test.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/SchemaChangesBackdrop.test.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/Section.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/Section.module.scss similarity index 87% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/Section.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/Section.module.scss index 54c545da209ff..21de992686e53 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/Section.module.scss +++ b/airbyte-webapp/src/components/connection/ConnectionForm/Section.module.scss @@ -1,4 +1,4 @@ -@use "../../../../scss/variables"; +@use "scss/variables"; .section { padding: variables.$spacing-xl; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/Section.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/Section.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/Section.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/Section.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/SyncCatalogField.module.scss b/airbyte-webapp/src/components/connection/ConnectionForm/SyncCatalogField.module.scss similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/SyncCatalogField.module.scss rename to airbyte-webapp/src/components/connection/ConnectionForm/SyncCatalogField.module.scss diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/SyncCatalogField.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/SyncCatalogField.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/SyncCatalogField.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/SyncCatalogField.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/TransformationField.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/TransformationField.tsx similarity index 94% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/TransformationField.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/TransformationField.tsx index 7d420dc72e963..f8b0f72b9c3df 100644 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/TransformationField.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionForm/TransformationField.tsx @@ -3,13 +3,13 @@ import React, { useState } from "react"; import { FormattedMessage } from "react-intl"; import ArrayOfObjectsEditor from "components/ArrayOfObjectsEditor"; +import TransformationForm from "components/connection/TransformationForm"; import { OperationRead } from "core/request/AirbyteClient"; import { ConnectionFormMode } from "hooks/services/ConnectionForm/ConnectionFormService"; import { isDefined } from "utils/common"; -import TransformationForm from "views/Connection/TransformationForm"; -import { useDefaultTransformation } from "../formConfig"; +import { useDefaultTransformation } from "./formConfig"; interface TransformationFieldProps extends ArrayHelpers { form: FormikProps<{ transformations: OperationRead[] }>; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/__snapshots__/SchemaChangesBackdrop.test.tsx.snap b/airbyte-webapp/src/components/connection/ConnectionForm/__snapshots__/SchemaChangesBackdrop.test.tsx.snap similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/__snapshots__/SchemaChangesBackdrop.test.tsx.snap rename to airbyte-webapp/src/components/connection/ConnectionForm/__snapshots__/SchemaChangesBackdrop.test.tsx.snap diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/__snapshots__/formConfig.test.ts.snap b/airbyte-webapp/src/components/connection/ConnectionForm/__snapshots__/formConfig.test.ts.snap similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/__snapshots__/formConfig.test.ts.snap rename to airbyte-webapp/src/components/connection/ConnectionForm/__snapshots__/formConfig.test.ts.snap diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/calculateInitialCatalog.test.ts b/airbyte-webapp/src/components/connection/ConnectionForm/calculateInitialCatalog.test.ts similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/calculateInitialCatalog.test.ts rename to airbyte-webapp/src/components/connection/ConnectionForm/calculateInitialCatalog.test.ts diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/calculateInitialCatalog.ts b/airbyte-webapp/src/components/connection/ConnectionForm/calculateInitialCatalog.ts similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/calculateInitialCatalog.ts rename to airbyte-webapp/src/components/connection/ConnectionForm/calculateInitialCatalog.ts diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.test.ts b/airbyte-webapp/src/components/connection/ConnectionForm/formConfig.test.ts similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.test.ts rename to airbyte-webapp/src/components/connection/ConnectionForm/formConfig.test.ts diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.tsx b/airbyte-webapp/src/components/connection/ConnectionForm/formConfig.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/formConfig.tsx rename to airbyte-webapp/src/components/connection/ConnectionForm/formConfig.tsx diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/refreshSourceSchemaWithConfirmationOnDirty.ts b/airbyte-webapp/src/components/connection/ConnectionForm/refreshSourceSchemaWithConfirmationOnDirty.ts similarity index 100% rename from airbyte-webapp/src/views/Connection/ConnectionForm/components/refreshSourceSchemaWithConfirmationOnDirty.ts rename to airbyte-webapp/src/components/connection/ConnectionForm/refreshSourceSchemaWithConfirmationOnDirty.ts diff --git a/airbyte-webapp/src/components/connection/ConnectionInfoCard/ConnectionInfoCard.test.tsx b/airbyte-webapp/src/components/connection/ConnectionInfoCard/ConnectionInfoCard.test.tsx index a56cd970f55de..62000fd264e9e 100644 --- a/airbyte-webapp/src/components/connection/ConnectionInfoCard/ConnectionInfoCard.test.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionInfoCard/ConnectionInfoCard.test.tsx @@ -23,7 +23,7 @@ jest.doMock("services/connector/DestinationDefinitionService", () => ({ useDestinationDefinition: () => mockDestinationDefinitionSpecification, })); -jest.doMock("views/Connection/ConnectionForm/components/refreshSourceSchemaWithConfirmationOnDirty", () => ({ +jest.doMock("components/connection/ConnectionForm/refreshSourceSchemaWithConfirmationOnDirty", () => ({ useRefreshSourceSchemaWithConfirmationOnDirty: jest.fn(), })); diff --git a/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.test.tsx b/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.test.tsx index 28da1d78aa01c..ca1e56f331360 100644 --- a/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.test.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.test.tsx @@ -17,7 +17,7 @@ jest.doMock("hooks/services/ConnectionEdit/ConnectionEditService", () => ({ const mockUseRefreshSourceSchemaWithConfirmationOnDirty = jest.fn(); -jest.doMock("views/Connection/ConnectionForm/components/refreshSourceSchemaWithConfirmationOnDirty", () => ({ +jest.doMock("components/connection/ConnectionForm/refreshSourceSchemaWithConfirmationOnDirty", () => ({ useRefreshSourceSchemaWithConfirmationOnDirty: mockUseRefreshSourceSchemaWithConfirmationOnDirty, })); diff --git a/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.tsx b/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.tsx index 4b8fd87073ece..a1ab52a9a1a67 100644 --- a/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.tsx +++ b/airbyte-webapp/src/components/connection/ConnectionInfoCard/SchemaChangesDetected.tsx @@ -2,6 +2,7 @@ import classNames from "classnames"; import { FormattedMessage } from "react-intl"; import { useLocation, useNavigate } from "react-router-dom"; +import { useRefreshSourceSchemaWithConfirmationOnDirty } from "components/connection/ConnectionForm/refreshSourceSchemaWithConfirmationOnDirty"; import { Button } from "components/ui/Button"; import { Text } from "components/ui/Text"; @@ -9,7 +10,6 @@ import { useSchemaChanges } from "hooks/connection/useSchemaChanges"; import { useConnectionEditService } from "hooks/services/ConnectionEdit/ConnectionEditService"; import { useFormChangeTrackerService } from "hooks/services/FormChangeTracker"; import { ConnectionRoutePaths } from "pages/connections/types"; -import { useRefreshSourceSchemaWithConfirmationOnDirty } from "views/Connection/ConnectionForm/components/refreshSourceSchemaWithConfirmationOnDirty"; import styles from "./SchemaChangesDetected.module.scss"; diff --git a/airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.module.scss b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.module.scss similarity index 85% rename from airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.module.scss rename to airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.module.scss index 982150eae3267..8d254efe4067c 100644 --- a/airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.module.scss +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.module.scss @@ -1,4 +1,4 @@ -@use "../../scss/variables"; +@use "scss/variables"; .connectionFormContainer { width: 100%; diff --git a/airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.test.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.test.tsx similarity index 100% rename from airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.test.tsx rename to airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.test.tsx diff --git a/airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.tsx similarity index 93% rename from airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.tsx rename to airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.tsx index 3f958ed947d21..db63efa2da59c 100644 --- a/airbyte-webapp/src/components/CreateConnection/CreateConnectionForm.tsx +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionForm.tsx @@ -2,6 +2,13 @@ import { Form, Formik, FormikHelpers } from "formik"; import React, { Suspense, useCallback, useState } from "react"; import { useNavigate } from "react-router-dom"; +import { ConnectionFormFields } from "components/connection/ConnectionForm/ConnectionFormFields"; +import CreateControls from "components/connection/ConnectionForm/CreateControls"; +import { + FormikConnectionFormValues, + useConnectionValidationSchema, +} from "components/connection/ConnectionForm/formConfig"; +import { OperationsSection } from "components/connection/ConnectionForm/OperationsSection"; import LoadingSchema from "components/LoadingSchema"; import { DestinationRead, SourceRead } from "core/request/AirbyteClient"; @@ -15,10 +22,6 @@ import { useFormChangeTrackerService } from "hooks/services/FormChangeTracker"; import { useCreateConnection } from "hooks/services/useConnectionHook"; import { SchemaError as SchemaErrorType, useDiscoverSchema } from "hooks/services/useSourceHook"; import { useCurrentWorkspaceId } from "services/workspaces/WorkspacesService"; -import CreateControls from "views/Connection/ConnectionForm/components/CreateControls"; -import { OperationsSection } from "views/Connection/ConnectionForm/components/OperationsSection"; -import { ConnectionFormFields } from "views/Connection/ConnectionForm/ConnectionFormFields"; -import { useConnectionValidationSchema, FormikConnectionFormValues } from "views/Connection/ConnectionForm/formConfig"; import styles from "./CreateConnectionForm.module.scss"; import { CreateConnectionNameField } from "./CreateConnectionNameField"; diff --git a/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionNameField.module.scss b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionNameField.module.scss new file mode 100644 index 0000000000000..778ee0f733459 --- /dev/null +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionNameField.module.scss @@ -0,0 +1 @@ +@forward "../ConnectionForm/ConnectionFormFields.module.scss"; diff --git a/airbyte-webapp/src/components/CreateConnection/CreateConnectionNameField.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionNameField.tsx similarity index 94% rename from airbyte-webapp/src/components/CreateConnection/CreateConnectionNameField.tsx rename to airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionNameField.tsx index 6b450c3f92233..a362de2cc70d8 100644 --- a/airbyte-webapp/src/components/CreateConnection/CreateConnectionNameField.tsx +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/CreateConnectionNameField.tsx @@ -1,12 +1,11 @@ import { Field, FieldProps } from "formik"; import { FormattedMessage, useIntl } from "react-intl"; +import { Section } from "components/connection/ConnectionForm/Section"; import { ControlLabels } from "components/LabeledControl"; import { FlexContainer } from "components/ui/Flex"; import { Input } from "components/ui/Input"; -import { Section } from "views/Connection/ConnectionForm/components/Section"; - import styles from "./CreateConnectionNameField.module.scss"; export const CreateConnectionNameField = () => { diff --git a/airbyte-webapp/src/components/CreateConnection/DataResidency.module.scss b/airbyte-webapp/src/components/connection/CreateConnectionForm/DataResidency.module.scss similarity index 100% rename from airbyte-webapp/src/components/CreateConnection/DataResidency.module.scss rename to airbyte-webapp/src/components/connection/CreateConnectionForm/DataResidency.module.scss diff --git a/airbyte-webapp/src/components/CreateConnection/DataResidency.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/DataResidency.tsx similarity index 96% rename from airbyte-webapp/src/components/CreateConnection/DataResidency.tsx rename to airbyte-webapp/src/components/connection/CreateConnectionForm/DataResidency.tsx index a1cc35db4e07f..eae7dfd9f7689 100644 --- a/airbyte-webapp/src/components/CreateConnection/DataResidency.tsx +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/DataResidency.tsx @@ -3,13 +3,13 @@ import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { DataGeographyDropdown } from "components/common/DataGeographyDropdown"; +import { Section } from "components/connection/ConnectionForm/Section"; import { ControlLabels } from "components/LabeledControl"; import { FlexContainer } from "components/ui/Flex"; import { Geography } from "core/request/AirbyteClient"; import { useAvailableGeographies } from "packages/cloud/services/geographies/GeographiesService"; import { links } from "utils/links"; -import { Section } from "views/Connection/ConnectionForm/components/Section"; import styles from "./DataResidency.module.scss"; diff --git a/airbyte-webapp/src/components/CreateConnection/SchemaError.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/SchemaError.tsx similarity index 100% rename from airbyte-webapp/src/components/CreateConnection/SchemaError.tsx rename to airbyte-webapp/src/components/connection/CreateConnectionForm/SchemaError.tsx diff --git a/airbyte-webapp/src/components/CreateConnection/TryAfterErrorBlock.module.scss b/airbyte-webapp/src/components/connection/CreateConnectionForm/TryAfterErrorBlock.module.scss similarity index 85% rename from airbyte-webapp/src/components/CreateConnection/TryAfterErrorBlock.module.scss rename to airbyte-webapp/src/components/connection/CreateConnectionForm/TryAfterErrorBlock.module.scss index fae2399b7e238..f278fc269bf80 100644 --- a/airbyte-webapp/src/components/CreateConnection/TryAfterErrorBlock.module.scss +++ b/airbyte-webapp/src/components/connection/CreateConnectionForm/TryAfterErrorBlock.module.scss @@ -1,4 +1,4 @@ -@use "../../scss/variables"; +@use "scss/variables"; .container { padding: 40px; diff --git a/airbyte-webapp/src/components/CreateConnection/TryAfterErrorBlock.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/TryAfterErrorBlock.tsx similarity index 100% rename from airbyte-webapp/src/components/CreateConnection/TryAfterErrorBlock.tsx rename to airbyte-webapp/src/components/connection/CreateConnectionForm/TryAfterErrorBlock.tsx diff --git a/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap b/airbyte-webapp/src/components/connection/CreateConnectionForm/__snapshots__/CreateConnectionForm.test.tsx.snap similarity index 100% rename from airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap rename to airbyte-webapp/src/components/connection/CreateConnectionForm/__snapshots__/CreateConnectionForm.test.tsx.snap diff --git a/airbyte-webapp/src/components/CreateConnection/index.tsx b/airbyte-webapp/src/components/connection/CreateConnectionForm/index.tsx similarity index 100% rename from airbyte-webapp/src/components/CreateConnection/index.tsx rename to airbyte-webapp/src/components/connection/CreateConnectionForm/index.tsx diff --git a/airbyte-webapp/src/components/connection/DestinationNamespaceModal/DestinationNamespaceModal.tsx b/airbyte-webapp/src/components/connection/DestinationNamespaceModal/DestinationNamespaceModal.tsx index b4ecbc0d88a17..366a16bbf2b4d 100644 --- a/airbyte-webapp/src/components/connection/DestinationNamespaceModal/DestinationNamespaceModal.tsx +++ b/airbyte-webapp/src/components/connection/DestinationNamespaceModal/DestinationNamespaceModal.tsx @@ -4,6 +4,7 @@ import { FormattedMessage, useIntl } from "react-intl"; import * as yup from "yup"; import { LabeledRadioButton } from "components"; +import { FormikConnectionFormValues } from "components/connection/ConnectionForm/formConfig"; import { Button } from "components/ui/Button"; import { Input } from "components/ui/Input"; import { ModalBody, ModalFooter } from "components/ui/Modal"; @@ -11,7 +12,6 @@ import { Text } from "components/ui/Text"; import { NamespaceDefinitionType } from "core/request/AirbyteClient"; import { links } from "utils/links"; -import { FormikConnectionFormValues } from "views/Connection/ConnectionForm/formConfig"; import styles from "./DestinationNamespaceModal.module.scss"; import { ExampleSettingsTable } from "./ExampleSettingsTable"; diff --git a/airbyte-webapp/src/components/connection/DestinationStreamNamesModal/DestinationStreamNamesModal.tsx b/airbyte-webapp/src/components/connection/DestinationStreamNamesModal/DestinationStreamNamesModal.tsx index 5887e2c7e8e26..a06475b9802dc 100644 --- a/airbyte-webapp/src/components/connection/DestinationStreamNamesModal/DestinationStreamNamesModal.tsx +++ b/airbyte-webapp/src/components/connection/DestinationStreamNamesModal/DestinationStreamNamesModal.tsx @@ -4,14 +4,13 @@ import { FormattedMessage, useIntl } from "react-intl"; import * as yup from "yup"; import { LabeledRadioButton } from "components"; +import { FormikConnectionFormValues } from "components/connection/ConnectionForm/formConfig"; import { Button } from "components/ui/Button"; import { Input } from "components/ui/Input"; import { ModalBody, ModalFooter } from "components/ui/Modal"; import { Text } from "components/ui/Text"; import { InfoTooltip } from "components/ui/Tooltip"; -import { FormikConnectionFormValues } from "views/Connection/ConnectionForm/formConfig"; - import styles from "./DestinationStreamNamesModal.module.scss"; export const enum StreamNameDefinitionValueType { diff --git a/airbyte-webapp/src/views/Connection/TransformationForm/TransformationForm.module.scss b/airbyte-webapp/src/components/connection/TransformationForm/TransformationForm.module.scss similarity index 100% rename from airbyte-webapp/src/views/Connection/TransformationForm/TransformationForm.module.scss rename to airbyte-webapp/src/components/connection/TransformationForm/TransformationForm.module.scss diff --git a/airbyte-webapp/src/views/Connection/TransformationForm/TransformationForm.tsx b/airbyte-webapp/src/components/connection/TransformationForm/TransformationForm.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/TransformationForm/TransformationForm.tsx rename to airbyte-webapp/src/components/connection/TransformationForm/TransformationForm.tsx diff --git a/airbyte-webapp/src/views/Connection/TransformationForm/index.tsx b/airbyte-webapp/src/components/connection/TransformationForm/index.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/TransformationForm/index.tsx rename to airbyte-webapp/src/components/connection/TransformationForm/index.tsx diff --git a/airbyte-webapp/src/views/Connection/TransformationForm/utils.test.ts b/airbyte-webapp/src/components/connection/TransformationForm/utils.test.ts similarity index 100% rename from airbyte-webapp/src/views/Connection/TransformationForm/utils.test.ts rename to airbyte-webapp/src/components/connection/TransformationForm/utils.test.ts diff --git a/airbyte-webapp/src/views/Connection/TransformationForm/utils.ts b/airbyte-webapp/src/components/connection/TransformationForm/utils.ts similarity index 100% rename from airbyte-webapp/src/views/Connection/TransformationForm/utils.ts rename to airbyte-webapp/src/components/connection/TransformationForm/utils.ts diff --git a/airbyte-webapp/src/views/Connection/CollapsibleCard.module.scss b/airbyte-webapp/src/components/ui/CollapsibleCard/CollapsibleCard.module.scss similarity index 100% rename from airbyte-webapp/src/views/Connection/CollapsibleCard.module.scss rename to airbyte-webapp/src/components/ui/CollapsibleCard/CollapsibleCard.module.scss diff --git a/airbyte-webapp/src/views/Connection/CollapsibleCard.tsx b/airbyte-webapp/src/components/ui/CollapsibleCard/CollapsibleCard.tsx similarity index 100% rename from airbyte-webapp/src/views/Connection/CollapsibleCard.tsx rename to airbyte-webapp/src/components/ui/CollapsibleCard/CollapsibleCard.tsx diff --git a/airbyte-webapp/src/components/ui/CollapsibleCard/index.stories.tsx b/airbyte-webapp/src/components/ui/CollapsibleCard/index.stories.tsx new file mode 100644 index 0000000000000..81a1adbd6b236 --- /dev/null +++ b/airbyte-webapp/src/components/ui/CollapsibleCard/index.stories.tsx @@ -0,0 +1,18 @@ +import { ComponentStory, ComponentMeta } from "@storybook/react"; + +import { CollapsibleCard } from "./CollapsibleCard"; + +export default { + title: "UI/CollapsibleCard", + component: CollapsibleCard, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ; + +export const Primary = Template.bind({}); +Primary.args = { + title: "Card Title", + children: "The collapsible content goes here.", + collapsible: true, + defaultCollapsedState: true, +}; diff --git a/airbyte-webapp/src/components/ui/CollapsibleCard/index.ts b/airbyte-webapp/src/components/ui/CollapsibleCard/index.ts new file mode 100644 index 0000000000000..ebffc2536e4fc --- /dev/null +++ b/airbyte-webapp/src/components/ui/CollapsibleCard/index.ts @@ -0,0 +1 @@ +export * from "./CollapsibleCard"; diff --git a/airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.tsx b/airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.tsx index 03e9c25cfa460..6de41a2efe6ae 100644 --- a/airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.tsx +++ b/airbyte-webapp/src/hooks/services/ConnectionForm/ConnectionFormService.tsx @@ -1,6 +1,14 @@ import React, { createContext, useCallback, useContext, useState } from "react"; import { useIntl } from "react-intl"; +import { + ConnectionFormValues, + ConnectionValidationSchema, + FormikConnectionFormValues, + mapFormPropsToOperation, + useInitialValues, +} from "components/connection/ConnectionForm/formConfig"; + import { ConnectionScheduleType, DestinationDefinitionRead, @@ -12,13 +20,6 @@ import { useNewTableDesignExperiment } from "hooks/connection/useNewTableDesignE import { useDestinationDefinition } from "services/connector/DestinationDefinitionService"; import { useGetDestinationDefinitionSpecification } from "services/connector/DestinationDefinitionSpecificationService"; import { FormError, generateMessageFromError } from "utils/errorStatusMessage"; -import { - ConnectionFormValues, - FormikConnectionFormValues, - mapFormPropsToOperation, - useInitialValues, - ConnectionValidationSchema, -} from "views/Connection/ConnectionForm/formConfig"; import { useUniqueFormId } from "../FormChangeTracker"; import { ValuesProps } from "../useConnectionHook"; diff --git a/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.tsx b/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.tsx index bc80f7252cee4..d81c0d173bcf1 100644 --- a/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.tsx +++ b/airbyte-webapp/src/pages/connections/ConnectionReplicationPage/ConnectionReplicationPage.tsx @@ -3,7 +3,14 @@ import React, { useCallback, useEffect, useState } from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { useUnmount } from "react-use"; -import { SchemaError } from "components/CreateConnection/SchemaError"; +import { ConnectionFormFields } from "components/connection/ConnectionForm/ConnectionFormFields"; +import EditControls from "components/connection/ConnectionForm/EditControls"; +import { + FormikConnectionFormValues, + useConnectionValidationSchema, +} from "components/connection/ConnectionForm/formConfig"; +import { SchemaChangeBackdrop } from "components/connection/ConnectionForm/SchemaChangeBackdrop"; +import { SchemaError } from "components/connection/CreateConnectionForm/SchemaError"; import LoadingSchema from "components/LoadingSchema"; import { Action, Namespace } from "core/analytics"; @@ -20,10 +27,6 @@ import { useModalService } from "hooks/services/Modal"; import { useConnectionService, ValuesProps } from "hooks/services/useConnectionHook"; import { useCurrentWorkspaceId } from "services/workspaces/WorkspacesService"; import { equal } from "utils/objects"; -import EditControls from "views/Connection/ConnectionForm/components/EditControls"; -import { SchemaChangeBackdrop } from "views/Connection/ConnectionForm/components/SchemaChangeBackdrop"; -import { ConnectionFormFields } from "views/Connection/ConnectionForm/ConnectionFormFields"; -import { useConnectionValidationSchema, FormikConnectionFormValues } from "views/Connection/ConnectionForm/formConfig"; import styles from "./ConnectionReplicationPage.module.scss"; import { ResetWarningModal } from "./ResetWarningModal"; diff --git a/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/ConnectionTransformationPage.tsx b/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/ConnectionTransformationPage.tsx index 0c9da37fc277b..494149a9560b1 100644 --- a/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/ConnectionTransformationPage.tsx +++ b/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/ConnectionTransformationPage.tsx @@ -1,6 +1,11 @@ import React from "react"; import { FormattedMessage } from "react-intl"; +import { + getInitialNormalization, + getInitialTransformations, + mapFormPropsToOperation, +} from "components/connection/ConnectionForm/formConfig"; import { Card } from "components/ui/Card"; import { Text } from "components/ui/Text"; @@ -13,11 +18,6 @@ import { FeatureItem, useFeature } from "hooks/services/Feature"; import { useCurrentWorkspace } from "hooks/services/useWorkspace"; import { useDestinationDefinition } from "services/connector/DestinationDefinitionService"; import { FormikOnSubmit } from "types/formik"; -import { - getInitialNormalization, - getInitialTransformations, - mapFormPropsToOperation, -} from "views/Connection/ConnectionForm/formConfig"; import styles from "./ConnectionTransformationPage.module.scss"; import { CustomTransformationsCard } from "./CustomTransformationsCard"; diff --git a/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/CustomTransformationsCard.tsx b/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/CustomTransformationsCard.tsx index 21d4d79edd362..0b8a0b8455f35 100644 --- a/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/CustomTransformationsCard.tsx +++ b/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/CustomTransformationsCard.tsx @@ -3,12 +3,13 @@ import React, { useMemo } from "react"; import { FormattedMessage } from "react-intl"; import { useToggle } from "react-use"; +import { ConnectionEditFormCard } from "components/connection/ConnectionEditFormCard"; +import { getInitialTransformations } from "components/connection/ConnectionForm/formConfig"; +import { TransformationField } from "components/connection/ConnectionForm/TransformationField"; + import { OperationCreate, OperationRead } from "core/request/AirbyteClient"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; import { FormikOnSubmit } from "types/formik"; -import { TransformationField } from "views/Connection/ConnectionForm/components/TransformationField"; -import { getInitialTransformations } from "views/Connection/ConnectionForm/formConfig"; -import { FormCard } from "views/Connection/FormCard"; export const CustomTransformationsCard: React.FC<{ operations?: OperationCreate[]; @@ -24,7 +25,7 @@ export const CustomTransformationsCard: React.FC<{ ); return ( - + title={} collapsible bottomSeparator @@ -45,6 +46,6 @@ export const CustomTransformationsCard: React.FC<{ /> )} - + ); }; diff --git a/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/NormalizationCard.tsx b/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/NormalizationCard.tsx index 13d50871783df..af02a36015aeb 100644 --- a/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/NormalizationCard.tsx +++ b/airbyte-webapp/src/pages/connections/ConnectionTransformationPage/NormalizationCard.tsx @@ -2,13 +2,14 @@ import { Field } from "formik"; import { useMemo } from "react"; import { FormattedMessage } from "react-intl"; +import { ConnectionEditFormCard } from "components/connection/ConnectionEditFormCard"; +import { getInitialNormalization } from "components/connection/ConnectionForm/formConfig"; +import { NormalizationField } from "components/connection/ConnectionForm/NormalizationField"; + import { NormalizationType } from "core/domain/connection"; import { OperationRead } from "core/request/AirbyteClient"; import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService"; import { FormikOnSubmit } from "types/formik"; -import { NormalizationField } from "views/Connection/ConnectionForm/components/NormalizationField"; -import { getInitialNormalization } from "views/Connection/ConnectionForm/formConfig"; -import { FormCard } from "views/Connection/FormCard"; export const NormalizationCard: React.FC<{ operations?: OperationRead[]; @@ -23,7 +24,7 @@ export const NormalizationCard: React.FC<{ ); return ( - + form={{ initialValues, onSubmit, @@ -32,6 +33,6 @@ export const NormalizationCard: React.FC<{ collapsible > - + ); }; diff --git a/airbyte-webapp/src/pages/connections/CreateConnectionPage/CreateConnectionPage.tsx b/airbyte-webapp/src/pages/connections/CreateConnectionPage/CreateConnectionPage.tsx index d66cb375bfe66..eb17fae00aaf8 100644 --- a/airbyte-webapp/src/pages/connections/CreateConnectionPage/CreateConnectionPage.tsx +++ b/airbyte-webapp/src/pages/connections/CreateConnectionPage/CreateConnectionPage.tsx @@ -6,8 +6,8 @@ import { LoadingPage } from "components"; import { CloudInviteUsersHint } from "components/CloudInviteUsersHint"; import { HeadTitle } from "components/common/HeadTitle"; import { ConnectionBlock } from "components/connection/ConnectionBlock"; +import { CreateConnectionForm } from "components/connection/CreateConnectionForm"; import { FormPageContent } from "components/ConnectorBlocks"; -import { CreateConnectionForm } from "components/CreateConnection/CreateConnectionForm"; import { PageHeader } from "components/ui/PageHeader"; import { StepsIndicator } from "components/ui/StepsIndicator"; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/index.ts b/airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/index.ts deleted file mode 100644 index ffc2c4463776f..0000000000000 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/ScheduleField/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ScheduleField } from "./ScheduleField"; diff --git a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.module.scss b/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.module.scss deleted file mode 100644 index 7fd4485ab708a..0000000000000 --- a/airbyte-webapp/src/views/Connection/ConnectionForm/components/NamespaceDefinitionField.module.scss +++ /dev/null @@ -1 +0,0 @@ -@forward "../ConnectionFormFields.module.scss";