From 7b912ca84d6de887386a4281c650cc33f0d7c500 Mon Sep 17 00:00:00 2001 From: albinAppsmith <87797149+albinAppsmith@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:35:31 +0530 Subject: [PATCH 1/5] feat: Disabled datasource selector in query pages --- app/client/src/ce/entities/FeatureFlag.ts | 3 +++ .../Editor/QueryEditor/QueryEditorHeader.tsx | 20 ++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/client/src/ce/entities/FeatureFlag.ts b/app/client/src/ce/entities/FeatureFlag.ts index 5b3919ce5dba..e9599c3065ef 100644 --- a/app/client/src/ce/entities/FeatureFlag.ts +++ b/app/client/src/ce/entities/FeatureFlag.ts @@ -39,6 +39,8 @@ export const FEATURE_FLAG = { release_anvil_toggle_enabled: "release_anvil_toggle_enabled", release_git_persist_branch_enabled: "release_git_persist_branch_enabled", release_ide_animations_enabled: "release_ide_animations_enabled", + release_ide_datasource_selector_enabled: + "release_ide_datasource_selector_enabled", } as const; export type FeatureFlag = keyof typeof FEATURE_FLAG; @@ -74,6 +76,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = { release_anvil_toggle_enabled: false, release_git_persist_branch_enabled: false, release_ide_animations_enabled: false, + release_ide_datasource_selector_enabled: false, }; export const AB_TESTING_EVENT_KEYS = { diff --git a/app/client/src/pages/Editor/QueryEditor/QueryEditorHeader.tsx b/app/client/src/pages/Editor/QueryEditor/QueryEditorHeader.tsx index de9050cc7132..5dcb09732a09 100644 --- a/app/client/src/pages/Editor/QueryEditor/QueryEditorHeader.tsx +++ b/app/client/src/pages/Editor/QueryEditor/QueryEditorHeader.tsx @@ -72,6 +72,10 @@ const QueryEditorHeader = (props: Props) => { currentActionConfig?.userPermissions, ); + const isDatasourceSelectorDisabled = useFeatureFlag( + FEATURE_FLAG.release_ide_datasource_selector_enabled, + ); + const currentPlugin = useSelector((state: AppState) => getPlugin(state, currentActionConfig?.pluginId || ""), ); @@ -97,13 +101,15 @@ const QueryEditorHeader = (props: Props) => { {moreActionsMenu} - + {isDatasourceSelectorDisabled && ( + + )}