Remove re-engagement-email feature flag

[MAILPOET-3859]
This commit is contained in:
Rodrigo Primo
2021-11-17 15:03:37 -03:00
committed by Veljko V
parent 28061a8c8b
commit 84209851e2
7 changed files with 18 additions and 51 deletions

View File

@@ -42,7 +42,6 @@ const trackTabSwitch = (tabKey) => MailPoet.trackEvent(`Tab Emails > ${tabKey} c
const Tabs = withNpsPoll(() => {
const { parentId } = useParams();
const { features } = React.useContext(GlobalContext);
return (
<>
<ListingHeadingDisplay>
@@ -83,16 +82,14 @@ const Tabs = withNpsPoll(() => {
: <NewsletterListNotification />
}
</Tab>
{(features.isSupported('re-engagement-email')) && (
<Tab
key="re_engagement"
route="re_engagement/(.*)?"
title={MailPoet.I18n.t('tabReEngagementTitle')}
automationId={`tab-${MailPoet.I18n.t('tabReEngagementTitle')}`}
>
<NewsletterListReEngagement />
</Tab>
)}
<Tab
key="re_engagement"
route="re_engagement/(.*)?"
title={MailPoet.I18n.t('tabReEngagementTitle')}
automationId={`tab-${MailPoet.I18n.t('tabReEngagementTitle')}`}
>
<NewsletterListReEngagement />
</Tab>
{window.mailpoet_woocommerce_active && _.map(automaticEmails, (email) => (
<Tab
key={email.slug}

View File

@@ -34,6 +34,10 @@ templatesCategories.push(
name: 'notification',
label: MailPoet.I18n.t('tabNotificationTitle'),
},
{
name: 're_engagement',
label: MailPoet.I18n.t('tabReEngagementTitle'),
},
{
name: 'blank',
label: MailPoet.I18n.t('tabBlankTitle'),
@@ -75,8 +79,6 @@ class NewsletterTemplates extends React.Component {
}
componentDidMount() {
this.addReEngagementCategory();
MailPoet.Ajax.get({
api_version: window.mailpoet_api_version,
endpoint: 'newsletterTemplates',
@@ -106,21 +108,6 @@ class NewsletterTemplates extends React.Component {
});
}
// We want temporarily to allow re-engagement emails only when the feature is active
addReEngagementCategory() {
if (this.context.features.isSupported('re-engagement-email')) {
const notificationIndex = templatesCategories.map((category) => category.name).indexOf('notification');
const categoriesTmp = templatesCategories.splice(notificationIndex + 1);
templatesCategories.push(
{
name: 're_engagement',
label: MailPoet.I18n.t('tabReEngagementTitle'),
},
...categoriesTmp
);
}
}
addTemplate(template) {
const categoriesNames = templatesCategories.map((category) => category.name);
let categories;

View File

@@ -11,7 +11,6 @@ import Heading from 'common/typography/heading/heading';
import ModalCloseIcon from 'common/modal/close_icon';
import HideScreenOptions from 'common/hide_screen_options/hide_screen_options';
import APIErrorsNotice from '../notices/api_errors_notice';
import { GlobalContext } from '../context';
interface Props {
filter?: () => void;
@@ -36,9 +35,6 @@ const NewsletterTypes: React.FunctionComponent<Props> = ({
hideScreenOptions = true,
}: Props) => {
const [isCreating, setIsCreating] = useState(false);
// this is here temporarily and the global context isn't in typescript yet
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const { features } = React.useContext<any>(GlobalContext);
const setupNewsletter = (type): void => {
if (type !== undefined) {
@@ -267,9 +263,7 @@ const NewsletterTypes: React.FunctionComponent<Props> = ({
</Button>
),
},
];
if (features.isSupported('re-engagement-email')) {
defaultTypes.push({
{
slug: 're_engagement',
title: MailPoet.I18n.t('tabReEngagementTitle'),
description: MailPoet.I18n.t('reEngagementDescription'),
@@ -290,8 +284,8 @@ const NewsletterTypes: React.FunctionComponent<Props> = ({
{MailPoet.I18n.t('setUp')}
</Button>
),
});
}
},
];
let types = Hooks.applyFilters('mailpoet_newsletters_types', [
...defaultTypes,

View File

@@ -4,12 +4,9 @@ import { t } from 'common/functions';
import Radio from 'common/form/radio/radio';
import { useSetting } from 'settings/store/hooks';
import { Label, Inputs } from 'settings/components';
import { GlobalContext } from 'context/index.jsx';
export default function Tracking() {
const [enabled, setEnabled] = useSetting('tracking', 'enabled');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const { features } = React.useContext<any>(GlobalContext);
return (
<>
@@ -39,7 +36,7 @@ export default function Tracking() {
/>
<label htmlFor="tracking-disabled">
{t('no')}
{features.isSupported('re-engagement-email') && !enabled && (
{!enabled && (
<>
<br />
<span className="mailpoet-note">

View File

@@ -83,9 +83,7 @@ class Daemon {
yield $this->workersFactory->createSubscribersEngagementScoreWorker();
yield $this->workersFactory->createSubscribersLastEngagementWorker();
yield $this->workersFactory->createSubscribersCountCacheRecalculationWorker();
if ($this->featureSwitch->isSupported(FeaturesController::RE_ENGAGEMENT_EMAIL)) {
yield $this->workersFactory->createReEngagementEmailsSchedulerWorker();
}
yield $this->workersFactory->createReEngagementEmailsSchedulerWorker();
yield $this->workersFactory->createNewsletterTemplateThumbnailsWorker();
}
}

View File

@@ -5,13 +5,10 @@ namespace MailPoet\Features;
use MailPoetVendor\Doctrine\DBAL\Exception\TableNotFoundException;
class FeaturesController {
const RE_ENGAGEMENT_EMAIL = 're-engagement-email';
// Define feature defaults in the array below in the following form:
// self::FEATURE_NAME_OF_FEATURE => true,
private $defaults = [
self::RE_ENGAGEMENT_EMAIL => false,
];
private $defaults = [];
/** @var array */
private $flags;

View File

@@ -3,7 +3,6 @@
namespace MailPoet\Test\Acceptance;
use Codeception\Util\Locator;
use MailPoet\Test\DataFactories\Features;
class AdvancedSettingsCest {
public function toggleAnonymousDataSetting(\AcceptanceTester $i) {
@@ -135,8 +134,6 @@ class AdvancedSettingsCest {
}
public function checkInactiveSubscribersAndEmails(\AcceptanceTester $i) {
$features = new Features();
$features->withFeatureEnabled('re-engagement-email');
$i->wantTo('Check that inactive subscribers has default value');
$inactiveSubscribersDefault = '[data-automation-id="inactive-subscribers-default"]';
$trackingEnabled = '[data-automation-id="tracking-enabled-radio"]';