Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(data-warehouse): say when a warehouse destination is not used yet (#113871)

Tom Owers05cc5d0607d5
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index a0de8dc23835..90b0e82b2692 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -2937,17 +2937,21 @@ snapshots:
data-warehouse-sourcedestinationsbanner--flag-off--light:
hash: v1.k794b7964.48c6b225dec1945c20d154de4f18c40be7b0c4f34c4b337878243bf984816e16.-vKIJKAdSQSKB0z_IMuQYV4bY1tzFQwajwGoiiB2TGg
data-warehouse-warehousedestinationstable--default--dark:
- hash: v1.k794b7964.6595934174706ea9708694fdfe156d472e769213d8c3d41c59c0678447d20710.ZjAq0JuruCScBFFZXbK-MCQwdIrHPU50EmeRJGlFupY
+ hash: v1.k794b7964.017bbc5ee3725d33a34aeead66418a2bce7ddbc407fbb28d05e25cc563103465.8DKub_NldGVl5fyy8aotD9-9UKyd-n_Tm8MJAOJwCsM
data-warehouse-warehousedestinationstable--default--light:
- hash: v1.k794b7964.e4e6ffca03e8fffe378d47e4f9bece5e921b9c99a0ddb7c30aa662d338167582.ESF2Tu44aY4ogil5cpqgE_9cfMUBW3X3M-3EWMJCzO0
+ hash: v1.k794b7964.5b778200ea1e4ccdd8554c7485b44e9554fc6e1b903cb53d01b1b58a8ee2db08.UU8_Pa4obTCmLTwR00QqQf24aya1d2aLleGE4gvuYvQ
data-warehouse-warehousedestinationstable--deleting--dark:
- hash: v1.k794b7964.6595934174706ea9708694fdfe156d472e769213d8c3d41c59c0678447d20710.Z7hljuwhioxZGTL5j2ZYqPOUwvnyMKe-Zw_7H1Y-X8w
+ hash: v1.k794b7964.017bbc5ee3725d33a34aeead66418a2bce7ddbc407fbb28d05e25cc563103465.Fc5axCHhIpX7JD8liItgEVHgXX75pUHQnHArANwtOWQ
data-warehouse-warehousedestinationstable--deleting--light:
- hash: v1.k794b7964.e4e6ffca03e8fffe378d47e4f9bece5e921b9c99a0ddb7c30aa662d338167582.VbzYRosphyXvhu6a3itT7YIlXKV1G8OUSe9pRLPntHE
+ hash: v1.k794b7964.5b778200ea1e4ccdd8554c7485b44e9554fc6e1b903cb53d01b1b58a8ee2db08.z7zNtVL3PEbQ2oi6VJghXfTmA1Q_2PKrA8JJIaMmgHU
data-warehouse-warehousedestinationstable--empty--dark:
hash: v1.k794b7964.9f1bf33e217cec7392aabfd90b22f1b90d23c376fe23fd3da26da296bd2a3bed.vr1sLFpw_5xjzCc0k0Y0O4rgmSzSJt1fymgjYnzfs1M
data-warehouse-warehousedestinationstable--empty--light:
hash: v1.k794b7964.fbf426283f3c515b35f5b1a1d83bbd80527692b393d1b415e83070e2fb525077.kx3a5CnOGxV-4p6vGDHRT1z1wGNOdijZQKO-vQKmovo
+ data-warehouse-warehousedestinationstable--linked--dark:
+ hash: v1.k794b7964.0cc9ddc5088e4b5c7f93e29834dcd9941ce455bc77fbbeba45c18febc02fd350.ffwG1Nl3GTV6onbBl7ekXJVw0zh7mKWIiYKjAATVTwQ
+ data-warehouse-warehousedestinationstable--linked--light:
+ hash: v1.k794b7964.59f3210d57cb7af2d6008e3e72f7bad5a25b4a9e4dcad90637121ee69236e686.441rO62-RtZnwj2nrXJt8UsD7LvAL57d_opCKdlKitE
data-warehouse-warehousedestinationstable--loading--dark:
hash: v1.k794b7964.6822b2603856380f898ef83e31d6bb3a179ef78e97dce603804d61e536e33543.jdFqJsjhfMQIUySpfQ_Dvwca7kdb_1jRS9j5U5OmIDY
data-warehouse-warehousedestinationstable--loading--light:
diff --git a/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/SyncedSources.tsx b/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/SyncedSources.tsx
index e86651116429..9b4f14e8961b 100644
--- a/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/SyncedSources.tsx
+++ b/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/SyncedSources.tsx
@@ -16,7 +16,15 @@ export function SyncedSources({ destination }: SyncedSourcesProps): JSX.Element
const sources = destination.synced_sources ?? []
if (sources.length === 0) {
- return <span className="text-muted">Nothing yet</span>
+ // "Nothing yet" read as "no data yet" rather than "this destination does nothing", so the
+ // cell carries the step that makes it work.
+ return (
+ <Tooltip title="Nothing syncs here yet. Open a source and pick this destination on its Destinations tab.">
+ <Link to={urls.sources()} data-attr="warehouse-destination-not-used">
+ Not used yet
+ </Link>
+ </Tooltip>
+ )
}
const shown = sources.slice(0, NAMES_SHOWN)
diff --git a/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.stories.tsx b/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.stories.tsx
index e7027bb44270..6ef980f40ab3 100644
--- a/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.stories.tsx
+++ b/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.stories.tsx
@@ -70,6 +70,27 @@ Loading.parameters = {
testOptions: { waitForLoadersToDisappear: false },
}
+// Every other story leaves `synced_sources` unset, so they all show the not-used cell. This is
+// the only one that shows a destination a source actually writes to.
+export const Linked = Template.bind({})
+Linked.args = {
+ ...Default.args,
+ destinations: [
+ {
+ ...POSTGRES,
+ synced_sources: [
+ {
+ id: '01a03e9c-1b80-0000-0000-000000000001',
+ name: 'Stripe',
+ source_type: 'Stripe',
+ via_table_override: false,
+ },
+ ],
+ } as ExternalDataDestinationApi,
+ WAREHOUSE,
+ ],
+}
+
export const Empty = Template.bind({})
Empty.args = {
...Default.args,
diff --git a/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.tsx b/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.tsx
index 437f15274ef5..fb7b70c68cc2 100644
--- a/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.tsx
+++ b/products/data_warehouse/frontend/scenes/WarehouseDestinationsScene/WarehouseDestinationsTable.tsx
@@ -1,7 +1,7 @@
import type { ReactNode } from 'react'
import { IconPencil, IconTrash } from '@posthog/icons'
-import { LemonButton, LemonTable, LemonTableColumn, LemonTag } from '@posthog/lemon-ui'
+import { LemonButton, LemonTable, LemonTableColumn, LemonTag, Link } from '@posthog/lemon-ui'
import { More } from 'lib/lemon-ui/LemonButton/More'
import { updatedAtColumn } from 'lib/lemon-ui/LemonTable/columnUtils'
@@ -45,8 +45,19 @@ export function WarehouseDestinationsTable({
key: 'name',
sorter: (a, b) => a.name.localeCompare(b.name, undefined, { sensitivity: 'base', numeric: true }),
render: (_, destination) => (
- <div className="flex flex-col">
- <span className="font-semibold">{destination.name}</span>
+ <div className="flex flex-col items-start">
+ {/* The managed warehouse row has nothing to edit, so its name stays text. */}
+ {destination.is_posthog_warehouse ? (
+ <span className="font-semibold">{destination.name}</span>
+ ) : (
+ <Link
+ className="font-semibold"
+ onClick={() => onEdit(destination)}
+ data-attr="warehouse-destination-scene-open"
+ >
+ {destination.name}
+ </Link>
+ )}
{destinationTarget(destination) ? (
<span className="text-muted text-xs">{destinationTarget(destination)}</span>
) : null}