chore: Updating upgrade link for cloud billing (#40156)
## Description Updating upgrade link for cloud billing Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Settings" ### 🔍 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/14328221969> > Commit: 7502e28220824eba1461cb9f981be9392f3efea8 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14328221969&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Settings` > Spec: > <hr>Tue, 08 Apr 2025 08:22:33 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 - **New Features** - Adjusted link behavior so that when multi-organization features are active, users are directed to a dedicated settings page. - Enhanced the upgrade process to detect cloud billing activation and open the appropriate licensing page for a more seamless experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
804866483b
commit
bee20912fd
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user