From d317d8ee3b1ba000325328d1db003eab0357129e Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 31 Dec 2024 11:54:38 -0500 Subject: [PATCH] drop in replace the data warehouse scene if the sql editor flag is active --- .../layout/navigation-3000/navigationLogic.tsx | 17 ++++++++--------- frontend/src/scenes/sceneLogic.ts | 8 ++++++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/frontend/src/layout/navigation-3000/navigationLogic.tsx b/frontend/src/layout/navigation-3000/navigationLogic.tsx index aee4ddda205f2..55aefd910a2c2 100644 --- a/frontend/src/layout/navigation-3000/navigationLogic.tsx +++ b/frontend/src/layout/navigation-3000/navigationLogic.tsx @@ -515,21 +515,20 @@ export const navigation3000Logic = kea([ to: urls.earlyAccessFeatures(), } : null, - { - identifier: Scene.DataWarehouse, - label: 'Data warehouse', - icon: , - to: isUsingSidebar ? undefined : urls.dataWarehouse(), - }, featureFlags[FEATURE_FLAGS.SQL_EDITOR] ? { identifier: Scene.SQLEditor, - label: 'SQL Editor', + label: 'Data warehouse', icon: , - to: urls.sqlEditor(), + to: urls.dataWarehouse(), logic: editorSidebarLogic, } - : null, + : { + identifier: Scene.DataWarehouse, + label: 'Data warehouse', + icon: , + to: isUsingSidebar ? undefined : urls.dataWarehouse(), + }, hasOnboardedAnyProduct ? { identifier: Scene.Pipeline, diff --git a/frontend/src/scenes/sceneLogic.ts b/frontend/src/scenes/sceneLogic.ts index 0fe41a9e7e6ff..7a9ed67a0bb9d 100644 --- a/frontend/src/scenes/sceneLogic.ts +++ b/frontend/src/scenes/sceneLogic.ts @@ -441,8 +441,12 @@ export const sceneLogic = kea([ } } for (const [path, scene] of Object.entries(routes)) { - mapping[path] = (params, searchParams, hashParams, { method }) => - actions.openScene(scene, { params, searchParams, hashParams }, method) + mapping[path] = (params, searchParams, hashParams, { method }) => { + if (path === urls.dataWarehouse() && featureFlagLogic.values.featureFlags[FEATURE_FLAGS.SQL_EDITOR]) { + return actions.openScene(Scene.SQLEditor, { params, searchParams, hashParams }, method) + } + return actions.openScene(scene, { params, searchParams, hashParams }, method) + } } mapping['/*'] = (_, __, { method }) => {