Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Disabled datasource selector in query pages #36940

Merged
merged 9 commits into from
Oct 25, 2024
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dataSources, agHelper } from "../../../../support/Objects/ObjectsCore";
describe(
describe.skip(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any requirement to skip this case? Kindly share details. @albinAppsmith

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sagar-qa007 we are putting this feature behind feature flag and later remove this. That's why the test is being skipped now and once I remove feature flag I will remove the file itself.

"Switch datasource",
{ tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] },
function () {
Expand Down
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 isDatasourceSelectorEnabled = 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}
/>
{isDatasourceSelectorEnabled && (
<DatasourceSelector
currentActionConfig={currentActionConfig}
dataSources={dataSources}
formName={formName}
onCreateDatasourceClick={onCreateDatasourceClick}
plugin={plugin}
/>
)}
<Button
className="t--run-query"
data-guided-tour-iid="run-query"
Expand Down
Loading