Remove multichannel integration from experimental features

MAILPOET-5701
This commit is contained in:
Oluwaseun Olorunsola
2023-12-05 13:30:49 +01:00
committed by Aschepikov
parent 94d399f169
commit ddde17f83a
4 changed files with 1 additions and 21 deletions

View File

@@ -7,14 +7,12 @@ use MailPoetVendor\Doctrine\DBAL\Exception\TableNotFoundException;
class FeaturesController {
const FEATURE_BRAND_TEMPLATES = 'brand_templates';
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:
// self::FEATURE_NAME_OF_FEATURE => true,
private $defaults = [
self::FEATURE_BRAND_TEMPLATES => false,
self::GUTENBERG_EMAIL_EDITOR => false,
self::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION => false,
];
/** @var array|null */

View File

@@ -2,31 +2,20 @@
namespace MailPoet\WooCommerce\MultichannelMarketing;
use MailPoet\Features\FeaturesController;
class MPMarketingChannelController {
/** @var FeaturesController */
private $featuresController;
/**
* @var MPMarketingChannelDataController
*/
private $channelDataController;
public function __construct(
FeaturesController $featuresController,
MPMarketingChannelDataController $channelDataController
) {
$this->featuresController = $featuresController;
$this->channelDataController = $channelDataController;
}
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, [
new MPMarketingChannel(
$this->channelDataController

View File

@@ -141,6 +141,7 @@ class MPMarketingChannelDataController {
public function getStandardNewsletterList($campaignType): array {
return $this->getNewsletterTypeLists(
// fetch the most recently sent post-notification history newsletters limited to ten
$this->newsletterRepository->getStandardNewsletterListWithMultipleStatuses(10),
$campaignType
);

View File

@@ -2,9 +2,7 @@
namespace MailPoet\Test\Acceptance;
use MailPoet\Features\FeaturesController;
use MailPoet\Mailer\Mailer;
use MailPoet\Test\DataFactories\Features;
use MailPoet\Test\DataFactories\Newsletter;
use MailPoet\Test\DataFactories\Settings;
@@ -26,7 +24,6 @@ class MPMarketingChannelCest {
public function itShowsMailPoetSetup(\AcceptanceTester $i) {
$this->settingsFactory->withWelcomeWizard();
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
$i->login();
$i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing');
@@ -40,7 +37,6 @@ class MPMarketingChannelCest {
public function itShowsErrorCount(\AcceptanceTester $i) {
(new Newsletter())->create();
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
$i->login();
@@ -57,7 +53,6 @@ class MPMarketingChannelCest {
public function itShowsMailPoetSyncStatus(\AcceptanceTester $i) {
(new Newsletter())->create();
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
$i->login();
@@ -71,7 +66,6 @@ class MPMarketingChannelCest {
public function itShowsMailPoetSyncStatusWithErrorCount(\AcceptanceTester $i) {
(new Newsletter())->create();
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
$i->login();
@@ -86,8 +80,6 @@ class MPMarketingChannelCest {
}
public function itCanCreateMailPoetCampaigns(\AcceptanceTester $i) {
(new Features())->withFeatureEnabled(FeaturesController::MAILPOET_WOOCOMMERCE_MULTICHANNEL_INTEGRATION);
$i->login();
$i->amOnPage('/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing');