Skip to content

Commit

Permalink
chore: added this feature behind a flag ab_premium_datasources_view_e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
AmanAgarwal041 committed Dec 16, 2024
1 parent 4a97474 commit 4c9b970
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/client/src/ce/entities/FeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const FEATURE_FLAG = {
"release_table_html_column_type_enabled",
release_gs_all_sheets_options_enabled:
"release_gs_all_sheets_options_enabled",
ab_premium_datasources_view_enabled: "ab_premium_datasources_view_enabled",
} as const;

export type FeatureFlag = keyof typeof FEATURE_FLAG;
Expand Down Expand Up @@ -89,6 +90,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
release_evaluation_scope_cache: false,
release_table_html_column_type_enabled: false,
release_gs_all_sheets_options_enabled: false,
ab_premium_datasources_view_enabled: false,
};

export const AB_TESTING_EVENT_KEYS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ function CreateNewDatasource({
active,
isCreating,
isOnboardingScreen,
isPremiumDatasourcesViewEnabled,
pageId,
showMostPopularPlugins,
showUnsupportedPluginDialog, // TODO: Fix this the next time the file is edited
showMostPopularPlugins, // TODO: Fix this the next time the file is edited
showUnsupportedPluginDialog,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}: any) {
const editorType = useEditorType(location.pathname);
Expand Down Expand Up @@ -172,7 +173,9 @@ function CreateNewDatasource({
showMostPopularPlugins={showMostPopularPlugins}
showUnsupportedPluginDialog={showUnsupportedPluginDialog}
>
{showMostPopularPlugins && <PremiumDatasources />}
{showMostPopularPlugins && isPremiumDatasourcesViewEnabled && (
<PremiumDatasources />
)}
</NewQueryScreen>
</div>
);
Expand Down Expand Up @@ -255,6 +258,7 @@ interface CreateNewDatasourceScreenProps {
pageId: string;
isOnboardingScreen?: boolean;
isRequestNewIntegrationEnabled: boolean;
isPremiumDatasourcesViewEnabled: boolean;
}

interface CreateNewDatasourceScreenState {
Expand Down Expand Up @@ -286,6 +290,7 @@ class CreateNewDatasourceTab extends React.Component<
dataSources,
isCreating,
isOnboardingScreen,
isPremiumDatasourcesViewEnabled,
isRequestNewIntegrationEnabled,
pageId,
showDebugger,
Expand Down Expand Up @@ -316,6 +321,7 @@ class CreateNewDatasourceTab extends React.Component<
active={false}
isCreating={isCreating}
isOnboardingScreen={!!isOnboardingScreen}
isPremiumDatasourcesViewEnabled={isPremiumDatasourcesViewEnabled}
location={location}
pageId={pageId}
showMostPopularPlugins
Expand Down Expand Up @@ -389,6 +395,9 @@ const mapStateToProps = (state: AppState) => {
const isRequestNewIntegrationEnabled =
!!featureFlags?.ab_request_new_integration_enabled;

const isPremiumDatasourcesViewEnabled =
!!featureFlags?.ab_premium_datasources_view_enabled;

return {
dataSources: getDatasources(state),
mockDatasources: getMockDatasources(state),
Expand All @@ -398,6 +407,7 @@ const mapStateToProps = (state: AppState) => {
showDebugger,
pageId,
isRequestNewIntegrationEnabled,
isPremiumDatasourcesViewEnabled,
};
};

Expand Down

0 comments on commit 4c9b970

Please sign in to comment.