diff --git a/server/public/model/feature_flags.go b/server/public/model/feature_flags.go index ac39c8b2c9..8e38ead0c7 100644 --- a/server/public/model/feature_flags.go +++ b/server/public/model/feature_flags.go @@ -36,8 +36,6 @@ type FeatureFlags struct { DeprecateCloudFree bool - CloudReverseTrial bool - EnableExportDirectDownload bool MoveThreadsEnabled bool @@ -69,7 +67,6 @@ func (f *FeatureFlags) SetDefaults() { f.DeprecateCloudFree = false f.WysiwygEditor = false f.OnboardingTourTips = true - f.CloudReverseTrial = false f.EnableExportDirectDownload = false f.MoveThreadsEnabled = false f.StreamlinedMarketplace = true diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.test.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.test.tsx index 714bb14dce..0c987c06bd 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.test.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.test.tsx @@ -20,7 +20,6 @@ const initialState = { general: { config: { CWSURL: '', - FeatureFlagDeprecateCloudFree: 'true', }, license: { IsLicensed: 'true', diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx index ccd4bc381c..50ba42a4c3 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx @@ -10,7 +10,7 @@ import type {GlobalState} from '@mattermost/types/store'; import {savePreferences} from 'mattermost-redux/actions/preferences'; import {getSubscriptionProduct as selectSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; -import {deprecateCloudFree, get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; +import {get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; import AnnouncementBar from 'components/announcement_bar/default_announcement_bar'; @@ -48,7 +48,6 @@ export const ToPaidPlanBannerDismissable = () => { const currentUser = useSelector(getCurrentUser); const isAdmin = useSelector(isCurrentUserSystemAdmin); const product = useSelector(selectSubscriptionProduct); - const cloudFreeDeprecated = useSelector(deprecateCloudFree); const currentProductStarter = product?.sku === CloudProducts.STARTER; const now = moment(Date.now()); @@ -123,10 +122,6 @@ export const ToPaidPlanBannerDismissable = () => { }])); }; - if (!cloudFreeDeprecated) { - return null; - } - if (!show) { return null; } diff --git a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx index 914f92e0b3..369d7f6173 100644 --- a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx +++ b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx @@ -44,7 +44,6 @@ describe('components/feature_discovery', () => { hadPrevCloudTrial={false} isSubscriptionLoaded={true} isPaidSubscription={false} - cloudFreeDeprecated={false} actions={{ getPrevTrialLicense, getCloudSubscription, @@ -104,7 +103,6 @@ describe('components/feature_discovery', () => { hadPrevCloudTrial={false} isPaidSubscription={false} isSubscriptionLoaded={true} - cloudFreeDeprecated={false} actions={{ getPrevTrialLicense, getCloudSubscription, @@ -165,7 +163,6 @@ describe('components/feature_discovery', () => { hadPrevCloudTrial={false} isSubscriptionLoaded={false} isPaidSubscription={false} - cloudFreeDeprecated={false} actions={{ getPrevTrialLicense, getCloudSubscription, diff --git a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx index d9f8e0bf11..35f8dc0f8b 100644 --- a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx +++ b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx @@ -52,7 +52,6 @@ type Props = { isSubscriptionLoaded: boolean; isPaidSubscription: boolean; customer?: CloudCustomer; - cloudFreeDeprecated: boolean; } type State = { diff --git a/webapp/channels/src/components/admin_console/feature_discovery/index.tsx b/webapp/channels/src/components/admin_console/feature_discovery/index.tsx index 51b9fb91a5..b61e55f6a0 100644 --- a/webapp/channels/src/components/admin_console/feature_discovery/index.tsx +++ b/webapp/channels/src/components/admin_console/feature_discovery/index.tsx @@ -9,7 +9,6 @@ import {getPrevTrialLicense} from 'mattermost-redux/actions/admin'; import {getCloudSubscription} from 'mattermost-redux/actions/cloud'; 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 {openModal} from 'actions/views/modals'; @@ -29,7 +28,6 @@ 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, @@ -39,7 +37,6 @@ function mapStateToProps(state: GlobalState) { hadPrevCloudTrial: hasPriorTrial, isPaidSubscription: isCloud && license?.SkuShortName !== LicenseSkus.Starter && !isCloudTrial, customer, - cloudFreeDeprecated, }; } diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx index f91aaab82b..17e224e2bb 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx @@ -36,7 +36,6 @@ type Props = { daysLeftOnTrial: number; isCloud: boolean; subscription?: Subscription; - reverseTrial: boolean; actions: { savePreferences: (userId: string, preferences: PreferenceType[]) => void; getCloudSubscription: () => void; @@ -131,7 +130,7 @@ class CloudTrialAnnouncementBar extends React.PureComponent { return null; } - let trialMoreThan7DaysMsg = ( + const trialMoreThan7DaysMsg = ( { /> ); - let modalButtonText; - if (this.props.reverseTrial) { - modalButtonText = messages.trialButton; - } else { - modalButtonText = messages.reverseTrialButton; - } + const modalButtonText = messages.trialButton; - if (this.props.reverseTrial) { - const trialEnd = getLocaleDateFromUTC((this.props.subscription?.trial_end_at as number / 1000), 'MMMM Do'); - trialMoreThan7DaysMsg = ( - - ); - } - - let trialLessThan7DaysMsg = ( + const trialLessThan7DaysMsg = ( ); - if (this.props.reverseTrial) { - trialLessThan7DaysMsg = ( - - ); - } - - const userEndTrialDate = getLocaleDateFromUTC((this.props.subscription?.trial_end_at as number / 1000), 'MMMM Do YYYY'); const userEndTrialHour = getLocaleDateFromUTC((this.props.subscription?.trial_end_at as number / 1000), 'HH:mm', this.props.currentUser.timezone?.automaticTimezone as string); - let trialLastDaysMsg = ( + const trialLastDaysMsg = ( ); - if (this.props.reverseTrial) { - trialLastDaysMsg = ( - - ); - } - let bannerMessage; let icon; diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts index d64fafe534..68e796bfa8 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts @@ -7,7 +7,6 @@ import type {Dispatch} from 'redux'; import {getCloudSubscription} from 'mattermost-redux/actions/cloud'; import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {getConfig} from 'mattermost-redux/selectors/entities/admin'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; @@ -28,7 +27,6 @@ function mapStateToProps(state: GlobalState) { const isCloud = getLicense(state).Cloud === 'true'; let isFreeTrial = false; let daysLeftOnTrial = 0; - const config = getConfig(state); if (isCloud && subscription?.is_free_trial === 'true') { isFreeTrial = true; @@ -46,7 +44,6 @@ function mapStateToProps(state: GlobalState) { isCloud, subscription, preferences: getCategory(state, Preferences.CLOUD_TRIAL_BANNER), - reverseTrial: Boolean(config.FeatureFlags?.CloudReverseTrial), }; } diff --git a/webapp/channels/src/components/invitation_modal/invite_as.tsx b/webapp/channels/src/components/invitation_modal/invite_as.tsx index a38b723e9d..66ba707246 100644 --- a/webapp/channels/src/components/invitation_modal/invite_as.tsx +++ b/webapp/channels/src/components/invitation_modal/invite_as.tsx @@ -8,7 +8,6 @@ import {useSelector, useDispatch} from 'react-redux'; import {getPrevTrialLicense} from 'mattermost-redux/actions/admin'; import {getSubscriptionProduct, checkHadPriorTrial} from 'mattermost-redux/selectors/entities/cloud'; import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences'; import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; import {closeModal, openModal} from 'actions/views/modals'; @@ -40,7 +39,6 @@ export type Props = { export default function InviteAs(props: Props) { const {formatMessage} = useIntl(); const license = useSelector(getLicense); - const cloudFreeDeprecated = useSelector(deprecateCloudFree); const dispatch = useDispatch(); useEffect(() => { @@ -83,7 +81,7 @@ export default function InviteAs(props: Props) { if (isFreeTrial) { ctaExtraContentMsg = formatMessage({id: 'free.professional_feature.professional', defaultMessage: 'Professional feature'}); } else { - 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'}); + ctaExtraContentMsg = (hasPriorTrial) ? formatMessage({id: 'free.professional_feature.upgrade', defaultMessage: 'Upgrade'}) : formatMessage({id: 'free.professional_feature.try_free', defaultMessage: 'Professional feature- try it out free'}); } const restrictedIndicator = ( diff --git a/webapp/channels/src/components/learn_more_trial_modal/learn_more_trial_modal_step.tsx b/webapp/channels/src/components/learn_more_trial_modal/learn_more_trial_modal_step.tsx index 9b5e2b6a68..0a2abaa7e1 100644 --- a/webapp/channels/src/components/learn_more_trial_modal/learn_more_trial_modal_step.tsx +++ b/webapp/channels/src/components/learn_more_trial_modal/learn_more_trial_modal_step.tsx @@ -2,16 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {FormattedMessage} from 'react-intl'; -import {useSelector} from 'react-redux'; -import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences'; - -import ExternalLink from 'components/external_link'; import TrialBenefitsModalStepMore from 'components/trial_benefits_modal/trial_benefits_modal_step_more'; -import {AboutLinks, LicenseLinks} from 'utils/constants'; - import './learn_more_trial_modal_step.scss'; export type LearnMoreTrialModalStepProps = { @@ -38,7 +31,6 @@ const LearnMoreTrialModalStep = ( buttonLabel, handleOnClose, }: LearnMoreTrialModalStepProps) => { - const cloudFreeDeprecated = useSelector(deprecateCloudFree); return (
)} - { - cloudFreeDeprecated ? '' : ( -
- - ( - - {msg} - - ), - linkPrivacy: (msg: React.ReactNode) => ( - - {msg} - - ), - }} - /> - -
- ) - } {bottomLeftMessage && (
{bottomLeftMessage} diff --git a/webapp/channels/src/components/pricing_modal/content.tsx b/webapp/channels/src/components/pricing_modal/content.tsx index a130e24251..59e5afeb35 100644 --- a/webapp/channels/src/components/pricing_modal/content.tsx +++ b/webapp/channels/src/components/pricing_modal/content.tsx @@ -11,7 +11,6 @@ import { getSubscriptionProduct as selectSubscriptionProduct, getCloudProducts as selectCloudProducts, } from 'mattermost-redux/selectors/entities/cloud'; -import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences'; import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; import {trackEvent} from 'actions/telemetry_actions'; @@ -27,7 +26,6 @@ import {findOnlyYearlyProducts, findProductBySku} from 'utils/products'; import Card, {BlankCard, ButtonCustomiserClasses} from './card'; import ContactSalesCTA from './contact_sales_cta'; -import StartTrialCaution from './start_trial_caution'; import './content.scss'; @@ -48,7 +46,6 @@ function Content(props: ContentProps) { const currentProduct = useSelector(selectSubscriptionProduct); const products = useSelector(selectCloudProducts); - const cloudFreeDeprecated = useSelector(deprecateCloudFree); const yearlyProducts = findOnlyYearlyProducts(products || {}); // pricing modal should now only show yearly products const currentSubscriptionIsMonthly = currentProduct?.recurring_interval === RecurringIntervals.MONTH; @@ -220,10 +217,10 @@ function Content(props: ContentProps) { renderLastDaysOnTrial={true} />) : undefined} buttonDetails={enterpriseBtnDetails()} - planTrialDisclaimer={(!isPostTrial && isAdmin && !cloudFreeDeprecated) ? : undefined} - contactSalesCTA={(isPostTrial || !isAdmin || cloudFreeDeprecated) ? undefined : } + planTrialDisclaimer={undefined} + contactSalesCTA={(isPostTrial || !isAdmin) ? undefined : } briefing={{ - title: cloudFreeDeprecated ? formatMessage({id: 'pricing_modal.briefing.title_large_scale', defaultMessage: 'Large scale collaboration'}) : formatMessage({id: 'pricing_modal.briefing.title', defaultMessage: 'Top features'}), + title: formatMessage({id: 'pricing_modal.briefing.title_large_scale', defaultMessage: 'Large scale collaboration'}), items: [ formatMessage({id: 'pricing_modal.briefing.enterprise.groupSync', defaultMessage: 'AD/LDAP group sync'}), formatMessage({id: 'pricing_modal.briefing.enterprise.rolesAndPermissions', defaultMessage: 'Advanced roles and permissions'}), diff --git a/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.test.tsx b/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.test.tsx index 9a095f1f10..339961570f 100644 --- a/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.test.tsx +++ b/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.test.tsx @@ -162,43 +162,6 @@ describe('components/widgets/menu/menu_items/menu_cloud_trial', () => { expect(wrapper.find('.MenuCloudTrial').exists()).toEqual(false); }); - test('should invite to start trial when the subscription is not paid and have not had trial before', () => { - const state = { - entities: { - general: { - license: { - IsLicensed: 'true', - Cloud: 'true', - }, - }, - cloud: { - subscription: { - is_free_trial: 'false', - trial_end_at: 0, - product_id: 'prod_starter', - }, - products: { - prod_starter: { - id: 'prod_starter', - sku: CloudProducts.STARTER, - }, - }, - limits, - }, - usage, - users: { - currentUserId: 'current_user_id', - profiles: { - current_user_id: {roles: 'system_admin'}, - }, - }, - }, - }; - const store = mockStore(state); - const wrapper = mountWithIntl(); - expect(wrapper.find('.open-learn-more-trial-modal').exists()).toEqual(true); - }); - test('should show the open trial benefits modal when is free trial', () => { const state = { entities: { diff --git a/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.tsx b/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.tsx index 3b5b99070d..65471398e2 100644 --- a/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.tsx +++ b/webapp/channels/src/components/widgets/menu/menu_items/menu_cloud_trial.tsx @@ -8,7 +8,6 @@ import {useSelector, useDispatch} from 'react-redux'; import {getCloudSubscription, getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {deprecateCloudFree} from 'mattermost-redux/selectors/entities/preferences'; import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; import {openModal} from 'actions/views/modals'; @@ -17,7 +16,6 @@ import useGetHighestThresholdCloudLimit from 'components/common/hooks/useGetHigh import useGetLimits from 'components/common/hooks/useGetLimits'; import useGetUsage from 'components/common/hooks/useGetUsage'; import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; -import LearnMoreTrialModal from 'components/learn_more_trial_modal/learn_more_trial_modal'; import TrialBenefitsModal from 'components/trial_benefits_modal/trial_benefits_modal'; import {ModalIdentifiers, CloudProducts} from 'utils/constants'; @@ -31,12 +29,10 @@ 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(); const isCloud = license?.Cloud === 'true'; const isFreeTrial = subscription?.is_free_trial === 'true'; - const noPriorTrial = !(subscription?.is_free_trial === 'false' && subscription?.trial_end_at > 0); const freeTrialEndDay = moment(subscription?.trial_end_at).format('MMMM DD'); const isAdmin = useSelector(isCurrentUserSystemAdmin); const openPricingModal = useOpenPricingModal(); @@ -48,16 +44,6 @@ const MenuCloudTrial = ({id}: Props): JSX.Element | null => { })); }; - const openLearnMoreTrialModal = async () => { - await dispatch(openModal({ - modalId: ModalIdentifiers.LEARN_MORE_TRIAL_MODAL, - dialogType: LearnMoreTrialModal, - dialogProps: { - launchedBy: 'main_menu_cloud_trial', - }, - })); - }; - const someLimitNeedsAttention = Boolean(useGetHighestThresholdCloudLimit(useGetUsage(), useGetLimits()[0])); if (!isCloud) { @@ -109,24 +95,7 @@ const MenuCloudTrial = ({id}: Props): JSX.Element | null => { ); // menu option displayed when the workspace is not running any trial - const noFreeTrialContent = (noPriorTrial && !cloudFreeDeprecated) ? ( - ( - - {msg} - - ), - } - } - /> - ) : ( + const noFreeTrialContent = ( Learn more", "menu.cloudFree.enterpriseTrialTitle": "Enterprise Trial", "menu.cloudFree.postTrial.tryEnterprise": "Interested in a limitless plan with high-security features? See plans", - "menu.cloudFree.priorTrial.tryEnterprise": "Interested in a limitless plan with high-security features? Try Enterprise free for 30 days", "message_submit_error.invalidCommand": "Command with a trigger of ''{command}'' not found. ", "message_submit_error.sendAsMessageLink": "Click here to send as a message.", "mfa.confirm.complete": "**Set up complete!**", @@ -5041,7 +5037,6 @@ "start_trial_form.modal_title": "Start Trial", "start_trial_form.name": "Name", "start_trial.modal_btn.start_free_trial": "Start free 30-day trial", - "start_trial.modal.disclaimer": "By clicking “Start free 30-day trial”, I agree to the Mattermost Software Evaluation Agreement, privacy policy and receiving product emails.", "start_trial.modal.failed": "Failed", "start_trial.modal.gettingTrial": "Getting Trial...", "start_trial.modal.loaded": "Loaded!", diff --git a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts index 3286001030..cd40097722 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts @@ -329,14 +329,6 @@ export function onboardingTourTipsEnabled(state: GlobalState): boolean { return getFeatureFlagValue(state, 'OnboardingTourTips') === 'true'; } -export function deprecateCloudFree(state: GlobalState): boolean { - return getFeatureFlagValue(state, 'DeprecateCloudFree') === 'true'; -} - -export function cloudReverseTrial(state: GlobalState): boolean { - return getFeatureFlagValue(state, 'CloudReverseTrial') === 'true'; -} - export function moveThreadsEnabled(state: GlobalState): boolean { return getFeatureFlagValue(state, 'MoveThreadsEnabled') === 'true' && getLicense(state).IsLicensed === 'true'; }