Skip to content

Commit

Permalink
feat: Disabled datasource selector in query pages
Browse files Browse the repository at this point in the history
  • Loading branch information
albinAppsmith committed Oct 17, 2024
1 parent 44a9994 commit 7b912ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions app/client/src/ce/entities/FeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = {
Expand Down
20 changes: 13 additions & 7 deletions app/client/src/pages/Editor/QueryEditor/QueryEditorHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || ""),
);
Expand All @@ -97,13 +101,15 @@ const QueryEditorHeader = (props: Props) => {
</NameWrapper>
<ActionsWrapper>
{moreActionsMenu}
<DatasourceSelector
currentActionConfig={currentActionConfig}
dataSources={dataSources}
formName={formName}
onCreateDatasourceClick={onCreateDatasourceClick}
plugin={plugin}
/>
{isDatasourceSelectorDisabled && (
<DatasourceSelector
currentActionConfig={currentActionConfig}
dataSources={dataSources}
formName={formName}
onCreateDatasourceClick={onCreateDatasourceClick}
plugin={plugin}
/>
)}
<Button
className="t--run-query"
data-guided-tour-iid="run-query"
Expand Down

0 comments on commit 7b912ca

Please sign in to comment.