mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-52425] - Remove leftover Start Trial CTAs (#23099)
* [MM-52425] - Remove leftover Cloud Start Trial CTAs * fix translations * fix feature discovery * fix feature restricted modal * fix test * feedback impl --------- Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
0c6ac000d3
commit
c87fe742be
@ -31,6 +31,7 @@ describe('components/feature_discovery', () => {
|
||||
hadPrevCloudTrial={false}
|
||||
isSubscriptionLoaded={true}
|
||||
isPaidSubscription={false}
|
||||
cloudFreeDeprecated={false}
|
||||
actions={{
|
||||
getPrevTrialLicense: jest.fn(),
|
||||
getCloudSubscription: jest.fn(),
|
||||
@ -58,6 +59,7 @@ describe('components/feature_discovery', () => {
|
||||
isCloudTrial={false}
|
||||
hadPrevCloudTrial={false}
|
||||
isPaidSubscription={false}
|
||||
cloudFreeDeprecated={false}
|
||||
isSubscriptionLoaded={true}
|
||||
actions={{
|
||||
getPrevTrialLicense: jest.fn(),
|
||||
@ -87,6 +89,7 @@ describe('components/feature_discovery', () => {
|
||||
isCloudTrial={false}
|
||||
hadPrevCloudTrial={false}
|
||||
isSubscriptionLoaded={false}
|
||||
cloudFreeDeprecated={false}
|
||||
isPaidSubscription={false}
|
||||
actions={{
|
||||
getPrevTrialLicense: jest.fn(),
|
||||
|
@ -59,6 +59,7 @@ type Props = {
|
||||
isSubscriptionLoaded: boolean;
|
||||
isPaidSubscription: boolean;
|
||||
customer?: CloudCustomer;
|
||||
cloudFreeDeprecated: boolean;
|
||||
}
|
||||
|
||||
type State = {
|
||||
@ -205,6 +206,23 @@ export default class FeatureDiscovery extends React.PureComponent<Props, State>
|
||||
extraClass='btn btn-primary'
|
||||
/>
|
||||
);
|
||||
if (this.props.cloudFreeDeprecated) {
|
||||
ctaPrimaryButton = (
|
||||
<button
|
||||
className='btn btn-primary'
|
||||
data-testid='featureDiscovery_primaryCallToAction'
|
||||
onClick={() => {
|
||||
trackEvent(TELEMETRY_CATEGORIES.SELF_HOSTED_ADMIN, 'click_enterprise_contact_sales_feature_discovery');
|
||||
this.contactSalesFunc();
|
||||
}}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='admin.ldap_feature_discovery_cloud.call_to_action.primary_sales'
|
||||
defaultMessage='Contact sales'
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
} else if (hadPrevCloudTrial) {
|
||||
// if it is cloud, but this account already had a free trial, then the cta button must be Upgrade now
|
||||
ctaPrimaryButton = (
|
||||
@ -259,7 +277,7 @@ export default class FeatureDiscovery extends React.PureComponent<Props, State>
|
||||
/>
|
||||
</ExternalLink>
|
||||
{gettingTrialError}
|
||||
{(!this.props.isCloud || canRequestCloudFreeTrial) && <p className='trial-legal-terms'>
|
||||
{((!this.props.isCloud || canRequestCloudFreeTrial) && !this.props.cloudFreeDeprecated) && <p className='trial-legal-terms'>
|
||||
{canRequestCloudFreeTrial ? (
|
||||
<FormattedMessage
|
||||
id='admin.feature_discovery.trial-request.accept-terms.cloudFree'
|
||||
|
@ -9,6 +9,7 @@ import {getCloudSubscription} from 'mattermost-redux/actions/cloud';
|
||||
import {Action, GenericAction} from 'mattermost-redux/types/actions';
|
||||
import {checkHadPriorTrial, getCloudCustomer} from 'mattermost-redux/selectors/entities/cloud';
|
||||
import {getLicense} from 'mattermost-redux/selectors/entities/general';
|
||||
import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import {ModalData} from 'types/actions';
|
||||
import {GlobalState} from 'types/store';
|
||||
@ -29,6 +30,7 @@ function mapStateToProps(state: GlobalState) {
|
||||
const hasPriorTrial = checkHadPriorTrial(state);
|
||||
const isCloudTrial = subscription?.is_free_trial === 'true';
|
||||
const customer = getCloudCustomer(state);
|
||||
const cloudFreeDeprecated = deprecateCloudFree(state);
|
||||
return {
|
||||
stats: state.entities.admin.analytics,
|
||||
prevTrialLicense: state.entities.admin.prevTrialLicense,
|
||||
@ -38,6 +40,7 @@ function mapStateToProps(state: GlobalState) {
|
||||
hadPrevCloudTrial: hasPriorTrial,
|
||||
isPaidSubscription: isCloud && license?.SkuShortName !== LicenseSkus.Starter && !isCloudTrial,
|
||||
customer,
|
||||
cloudFreeDeprecated,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import {checkHadPriorTrial} from 'mattermost-redux/selectors/entities/cloud';
|
||||
import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users';
|
||||
import {getLicense} from 'mattermost-redux/selectors/entities/general';
|
||||
import {getPrevTrialLicense} from 'mattermost-redux/actions/admin';
|
||||
import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import CloudStartTrialButton from 'components/cloud_start_trial/cloud_start_trial_btn';
|
||||
import StartTrialBtn from 'components/learn_more_trial_modal/start_trial_btn';
|
||||
@ -59,6 +60,7 @@ const FeatureRestrictedModal = ({
|
||||
dispatch(getPrevTrialLicense());
|
||||
}, []);
|
||||
|
||||
const cloudFreeDeprecated = useSelector(deprecateCloudFree);
|
||||
const hasCloudPriorTrial = useSelector(checkHadPriorTrial);
|
||||
const prevTrialLicense = useSelector((state: GlobalState) => state.entities.admin.prevTrialLicense);
|
||||
const hasSelfHostedPriorTrial = prevTrialLicense.IsLicensed === 'true';
|
||||
@ -100,7 +102,7 @@ const FeatureRestrictedModal = ({
|
||||
|
||||
const getTitle = () => {
|
||||
if (isSystemAdmin) {
|
||||
return hasPriorTrial ? titleAdminPostTrial : titleAdminPreTrial;
|
||||
return (hasPriorTrial || cloudFreeDeprecated) ? titleAdminPostTrial : titleAdminPreTrial;
|
||||
}
|
||||
|
||||
return titleEndUser;
|
||||
@ -108,13 +110,13 @@ const FeatureRestrictedModal = ({
|
||||
|
||||
const getMessage = () => {
|
||||
if (isSystemAdmin) {
|
||||
return hasPriorTrial ? messageAdminPostTrial : messageAdminPreTrial;
|
||||
return (hasPriorTrial || cloudFreeDeprecated) ? messageAdminPostTrial : messageAdminPreTrial;
|
||||
}
|
||||
|
||||
return messageEndUser;
|
||||
};
|
||||
|
||||
const showStartTrial = isSystemAdmin && !hasPriorTrial;
|
||||
const showStartTrial = isSystemAdmin && !hasPriorTrial && !cloudFreeDeprecated;
|
||||
|
||||
// define what is the secondary button text and action, by default will be the View Plan button
|
||||
let secondaryBtnMsg = formatMessage({id: 'feature_restricted_modal.button.plans', defaultMessage: 'View plans'});
|
||||
|
@ -14,6 +14,7 @@ import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/user
|
||||
import {getSubscriptionProduct, checkHadPriorTrial} from 'mattermost-redux/selectors/entities/cloud';
|
||||
import {DispatchFunc} from 'mattermost-redux/types/actions';
|
||||
import {getPrevTrialLicense} from 'mattermost-redux/actions/admin';
|
||||
import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import {closeModal, openModal} from 'actions/views/modals';
|
||||
|
||||
@ -43,6 +44,7 @@ export type Props = {
|
||||
export default function InviteAs(props: Props) {
|
||||
const {formatMessage} = useIntl();
|
||||
const license = useSelector(getLicense);
|
||||
const cloudFreeDeprecated = useSelector(deprecateCloudFree);
|
||||
const dispatch = useDispatch<DispatchFunc>();
|
||||
|
||||
useEffect(() => {
|
||||
@ -85,7 +87,7 @@ export default function InviteAs(props: Props) {
|
||||
if (isFreeTrial) {
|
||||
ctaExtraContentMsg = formatMessage({id: 'free.professional_feature.professional', defaultMessage: 'Professional feature'});
|
||||
} else {
|
||||
ctaExtraContentMsg = hasPriorTrial ? formatMessage({id: 'free.professional_feature.upgrade', defaultMessage: 'Upgrade'}) : formatMessage({id: 'free.professional_feature.try_free', defaultMessage: 'Professional feature- try it out free'});
|
||||
ctaExtraContentMsg = (hasPriorTrial || cloudFreeDeprecated) ? formatMessage({id: 'free.professional_feature.upgrade', defaultMessage: 'Upgrade'}) : formatMessage({id: 'free.professional_feature.try_free', defaultMessage: 'Professional feature- try it out free'});
|
||||
}
|
||||
|
||||
const restrictedIndicator = (
|
||||
|
@ -33,6 +33,12 @@ describe('components/learn_more_trial_modal/learn_more_trial_modal', () => {
|
||||
entities: {
|
||||
users: {
|
||||
currentUserId: 'current_user_id',
|
||||
profiles: {
|
||||
current_user_id: {
|
||||
id: 'current_user_id',
|
||||
roles: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
admin: {
|
||||
analytics: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {useCallback, useEffect, useMemo, useState} from 'react';
|
||||
import {useIntl} from 'react-intl';
|
||||
import {FormattedMessage, useIntl} from 'react-intl';
|
||||
import {useSelector, useDispatch} from 'react-redux';
|
||||
|
||||
import {trackEvent} from 'actions/telemetry_actions';
|
||||
@ -16,10 +16,13 @@ import MonitorImacLikeSVG from 'components/common/svg_images_components/monitor_
|
||||
import SystemRolesSVG from 'components/admin_console/feature_discovery/features/images/system_roles_svg';
|
||||
import CloudStartTrialButton from 'components/cloud_start_trial/cloud_start_trial_btn';
|
||||
import {BtnStyle} from 'components/common/carousel/carousel_button';
|
||||
import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink';
|
||||
import ExternalLink from 'components/external_link';
|
||||
|
||||
import {closeModal} from 'actions/views/modals';
|
||||
import {DispatchFunc} from 'mattermost-redux/types/actions';
|
||||
import {getLicense} from 'mattermost-redux/selectors/entities/general';
|
||||
import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import StartTrialBtn from './start_trial_btn';
|
||||
|
||||
@ -43,8 +46,11 @@ const LearnMoreTrialModal = (
|
||||
const [embargoed, setEmbargoed] = useState(false);
|
||||
const dispatch = useDispatch<DispatchFunc>();
|
||||
|
||||
const [, salesLink] = useOpenSalesLink();
|
||||
|
||||
// Cloud conditions
|
||||
const license = useSelector(getLicense);
|
||||
const cloudFreeDeprecated = useSelector(deprecateCloudFree);
|
||||
const isCloud = license?.Cloud === 'true';
|
||||
|
||||
const handleEmbargoError = useCallback(() => {
|
||||
@ -78,6 +84,20 @@ const LearnMoreTrialModal = (
|
||||
extraClass={'btn btn-primary start-cloud-trial-btn'}
|
||||
/>
|
||||
);
|
||||
if (cloudFreeDeprecated) {
|
||||
startTrialBtn = (
|
||||
<ExternalLink
|
||||
location='learn_more_trial_modal'
|
||||
href={salesLink}
|
||||
className='btn btn-primary start-cloud-trial-btn'
|
||||
>
|
||||
<FormattedMessage
|
||||
id='learn_more_trial_modal.contact_sales'
|
||||
defaultMessage='Contact sales'
|
||||
/>
|
||||
</ExternalLink>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const handleOnClose = useCallback(() => {
|
||||
|
@ -2,10 +2,11 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import {useSelector} from 'react-redux';
|
||||
import {FormattedMessage} from 'react-intl';
|
||||
|
||||
import TrialBenefitsModalStepMore from 'components/trial_benefits_modal/trial_benefits_modal_step_more';
|
||||
import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import './learn_more_trial_modal_step.scss';
|
||||
import {AboutLinks, LicenseLinks} from 'utils/constants';
|
||||
@ -35,6 +36,7 @@ const LearnMoreTrialModalStep = (
|
||||
buttonLabel,
|
||||
handleOnClose,
|
||||
}: LearnMoreTrialModalStepProps) => {
|
||||
const cloudFreeDeprecated = useSelector(deprecateCloudFree);
|
||||
return (
|
||||
<div
|
||||
id={`learnMoreTrialModalStep-${id}`}
|
||||
@ -59,32 +61,36 @@ const LearnMoreTrialModalStep = (
|
||||
telemetryId={'learn_more_trial_modal'}
|
||||
/>
|
||||
)}
|
||||
<div className='disclaimer'>
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id='start_trial.modal.disclaimer'
|
||||
defaultMessage='By clicking “Start trial”, I agree to the <linkEvaluation>Mattermost Software and Services License Agreement</linkEvaluation>, <linkPrivacy>privacy policy</linkPrivacy> and receiving product emails.'
|
||||
values={{
|
||||
linkEvaluation: (msg: React.ReactNode) => (
|
||||
<ExternalLink
|
||||
href={LicenseLinks.SOFTWARE_SERVICES_LICENSE_AGREEMENT}
|
||||
location='learn_more_trial_modal_step'
|
||||
>
|
||||
{msg}
|
||||
</ExternalLink>
|
||||
),
|
||||
linkPrivacy: (msg: React.ReactNode) => (
|
||||
<ExternalLink
|
||||
href={AboutLinks.PRIVACY_POLICY}
|
||||
location='learn_more_trial_modal_step'
|
||||
>
|
||||
{msg}
|
||||
</ExternalLink>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
{
|
||||
cloudFreeDeprecated ? '' : (
|
||||
<div className='disclaimer'>
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id='start_trial.modal.disclaimer'
|
||||
defaultMessage='By clicking “Start trial”, I agree to the <linkEvaluation>Mattermost Software and Services License Agreement</linkEvaluation>, <linkPrivacy>privacy policy</linkPrivacy> and receiving product emails.'
|
||||
values={{
|
||||
linkEvaluation: (msg: React.ReactNode) => (
|
||||
<ExternalLink
|
||||
href={LicenseLinks.SOFTWARE_SERVICES_LICENSE_AGREEMENT}
|
||||
location='learn_more_trial_modal_step'
|
||||
>
|
||||
{msg}
|
||||
</ExternalLink>
|
||||
),
|
||||
linkPrivacy: (msg: React.ReactNode) => (
|
||||
<ExternalLink
|
||||
href={AboutLinks.PRIVACY_POLICY}
|
||||
location='learn_more_trial_modal_step'
|
||||
>
|
||||
{msg}
|
||||
</ExternalLink>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{bottomLeftMessage && (
|
||||
<div className='bottom-text-left-message'>
|
||||
{bottomLeftMessage}
|
||||
|
@ -14,6 +14,7 @@ import {DispatchFunc} from 'mattermost-redux/types/actions';
|
||||
import {getLicense} from 'mattermost-redux/selectors/entities/general';
|
||||
import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users';
|
||||
import {getCloudSubscription, getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud';
|
||||
import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import {openModal} from 'actions/views/modals';
|
||||
|
||||
@ -32,6 +33,7 @@ const MenuCloudTrial = ({id}: Props): JSX.Element | null => {
|
||||
const subscription = useSelector(getCloudSubscription);
|
||||
const subscriptionProduct = useSelector(getSubscriptionProduct);
|
||||
const license = useSelector(getLicense);
|
||||
const cloudFreeDeprecated = useSelector(deprecateCloudFree);
|
||||
const dispatch = useDispatch<DispatchFunc>();
|
||||
|
||||
const isCloud = license?.Cloud === 'true';
|
||||
@ -109,7 +111,7 @@ const MenuCloudTrial = ({id}: Props): JSX.Element | null => {
|
||||
);
|
||||
|
||||
// menu option displayed when the workspace is not running any trial
|
||||
const noFreeTrialContent = noPriorTrial ? (
|
||||
const noFreeTrialContent = (noPriorTrial && !cloudFreeDeprecated) ? (
|
||||
<FormattedMessage
|
||||
id='menu.cloudFree.priorTrial.tryEnterprise'
|
||||
defaultMessage='Interested in a limitless plan with high-security features? <openModalLink>Try Enterprise free for 30 days</openModalLink>'
|
||||
|
@ -4036,6 +4036,7 @@
|
||||
"learn_more_about_trial.modal.useSsoDescription": "Sign on quickly and easily with our SSO feature that works with OpenID, SAML, Google, and O365.",
|
||||
"learn_more_about_trial.modal.useSsoTitle": "Use SSO (with OpenID, SAML, Google, O365)",
|
||||
"learn_more_trial_modal_step.learnMoreAboutFeature": "Learn more about this feature.",
|
||||
"learn_more_trial_modal.contact_sales": "Contact Sales",
|
||||
"learn_more_trial_modal.pretitle": "With Enterprise, you can...",
|
||||
"leave_private_channel_modal.leave": "Yes, leave channel",
|
||||
"leave_private_channel_modal.message": "Are you sure you wish to leave the private channel {channel}? You must be re-invited in order to re-join this channel in the future.",
|
||||
|
Loading…
Reference in New Issue
Block a user