Skip to content

Commit 16ea831

Browse files
authored
feat: add premium feature tag for paid external SaaS plugins in DataSidePane (#41110)
## Summary This PR introduces a new premium feature tag for datasources that use paid external SaaS plugins in the DataSidePane. The tag is conditionally displayed based on a new feature flag, allowing for controlled rollout and visibility of premium integrations. --- ## Changes - **Feature Flag:** - Added `release_paid_features_tagging` to the `FEATURE_FLAG` and `DEFAULT_FEATURE_FLAG_VALUE` in `FeatureFlag.ts`. - **DataSidePane UI:** - Imported and used the new `PremiumFeatureTag` component. - Added logic to determine if a datasource should display the premium tag: - Checks if the new feature flag is enabled. - Checks if the datasource's plugin is of type `EXTERNAL_SAAS` and if the corresponding paid integration feature is disabled. - Displays the premium tag in the datasource list for eligible datasources. ## Automation /ok-to-test tags="@tag.Sanity, @tag.Datasource" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16281977131> > Commit: f6450ef > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16281977131&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity, @tag.Datasource` > Spec: > <hr>Tue, 15 Jul 2025 02:37:55 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Introduced a premium feature tag for certain datasources in the DataSidePane, visible when specific feature flags are enabled. * **Chores** * Added a new feature flag to support premium feature tagging. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent c4ed090 commit 16ea831

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

app/client/src/ce/entities/FeatureFlag.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const FEATURE_FLAG = {
6464
"release_jsobjects_onpageunloadactions_enabled",
6565
configure_block_event_tracking_for_anonymous_users:
6666
"configure_block_event_tracking_for_anonymous_users",
67+
release_paid_features_tagging: "release_paid_features_tagging",
6768
} as const;
6869

6970
export type FeatureFlag = keyof typeof FEATURE_FLAG;
@@ -116,6 +117,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
116117
license_ai_agent_instance_enabled: false,
117118
release_jsobjects_onpageunloadactions_enabled: false,
118119
configure_block_event_tracking_for_anonymous_users: false,
120+
release_paid_features_tagging: false,
119121
};
120122

121123
export const AB_TESTING_EVENT_KEYS = {

app/client/src/pages/Editor/DataSidePane/DataSidePane.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
getDatasources,
77
getDatasourcesGroupedByPluginCategory,
88
getPluginImages,
9+
getPlugins,
910
} from "ee/selectors/entitiesSelector";
1011
import history from "utils/history";
1112
import { datasourcesEditorIdURL, integrationEditorURL } from "ee/RouteBuilder";
@@ -29,6 +30,10 @@ import { getHasCreateDatasourcePermission } from "ee/utils/BusinessFeatures/perm
2930
import { EmptyState } from "@appsmith/ads";
3031
import { getAssetUrl } from "ee/utils/airgapHelpers";
3132
import { getCurrentBasePageId } from "selectors/editorSelectors";
33+
import PremiumFeatureTag from "components/editorComponents/PremiumFeatureTag";
34+
import { PluginType } from "entities/Plugin";
35+
import { selectFeatureFlagCheck } from "ee/selectors/featureFlagsSelectors";
36+
import type { Datasource } from "entities/Datasource";
3237

3338
const PaneBody = styled.div`
3439
padding: var(--ads-v2-spaces-3) 0;
@@ -54,7 +59,16 @@ export const DataSidePane = (props: DataSidePaneProps) => {
5459
const datasources = useSelector(getDatasources);
5560
const groupedDatasources = useSelector(getDatasourcesGroupedByPluginCategory);
5661
const pluginImages = useSelector(getPluginImages);
62+
const plugins = useSelector(getPlugins);
5763
const location = useLocation();
64+
65+
const isIntegrationsEnabledForPaid = useSelector((state: DefaultRootState) =>
66+
selectFeatureFlagCheck(
67+
state,
68+
FEATURE_FLAG.license_external_saas_plugins_enabled,
69+
),
70+
);
71+
5872
const goToDatasource = useCallback((id: string) => {
5973
history.push(datasourcesEditorIdURL({ datasourceId: id }));
6074
}, []);
@@ -69,6 +83,9 @@ export const DataSidePane = (props: DataSidePaneProps) => {
6983
);
7084

7185
const isFeatureEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled);
86+
const isPaidFeaturesTaggingEnabled = useFeatureFlag(
87+
FEATURE_FLAG.release_paid_features_tagging,
88+
);
7289

7390
const canCreateDatasource = getHasCreateDatasourcePermission(
7491
isFeatureEnabled,
@@ -94,6 +111,26 @@ export const DataSidePane = (props: DataSidePaneProps) => {
94111
[addButtonClickHandler, canCreateDatasource],
95112
);
96113

114+
const shouldShowPremiumTag = useCallback(
115+
(datasource: Datasource) => {
116+
if (!isPaidFeaturesTaggingEnabled) return false;
117+
118+
const plugin = plugins.find((p) => p.id === datasource.pluginId);
119+
120+
if (!plugin) return false;
121+
122+
if (
123+
plugin.type === PluginType.EXTERNAL_SAAS &&
124+
!isIntegrationsEnabledForPaid
125+
) {
126+
return true;
127+
}
128+
129+
return false;
130+
},
131+
[plugins, isIntegrationsEnabledForPaid, isPaidFeaturesTaggingEnabled],
132+
);
133+
97134
return (
98135
<Flex flexDirection="column" height="100%" width="100%">
99136
<PaneHeader
@@ -131,6 +168,9 @@ export const DataSidePane = (props: DataSidePaneProps) => {
131168
className: "t--datasource",
132169
isSelected: currentSelectedDatasource === data.id,
133170
onClick: () => goToDatasource(data.id),
171+
rightControl: shouldShowPremiumTag(data) && (
172+
<PremiumFeatureTag />
173+
),
134174
};
135175
}),
136176
className: "",

0 commit comments

Comments
 (0)