From 3c3844bfbafed91415239c5cab035c7a67207797 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 30 Oct 2023 16:04:05 -0400 Subject: [PATCH] fix external link listener --- .../data-warehouse/DataWarehouseTable.tsx | 7 +++- .../dataWarehouseTableLogic.tsx | 10 ++++- .../data-warehouse/external/SourceModal.tsx | 42 ++++++++++++------- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/frontend/src/scenes/data-warehouse/DataWarehouseTable.tsx b/frontend/src/scenes/data-warehouse/DataWarehouseTable.tsx index d9242264121cc..25f593df020db 100644 --- a/frontend/src/scenes/data-warehouse/DataWarehouseTable.tsx +++ b/frontend/src/scenes/data-warehouse/DataWarehouseTable.tsx @@ -3,7 +3,11 @@ import { Form } from 'kea-forms' import { LemonInput, LemonSelect } from '@posthog/lemon-ui' import { Field } from 'lib/forms/Field' -export function DatawarehouseTableForm(): JSX.Element { +interface DataWarehouseTableFormProps { + footer?: JSX.Element +} + +export function DatawarehouseTableForm({ footer }: DataWarehouseTableFormProps): JSX.Element { return (
@@ -71,6 +75,7 @@ export function DatawarehouseTableForm(): JSX.Element { />
+ {footer}
) } diff --git a/frontend/src/scenes/data-warehouse/dataWarehouseTableLogic.tsx b/frontend/src/scenes/data-warehouse/dataWarehouseTableLogic.tsx index 6ff5ed536bb37..a3cacb9edc810 100644 --- a/frontend/src/scenes/data-warehouse/dataWarehouseTableLogic.tsx +++ b/frontend/src/scenes/data-warehouse/dataWarehouseTableLogic.tsx @@ -9,6 +9,7 @@ import { AnyPropertyFilter, Breadcrumb, DataWarehouseTable } from '~/types' import { DataTableNode } from '~/queries/schema' import { databaseSceneLogic } from 'scenes/data-management/database/databaseSceneLogic' import type { dataWarehouseTableLogicType } from './dataWarehouseTableLogicType' +import { dataWarehouseSceneLogic } from './external/dataWarehouseSceneLogic' export interface TableLogicProps { id: string | 'new' @@ -30,7 +31,12 @@ export const dataWarehouseTableLogic = kea([ path(['scenes', 'data-warehouse', 'tableLogic']), props({} as TableLogicProps), connect(() => ({ - actions: [databaseSceneLogic, ['loadDatabase']], + actions: [ + databaseSceneLogic, + ['loadDatabase'], + dataWarehouseSceneLogic, + ['loadDataWarehouse', 'toggleSourceModal'], + ], })), actions({ editingTable: (editing: boolean) => ({ editing }), @@ -64,6 +70,8 @@ export const dataWarehouseTableLogic = kea([ createTableSuccess: async ({ table }) => { lemonToast.success(<>Table {table.name} created) actions.loadDatabase() + actions.loadDataWarehouse() + actions.toggleSourceModal() router.actions.replace(urls.dataWarehouse()) }, updateTableSuccess: async ({ table }) => { diff --git a/frontend/src/scenes/data-warehouse/external/SourceModal.tsx b/frontend/src/scenes/data-warehouse/external/SourceModal.tsx index 9adef58bfb4c0..a264988d08d00 100644 --- a/frontend/src/scenes/data-warehouse/external/SourceModal.tsx +++ b/frontend/src/scenes/data-warehouse/external/SourceModal.tsx @@ -74,22 +74,32 @@ export default function SourceModal(props: SourceModalProps): JSX.Element { if (isManualLinkFormVisible) { return (
- - -
- - Back - - - Link - -
+ + +
+ + Back + + + Link + +
+ + } + />
) }