Remove multichannel integration from experimental features
MAILPOET-5701
This commit is contained in:
committed by
Aschepikov
parent
94d399f169
commit
ddde17f83a
@ -7,14 +7,12 @@ use MailPoetVendor\Doctrine\DBAL\Exception\TableNotFoundException;
|
|||||||
class FeaturesController {
|
class FeaturesController {
|
||||||
const FEATURE_BRAND_TEMPLATES = 'brand_templates';
|
const FEATURE_BRAND_TEMPLATES = 'brand_templates';
|
||||||
const GUTENBERG_EMAIL_EDITOR = 'gutenberg_email_editor';
|
const GUTENBERG_EMAIL_EDITOR = 'gutenberg_email_editor';
|
||||||
const MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION = 'mailpoet_woocommerce_multichannel_integration';
|
|
||||||
|
|
||||||
// Define feature defaults in the array below in the following form:
|
// Define feature defaults in the array below in the following form:
|
||||||
// self::FEATURE_NAME_OF_FEATURE => true,
|
// self::FEATURE_NAME_OF_FEATURE => true,
|
||||||
private $defaults = [
|
private $defaults = [
|
||||||
self::FEATURE_BRAND_TEMPLATES => false,
|
self::FEATURE_BRAND_TEMPLATES => false,
|
||||||
self::GUTENBERG_EMAIL_EDITOR => false,
|
self::GUTENBERG_EMAIL_EDITOR => false,
|
||||||
self::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION => false,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var array|null */
|
/** @var array|null */
|
||||||
|
@ -2,31 +2,20 @@
|
|||||||
|
|
||||||
namespace MailPoet\WooCommerce\MultichannelMarketing;
|
namespace MailPoet\WooCommerce\MultichannelMarketing;
|
||||||
|
|
||||||
use MailPoet\Features\FeaturesController;
|
|
||||||
|
|
||||||
class MPMarketingChannelController {
|
class MPMarketingChannelController {
|
||||||
|
|
||||||
/** @var FeaturesController */
|
|
||||||
private $featuresController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var MPMarketingChannelDataController
|
* @var MPMarketingChannelDataController
|
||||||
*/
|
*/
|
||||||
private $channelDataController;
|
private $channelDataController;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
FeaturesController $featuresController,
|
|
||||||
MPMarketingChannelDataController $channelDataController
|
MPMarketingChannelDataController $channelDataController
|
||||||
) {
|
) {
|
||||||
$this->featuresController = $featuresController;
|
|
||||||
$this->channelDataController = $channelDataController;
|
$this->channelDataController = $channelDataController;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerMarketingChannel($registeredMarketingChannels): array {
|
public function registerMarketingChannel($registeredMarketingChannels): array {
|
||||||
if (!$this->featuresController->isSupported(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION)) {
|
|
||||||
return $registeredMarketingChannels; // Do not register the marketing channel if the feature flag is not enabled
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_merge($registeredMarketingChannels, [
|
return array_merge($registeredMarketingChannels, [
|
||||||
new MPMarketingChannel(
|
new MPMarketingChannel(
|
||||||
$this->channelDataController
|
$this->channelDataController
|
||||||
|
@ -141,6 +141,7 @@ class MPMarketingChannelDataController {
|
|||||||
|
|
||||||
public function getStandardNewsletterList($campaignType): array {
|
public function getStandardNewsletterList($campaignType): array {
|
||||||
return $this->getNewsletterTypeLists(
|
return $this->getNewsletterTypeLists(
|
||||||
|
// fetch the most recently sent post-notification history newsletters limited to ten
|
||||||
$this->newsletterRepository->getStandardNewsletterListWithMultipleStatuses(10),
|
$this->newsletterRepository->getStandardNewsletterListWithMultipleStatuses(10),
|
||||||
$campaignType
|
$campaignType
|
||||||
);
|
);
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
namespace MailPoet\Test\Acceptance;
|
namespace MailPoet\Test\Acceptance;
|
||||||
|
|
||||||
use MailPoet\Features\FeaturesController;
|
|
||||||
use MailPoet\Mailer\Mailer;
|
use MailPoet\Mailer\Mailer;
|
||||||
use MailPoet\Test\DataFactories\Features;
|
|
||||||
use MailPoet\Test\DataFactories\Newsletter;
|
use MailPoet\Test\DataFactories\Newsletter;
|
||||||
use MailPoet\Test\DataFactories\Settings;
|
use MailPoet\Test\DataFactories\Settings;
|
||||||
|
|
||||||
@ -26,7 +24,6 @@ class MPMarketingChannelCest {
|
|||||||
|
|
||||||
public function itShowsMailPoetSetup(\AcceptanceTester $i) {
|
public function itShowsMailPoetSetup(\AcceptanceTester $i) {
|
||||||
$this->settingsFactory->withWelcomeWizard();
|
$this->settingsFactory->withWelcomeWizard();
|
||||||
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
|
|
||||||
|
|
||||||
$i->login();
|
$i->login();
|
||||||
$i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing');
|
$i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing');
|
||||||
@ -40,7 +37,6 @@ class MPMarketingChannelCest {
|
|||||||
|
|
||||||
public function itShowsErrorCount(\AcceptanceTester $i) {
|
public function itShowsErrorCount(\AcceptanceTester $i) {
|
||||||
(new Newsletter())->create();
|
(new Newsletter())->create();
|
||||||
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
|
|
||||||
|
|
||||||
$i->login();
|
$i->login();
|
||||||
|
|
||||||
@ -57,7 +53,6 @@ class MPMarketingChannelCest {
|
|||||||
|
|
||||||
public function itShowsMailPoetSyncStatus(\AcceptanceTester $i) {
|
public function itShowsMailPoetSyncStatus(\AcceptanceTester $i) {
|
||||||
(new Newsletter())->create();
|
(new Newsletter())->create();
|
||||||
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
|
|
||||||
|
|
||||||
$i->login();
|
$i->login();
|
||||||
|
|
||||||
@ -71,7 +66,6 @@ class MPMarketingChannelCest {
|
|||||||
|
|
||||||
public function itShowsMailPoetSyncStatusWithErrorCount(\AcceptanceTester $i) {
|
public function itShowsMailPoetSyncStatusWithErrorCount(\AcceptanceTester $i) {
|
||||||
(new Newsletter())->create();
|
(new Newsletter())->create();
|
||||||
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
|
|
||||||
|
|
||||||
$i->login();
|
$i->login();
|
||||||
|
|
||||||
@ -86,8 +80,6 @@ class MPMarketingChannelCest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function itCanCreateMailPoetCampaigns(\AcceptanceTester $i) {
|
public function itCanCreateMailPoetCampaigns(\AcceptanceTester $i) {
|
||||||
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
|
|
||||||
|
|
||||||
$i->login();
|
$i->login();
|
||||||
|
|
||||||
$i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing');
|
$i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing');
|
||||||
|
Reference in New Issue
Block a user