fix: premium and soon datasource display condition changed (#38858)
This commit is contained in:
parent
83ce2d6962
commit
f0a6efd84a
|
|
@ -17,7 +17,7 @@ import { isEmail } from "utils/formhelpers";
|
||||||
import ReduxFormTextField from "components/utils/ReduxFormTextField";
|
import ReduxFormTextField from "components/utils/ReduxFormTextField";
|
||||||
import { PRICING_PAGE_URL } from "constants/ThirdPartyConstants";
|
import { PRICING_PAGE_URL } from "constants/ThirdPartyConstants";
|
||||||
import { getAppsmithConfigs } from "ee/configs";
|
import { getAppsmithConfigs } from "ee/configs";
|
||||||
import { getInstanceId, isFreePlan } from "ee/selectors/tenantSelectors";
|
import { getInstanceId } from "ee/selectors/tenantSelectors";
|
||||||
import { pricingPageUrlSource } from "ee/utils/licenseHelpers";
|
import { pricingPageUrlSource } from "ee/utils/licenseHelpers";
|
||||||
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
|
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
|
||||||
import {
|
import {
|
||||||
|
|
@ -29,6 +29,8 @@ import {
|
||||||
shouldLearnMoreButtonBeVisible,
|
shouldLearnMoreButtonBeVisible,
|
||||||
} from "./Helpers";
|
} from "./Helpers";
|
||||||
import { PREMIUM_INTEGRATION_CONTACT_FORM } from "./Constants";
|
import { PREMIUM_INTEGRATION_CONTACT_FORM } from "./Constants";
|
||||||
|
import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
|
||||||
|
import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
|
||||||
|
|
||||||
const FormWrapper = styled.form`
|
const FormWrapper = styled.form`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -41,7 +43,8 @@ const PremiumDatasourceContactForm = (
|
||||||
) => {
|
) => {
|
||||||
const instanceId = useSelector(getInstanceId);
|
const instanceId = useSelector(getInstanceId);
|
||||||
const appsmithConfigs = getAppsmithConfigs();
|
const appsmithConfigs = getAppsmithConfigs();
|
||||||
const isFreePlanInstance = useSelector(isFreePlan);
|
// We are using this feature flag to identify whether its the enterprise/business user - ref : https://www.notion.so/appsmith/Condition-for-showing-Premium-Soon-tag-datasources-184fe271b0e2802cb55bd63f468df60d
|
||||||
|
const isGACEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled);
|
||||||
|
|
||||||
const redirectPricingURL = PRICING_PAGE_URL(
|
const redirectPricingURL = PRICING_PAGE_URL(
|
||||||
appsmithConfigs.pricingUrl,
|
appsmithConfigs.pricingUrl,
|
||||||
|
|
@ -68,24 +71,20 @@ const PremiumDatasourceContactForm = (
|
||||||
}, [redirectPricingURL, props.email, props.integrationName]);
|
}, [redirectPricingURL, props.email, props.integrationName]);
|
||||||
|
|
||||||
const submitEvent = useCallback(() => {
|
const submitEvent = useCallback(() => {
|
||||||
handleSubmitEvent(
|
handleSubmitEvent(props.integrationName, props.email || "", isGACEnabled);
|
||||||
props.integrationName,
|
}, [props.email, props.integrationName, isGACEnabled]);
|
||||||
props.email || "",
|
|
||||||
!isFreePlanInstance,
|
|
||||||
);
|
|
||||||
}, [props.email, props.integrationName, isFreePlanInstance]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
{getContactFormModalTitle(props.integrationName, !isFreePlanInstance)}
|
{getContactFormModalTitle(props.integrationName, isGACEnabled)}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
<FormWrapper onSubmit={props.handleSubmit(onSubmit)}>
|
<FormWrapper onSubmit={props.handleSubmit(onSubmit)}>
|
||||||
<Text renderAs="p">
|
<Text renderAs="p">
|
||||||
{getContactFormModalDescription(
|
{getContactFormModalDescription(
|
||||||
props.email || "",
|
props.email || "",
|
||||||
props.integrationName,
|
props.integrationName,
|
||||||
!isFreePlanInstance,
|
isGACEnabled,
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<Field
|
<Field
|
||||||
|
|
@ -99,7 +98,7 @@ const PremiumDatasourceContactForm = (
|
||||||
type="email"
|
type="email"
|
||||||
/>
|
/>
|
||||||
<ModalFooter>
|
<ModalFooter>
|
||||||
{shouldLearnMoreButtonBeVisible(!isFreePlanInstance) && (
|
{shouldLearnMoreButtonBeVisible(isGACEnabled) && (
|
||||||
<Button
|
<Button
|
||||||
aria-label="Learn more"
|
aria-label="Learn more"
|
||||||
kind="secondary"
|
kind="secondary"
|
||||||
|
|
@ -110,10 +109,7 @@ const PremiumDatasourceContactForm = (
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<Button isDisabled={props.invalid} size="md" type="submit">
|
<Button isDisabled={props.invalid} size="md" type="submit">
|
||||||
{getContactFormSubmitButtonText(
|
{getContactFormSubmitButtonText(props.email || "", isGACEnabled)}
|
||||||
props.email || "",
|
|
||||||
!isFreePlanInstance,
|
|
||||||
)}
|
|
||||||
</Button>
|
</Button>
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</FormWrapper>
|
</FormWrapper>
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ import { Modal, ModalContent, Tag } from "@appsmith/ads";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import ContactForm from "./ContactForm";
|
import ContactForm from "./ContactForm";
|
||||||
import { getTagText, handlePremiumDatasourceClick } from "./Helpers";
|
import { getTagText, handlePremiumDatasourceClick } from "./Helpers";
|
||||||
import { isFreePlan } from "ee/selectors/tenantSelectors";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import DatasourceItem from "../DatasourceItem";
|
import DatasourceItem from "../DatasourceItem";
|
||||||
import type { PremiumIntegration } from "./Constants";
|
import type { PremiumIntegration } from "./Constants";
|
||||||
|
import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
|
||||||
|
import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
|
||||||
|
|
||||||
const ModalContentWrapper = styled(ModalContent)`
|
const ModalContentWrapper = styled(ModalContent)`
|
||||||
max-width: 518px;
|
max-width: 518px;
|
||||||
|
|
@ -36,9 +36,10 @@ export default function PremiumDatasources(props: {
|
||||||
plugins: PremiumIntegration[];
|
plugins: PremiumIntegration[];
|
||||||
}) {
|
}) {
|
||||||
const [selectedIntegration, setSelectedIntegration] = useState<string>("");
|
const [selectedIntegration, setSelectedIntegration] = useState<string>("");
|
||||||
const isFreePlanInstance = useSelector(isFreePlan);
|
// We are using this feature flag to identify whether its the enterprise/business user - ref : https://www.notion.so/appsmith/Condition-for-showing-Premium-Soon-tag-datasources-184fe271b0e2802cb55bd63f468df60d
|
||||||
|
const isGACEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled);
|
||||||
const handleOnClick = (name: string) => {
|
const handleOnClick = (name: string) => {
|
||||||
handlePremiumDatasourceClick(name, !isFreePlanInstance);
|
handlePremiumDatasourceClick(name, isGACEnabled);
|
||||||
setSelectedIntegration(name);
|
setSelectedIntegration(name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -61,11 +62,11 @@ export default function PremiumDatasources(props: {
|
||||||
name={integration.name}
|
name={integration.name}
|
||||||
rightSibling={
|
rightSibling={
|
||||||
<PremiumTag
|
<PremiumTag
|
||||||
isBusinessOrEnterprise={!isFreePlanInstance}
|
isBusinessOrEnterprise={isGACEnabled}
|
||||||
isClosable={false}
|
isClosable={false}
|
||||||
kind={"premium"}
|
kind={"premium"}
|
||||||
>
|
>
|
||||||
{getTagText(!isFreePlanInstance)}
|
{getTagText(isGACEnabled)}
|
||||||
</PremiumTag>
|
</PremiumTag>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user