From e3134ce8deba473bd578a9e98ee1028e8aca8590 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 25 Jul 2024 16:43:58 -0400 Subject: [PATCH] rename and only allow checkboxing if a sync method is set up --- .../forms/{PostgresSchemaForm.tsx => SchemaForm.tsx} | 7 ++++++- frontend/src/scenes/data-warehouse/new/NewSourceWizard.tsx | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) rename frontend/src/scenes/data-warehouse/external/forms/{PostgresSchemaForm.tsx => SchemaForm.tsx} (93%) diff --git a/frontend/src/scenes/data-warehouse/external/forms/PostgresSchemaForm.tsx b/frontend/src/scenes/data-warehouse/external/forms/SchemaForm.tsx similarity index 93% rename from frontend/src/scenes/data-warehouse/external/forms/PostgresSchemaForm.tsx rename to frontend/src/scenes/data-warehouse/external/forms/SchemaForm.tsx index 98125b15466d3..fd23f4a2674fc 100644 --- a/frontend/src/scenes/data-warehouse/external/forms/PostgresSchemaForm.tsx +++ b/frontend/src/scenes/data-warehouse/external/forms/SchemaForm.tsx @@ -4,7 +4,7 @@ import { useActions, useValues } from 'kea' import { sourceWizardLogic } from '../../new/sourceWizardLogic' import { SyncMethodForm } from './SyncMethodForm' -export default function PostgresSchemaForm(): JSX.Element { +export default function SchemaForm(): JSX.Element { const { toggleSchemaShouldSync, openSyncMethodModal } = useActions(sourceWizardLogic) const { databaseSchema } = useValues(sourceWizardLogic) @@ -26,6 +26,11 @@ export default function PostgresSchemaForm(): JSX.Element { onChange={(checked) => { toggleSchemaShouldSync(schema, checked) }} + disabledReason={ + schema.sync_type === null + ? 'Please set up a sync method first' + : undefined + } /> ) }, diff --git a/frontend/src/scenes/data-warehouse/new/NewSourceWizard.tsx b/frontend/src/scenes/data-warehouse/new/NewSourceWizard.tsx index 81c44222314dd..4f402724ff9b3 100644 --- a/frontend/src/scenes/data-warehouse/new/NewSourceWizard.tsx +++ b/frontend/src/scenes/data-warehouse/new/NewSourceWizard.tsx @@ -7,7 +7,7 @@ import { SceneExport } from 'scenes/sceneTypes' import { ManualLinkSourceType, SourceConfig } from '~/types' import { DataWarehouseInitialBillingLimitNotice } from '../DataWarehouseInitialBillingLimitNotice' -import PostgresSchemaForm from '../external/forms/PostgresSchemaForm' +import SchemaForm from '../external/forms/SchemaForm' import SourceForm from '../external/forms/SourceForm' import { SyncProgressStep } from '../external/forms/SyncProgressStep' import { DatawarehouseTableForm } from '../new/DataWarehouseTableForm' @@ -241,7 +241,7 @@ function SecondStep(): JSX.Element { function ThirdStep(): JSX.Element { return ( - + ) }