chore: added query params for ramps on admin settings page (#26539)

This commit is contained in:
Ankit Srivastava 2023-08-22 11:59:29 +05:30 committed by GitHub
parent 56c6aa0f1d
commit 584a0cd6d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 35 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import { adminSettingsCategoryUrl } from "RouteBuilder";
import AnalyticsUtil from "utils/AnalyticsUtil";
import useOnUpgrade from "utils/hooks/useOnUpgrade";
import BusinessTag from "components/BusinessTag";
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
export const Wrapper = styled.div`
flex-basis: calc(100% - ${(props) => props.theme.homePage.leftPane.width}px);
@ -107,6 +108,8 @@ export function ActionButton({ method }: { method: AuthMethodType }) {
const { onUpgrade } = useOnUpgrade({
logEventName: "ADMIN_SETTINGS_UPGRADE_AUTH_METHOD",
logEventData: { method: method.label },
featureName: RampFeature.Sso,
sectionName: RampSection.AdminSettings,
});
const onClickHandler = (method: AuthMethodType) => {

View File

@ -13,6 +13,7 @@ import {
} from "@appsmith/pages/AdminSettings/config/authentication/AuthPage";
import styled from "styled-components";
import BusinessTag from "components/BusinessTag";
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
const StyledSettingsSubHeader = styled(SettingsSubHeader)`
margin: 0;
@ -21,6 +22,8 @@ const StyledSettingsSubHeader = styled(SettingsSubHeader)`
const UpgradeBanner = () => {
const { onUpgrade } = useOnUpgrade({
logEventName: "BRANDING_UPGRADE_CLICK",
featureName: RampFeature.Branding,
sectionName: RampSection.AdminSettings,
});
return (

View File

@ -18,11 +18,14 @@ import {
SECURITY_APPS_LEAST_PRIVILEGE_DETAIL1,
} from "@appsmith/constants/messages";
import useOnUpgrade from "utils/hooks/useOnUpgrade";
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
export function AccessControlUpgradePage() {
const { onUpgrade } = useOnUpgrade({
logEventName: "GAC_UPGRADE_CLICK_ADMIN_SETTINGS",
logEventData: { source: "Granular Access Control" },
featureName: RampFeature.Gac,
sectionName: RampSection.AdminSettings,
});
const header: Header = {

View File

@ -18,11 +18,14 @@ import {
SECURITY_AND_COMPLIANCE_DETAIL2,
} from "@appsmith/constants/messages";
import useOnUpgrade from "utils/hooks/useOnUpgrade";
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
export function AuditLogsUpgradePage() {
const { onUpgrade } = useOnUpgrade({
logEventName: "AUDIT_LOGS_UPGRADE_ADMIN_SETTINGS",
logEventData: { source: "AuditLogs" },
featureName: RampFeature.AuditLogs,
sectionName: RampSection.AdminSettings,
});
const header: Header = {

View File

@ -14,11 +14,14 @@ import {
USER_PROVISIONING_FOR_ENTERPRISES,
} from "@appsmith/constants/messages";
import useOnUpgrade from "utils/hooks/useOnUpgrade";
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
export function ProvisioningUpgradePage() {
const { onUpgrade } = useOnUpgrade({
logEventName: "PROVISIONING_UPGRADE_ADMIN_SETTINGS",
logEventData: { source: "Provisioning" },
featureName: RampFeature.Provisioning,
sectionName: RampSection.AdminSettings,
});
const header: Header = {

View File

@ -29,4 +29,9 @@ export const PRICING_PAGE_URL = (
URL: string,
source: string,
instanceId: string,
) => `${URL}?source=${source}${instanceId ? `&instance=${instanceId}` : ``}`;
feature?: string,
section?: string,
) =>
`${URL}?source=${source}${instanceId ? `&instance=${instanceId}` : ``}${
feature ? `&feature=${feature}` : ""
}${section ? `&section=${section}` : ""}`;

View File

@ -21,12 +21,17 @@ export enum RampSection {
AppSettings = "app_settings",
BottomBarEnvSwitcher = "bottom_bar_env_switcher",
DSEditor = "ds_editor",
AdminSettings = "admin_settings",
}
export enum RampFeature {
PrivateEmbeds = "private_embeds",
Gac = "gac",
MultipleEnv = "multiple_env",
AuditLogs = "audit_logs",
Branding = "branding",
Sso = "sso",
Provisioning = "provisioning",
}
export const INVITE_USER_TO_APP: SupportedRampsType = {

View File

@ -5,14 +5,20 @@ import type { EventName } from "@appsmith/utils/analyticsUtilTypes";
import AnalyticsUtil from "utils/AnalyticsUtil";
import { getAppsmithConfigs } from "@appsmith/configs";
import { pricingPageUrlSource } from "@appsmith/utils/licenseHelpers";
import type {
RampFeature,
RampSection,
} from "utils/ProductRamps/RampsControlList";
type Props = {
logEventName?: EventName;
logEventData?: any;
featureName?: RampFeature;
sectionName?: RampSection;
};
const useOnUpgrade = (props: Props) => {
const { logEventData, logEventName } = props;
const { featureName, logEventData, logEventName, sectionName } = props;
const instanceId = useSelector(getInstanceId);
const appsmithConfigs = getAppsmithConfigs();
@ -26,6 +32,8 @@ const useOnUpgrade = (props: Props) => {
appsmithConfigs.pricingUrl,
pricingPageUrlSource,
instanceId,
featureName,
sectionName,
),
"_blank",
);