diff --git a/app/client/src/ce/selectors/rampSelectors.tsx b/app/client/src/ce/selectors/rampSelectors.tsx index 06f755382c..e2a56fc417 100644 --- a/app/client/src/ce/selectors/rampSelectors.tsx +++ b/app/client/src/ce/selectors/rampSelectors.tsx @@ -11,6 +11,9 @@ import { } from "utils/ProductRamps/RampsControlList"; import type { EnvTypes } from "utils/ProductRamps/RampTypes"; import { isPermitted, PERMISSION_TYPE } from "ee/utils/permissionHelpers"; +import { selectFeatureFlags } from "./featureFlagsSelectors"; +import { isMultiOrgFFEnabled } from "ee/utils/planHelpers"; +import { WORKSPACE_SETTINGS_LICENSE_PAGE_URL } from "constants/routes"; const { cloudHosting, customerPortalUrl, pricingUrl } = getAppsmithConfigs(); @@ -26,21 +29,31 @@ export const getRampLink = ({ feature: string; isBusinessFeature?: boolean; }) => - createSelector(organizationState, (organization) => { - const instanceId = organization?.instanceId; - const source = cloudHosting ? "cloud" : "CE"; - const RAMP_LINK_TO = isBusinessFeature - ? CUSTOMER_PORTAL_URL_WITH_PARAMS( - customerPortalUrl, - source, - instanceId, - feature, - section, - ) - : PRICING_PAGE_URL(pricingUrl, source, instanceId, feature, section); + createSelector( + organizationState, + selectFeatureFlags, + (organization, featureFlags) => { + const instanceId = organization?.instanceId; + const source = cloudHosting ? "cloud" : "CE"; + const isCloudBillingEnabled = isMultiOrgFFEnabled(featureFlags); - return RAMP_LINK_TO; - }); + if (isCloudBillingEnabled) { + return WORKSPACE_SETTINGS_LICENSE_PAGE_URL; + } + + const RAMP_LINK_TO = isBusinessFeature + ? CUSTOMER_PORTAL_URL_WITH_PARAMS( + customerPortalUrl, + source, + instanceId, + feature, + section, + ) + : PRICING_PAGE_URL(pricingUrl, source, instanceId, feature, section); + + return RAMP_LINK_TO; + }, + ); export const showProductRamps = ( rampName: string, diff --git a/app/client/src/utils/hooks/useOnUpgrade.ts b/app/client/src/utils/hooks/useOnUpgrade.ts index 372c939321..2c8026f27a 100644 --- a/app/client/src/utils/hooks/useOnUpgrade.ts +++ b/app/client/src/utils/hooks/useOnUpgrade.ts @@ -12,6 +12,8 @@ import type { RampFeature, RampSection, } from "utils/ProductRamps/RampsControlList"; +import { useIsCloudBillingEnabled } from "hooks"; +import { WORKSPACE_SETTINGS_LICENSE_PAGE_URL } from "constants/routes"; interface Props { logEventName?: EventName; @@ -28,6 +30,7 @@ const useOnUpgrade = (props: Props) => { props; const instanceId = useSelector(getInstanceId); const appsmithConfigs = getAppsmithConfigs(); + const isCloudBillingEnabled = useIsCloudBillingEnabled(); const onUpgrade = () => { AnalyticsUtil.logEvent( @@ -45,6 +48,8 @@ const useOnUpgrade = (props: Props) => { sectionName, ), ); + } else if (isCloudBillingEnabled) { + window.open(WORKSPACE_SETTINGS_LICENSE_PAGE_URL, "_blank"); } else { window.open( CUSTOMER_PORTAL_URL_WITH_PARAMS(