({
+ path: ['scenes', 'data-warehouse', 'editor', 'sourceNavigatorLogic'],
+ actions: {
+ setWidth: (width: number) => ({ width }),
+ },
+ reducers: {
+ navigatorWidth: [
+ 200,
+ {
+ setWidth: (_, { width }: { width: number }) => width,
+ },
+ ],
+ },
+})
diff --git a/frontend/src/scenes/data-warehouse/external/DataWarehouseTables.tsx b/frontend/src/scenes/data-warehouse/external/DataWarehouseTables.tsx
index 03b4da5e3a1..debe5cf980b 100644
--- a/frontend/src/scenes/data-warehouse/external/DataWarehouseTables.tsx
+++ b/frontend/src/scenes/data-warehouse/external/DataWarehouseTables.tsx
@@ -54,9 +54,10 @@ export const DataWarehouseTables = ({ insightProps }: DataWarehousetTablesProps)
interface DatabaseTableTreeProps {
inline?: boolean
+ collapsible?: boolean
}
-export const DatabaseTableTreeWithItems = ({ inline }: DatabaseTableTreeProps): JSX.Element => {
+export const DatabaseTableTreeWithItems = ({ inline, collapsible = true }: DatabaseTableTreeProps): JSX.Element => {
const {
dataWarehouseTablesBySourceType,
posthogTables,
@@ -293,13 +294,13 @@ export const DatabaseTableTreeWithItems = ({ inline }: DatabaseTableTreeProps):
return (
{collapsed ? (
} onClick={() => setCollapsed(false)} />
- ) : (
+ ) : collapsible ? (
<>
>
+ ) : (
+ <>
+ Sources
+
+ >
)}
= {
name: 'Data warehouse',
defaultDocsPath: '/docs/data-warehouse',
},
+ [Scene.SQLEditor]: {
+ projectBased: true,
+ name: 'SQL editor',
+ defaultDocsPath: '/docs/data-warehouse/setup',
+ layout: 'app-raw-no-header',
+ },
[Scene.DataWarehouseExternal]: {
projectBased: true,
name: 'Data warehouse',
@@ -552,6 +558,7 @@ export const routes: Record = {
[urls.dataWarehouseView(':id')]: Scene.DataWarehouse,
[urls.dataWarehouseTable()]: Scene.DataWarehouseTable,
[urls.dataWarehouseRedirect(':kind')]: Scene.DataWarehouseRedirect,
+ [urls.sqlEditor()]: Scene.SQLEditor,
[urls.featureFlags()]: Scene.FeatureFlags,
[urls.featureFlag(':id')]: Scene.FeatureFlag,
[urls.annotations()]: Scene.DataManagement,
diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.ts
index b97dd77a1a6..ccd4b7a482f 100644
--- a/frontend/src/scenes/urls.ts
+++ b/frontend/src/scenes/urls.ts
@@ -173,6 +173,7 @@ export const urls = {
dataWarehouse: (query?: string | Record): string =>
combineUrl(`/data-warehouse`, {}, query ? { q: typeof query === 'string' ? query : JSON.stringify(query) } : {})
.url,
+ sqlEditor: (): string => `/sql`,
dataWarehouseView: (id: string): string => combineUrl(`/data-warehouse/view/${id}`).url,
dataWarehouseTable: (): string => `/data-warehouse/new`,
dataWarehouseRedirect: (kind: string): string => `/data-warehouse/${kind}/redirect`,
diff --git a/package.json b/package.json
index f7749c5aa49..e3374ce653b 100644
--- a/package.json
+++ b/package.json
@@ -164,6 +164,7 @@
"re2js": "^0.4.1",
"react": "^18.2.0",
"react-color": "^2.19.3",
+ "react-data-grid": "7.0.0-beta.47",
"react-dom": "^18.2.0",
"react-draggable": "^4.2.0",
"react-email-editor": "^1.7.11",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 87fbc7380dd..e52e37d9ae5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -313,6 +313,9 @@ dependencies:
react-color:
specifier: ^2.19.3
version: 2.19.3(react@18.2.0)
+ react-data-grid:
+ specifier: 7.0.0-beta.47
+ version: 7.0.0-beta.47(react-dom@18.2.0)(react@18.2.0)
react-dom:
specifier: ^18.2.0
version: 18.2.0(react@18.2.0)
@@ -10413,6 +10416,11 @@ packages:
engines: {node: '>=6'}
dev: false
+ /clsx@2.1.1:
+ resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}
+ engines: {node: '>=6'}
+ dev: false
+
/cluster-key-slot@1.1.2:
resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==}
engines: {node: '>=0.10.0'}
@@ -18321,6 +18329,17 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: true
+ /react-data-grid@7.0.0-beta.47(react-dom@18.2.0)(react@18.2.0):
+ resolution: {integrity: sha512-28kjsmwQGD/9RXYC50zn5Zv/SQMhBBoSvG5seq0fM8XXi9TZ0zr9Z5T3YJqLwcEtoNzTOq3y0njkmdujGkIwQQ==}
+ peerDependencies:
+ react: ^18.0 || ^19.0
+ react-dom: ^18.0 || ^19.0
+ dependencies:
+ clsx: 2.1.1
+ react: 18.2.0
+ react-dom: 18.2.0(react@18.2.0)
+ dev: false
+
/react-docgen-typescript@2.2.2(typescript@4.9.5):
resolution: {integrity: sha512-tvg2ZtOpOi6QDwsb3GZhOjDkkX0h8Z2gipvTg6OVMUyoYoURhEiRNePT8NZItTVCDh39JJHnLdfCOkzoLbFnTg==}
peerDependencies: