Remove homepage feature switch
[MAILPOET-4831]
This commit is contained in:
committed by
Aschepikov
parent
96760cc7e4
commit
0f01755e18
@ -23,7 +23,6 @@ use MailPoet\AdminPages\Pages\Upgrade;
|
|||||||
use MailPoet\AdminPages\Pages\WelcomeWizard;
|
use MailPoet\AdminPages\Pages\WelcomeWizard;
|
||||||
use MailPoet\AdminPages\Pages\WooCommerceSetup;
|
use MailPoet\AdminPages\Pages\WooCommerceSetup;
|
||||||
use MailPoet\DI\ContainerWrapper;
|
use MailPoet\DI\ContainerWrapper;
|
||||||
use MailPoet\Features\FeaturesController;
|
|
||||||
use MailPoet\Form\Util\CustomFonts;
|
use MailPoet\Form\Util\CustomFonts;
|
||||||
use MailPoet\Util\License\License;
|
use MailPoet\Util\License\License;
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
@ -78,9 +77,6 @@ class Menu {
|
|||||||
/** @var CustomFonts */
|
/** @var CustomFonts */
|
||||||
private $customFonts;
|
private $customFonts;
|
||||||
|
|
||||||
/** @var FeaturesController */
|
|
||||||
private $featuresController;
|
|
||||||
|
|
||||||
/** @var Changelog */
|
/** @var Changelog */
|
||||||
private $changelog;
|
private $changelog;
|
||||||
|
|
||||||
@ -91,7 +87,6 @@ class Menu {
|
|||||||
ContainerWrapper $container,
|
ContainerWrapper $container,
|
||||||
Router $router,
|
Router $router,
|
||||||
CustomFonts $customFonts,
|
CustomFonts $customFonts,
|
||||||
FeaturesController $featuresController,
|
|
||||||
Changelog $changelog
|
Changelog $changelog
|
||||||
) {
|
) {
|
||||||
$this->accessControl = $accessControl;
|
$this->accessControl = $accessControl;
|
||||||
@ -100,14 +95,11 @@ class Menu {
|
|||||||
$this->container = $container;
|
$this->container = $container;
|
||||||
$this->router = $router;
|
$this->router = $router;
|
||||||
$this->customFonts = $customFonts;
|
$this->customFonts = $customFonts;
|
||||||
$this->featuresController = $featuresController;
|
|
||||||
$this->changelog = $changelog;
|
$this->changelog = $changelog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init() {
|
public function init() {
|
||||||
if ($this->featuresController->isSupported(FeaturesController::FEATURE_HOMEPAGE)) {
|
self::$mainPageSlug = self::HOMEPAGE_PAGE_SLUG;
|
||||||
self::$mainPageSlug = self::HOMEPAGE_PAGE_SLUG;
|
|
||||||
}
|
|
||||||
$this->checkPremiumKey();
|
$this->checkPremiumKey();
|
||||||
|
|
||||||
$this->wp->addAction(
|
$this->wp->addAction(
|
||||||
@ -223,19 +215,17 @@ class Menu {
|
|||||||
|
|
||||||
private function registerMailPoetSubMenuEntries(bool $showEntries) {
|
private function registerMailPoetSubMenuEntries(bool $showEntries) {
|
||||||
// Homepage
|
// Homepage
|
||||||
if ($this->featuresController->isSupported(FeaturesController::FEATURE_HOMEPAGE)) {
|
$this->wp->addSubmenuPage(
|
||||||
$this->wp->addSubmenuPage(
|
$showEntries ? self::$mainPageSlug : true,
|
||||||
$showEntries ? self::$mainPageSlug : true,
|
$this->setPageTitle(__('Home', 'mailpoet')),
|
||||||
$this->setPageTitle(__('Home', 'mailpoet')),
|
esc_html__('Home', 'mailpoet'),
|
||||||
esc_html__('Home', 'mailpoet'),
|
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
||||||
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
|
self::HOMEPAGE_PAGE_SLUG,
|
||||||
self::HOMEPAGE_PAGE_SLUG,
|
[
|
||||||
[
|
$this,
|
||||||
$this,
|
'homepage',
|
||||||
'homepage',
|
]
|
||||||
]
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Emails page
|
// Emails page
|
||||||
$newslettersPage = $this->wp->addSubmenuPage(
|
$newslettersPage = $this->wp->addSubmenuPage(
|
||||||
|
@ -5,13 +5,11 @@ namespace MailPoet\Features;
|
|||||||
use MailPoetVendor\Doctrine\DBAL\Exception\TableNotFoundException;
|
use MailPoetVendor\Doctrine\DBAL\Exception\TableNotFoundException;
|
||||||
|
|
||||||
class FeaturesController {
|
class FeaturesController {
|
||||||
const FEATURE_HOMEPAGE = 'homepage';
|
|
||||||
const LANDINGPAGE_AB_TEST_DEBUGGER = 'landingpage_ab_test_debugger';
|
const LANDINGPAGE_AB_TEST_DEBUGGER = 'landingpage_ab_test_debugger';
|
||||||
|
|
||||||
// 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_HOMEPAGE => false,
|
|
||||||
self::LANDINGPAGE_AB_TEST_DEBUGGER => false,
|
self::LANDINGPAGE_AB_TEST_DEBUGGER => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -3,17 +3,11 @@
|
|||||||
namespace MailPoet\Test\Acceptance;
|
namespace MailPoet\Test\Acceptance;
|
||||||
|
|
||||||
use MailPoet\Entities\SubscriberEntity;
|
use MailPoet\Entities\SubscriberEntity;
|
||||||
use MailPoet\Features\FeaturesController;
|
|
||||||
use MailPoet\Test\DataFactories\Features;
|
|
||||||
use MailPoet\Test\DataFactories\Segment;
|
use MailPoet\Test\DataFactories\Segment;
|
||||||
use MailPoet\Test\DataFactories\Settings;
|
use MailPoet\Test\DataFactories\Settings;
|
||||||
use MailPoet\Test\DataFactories\Subscriber;
|
use MailPoet\Test\DataFactories\Subscriber;
|
||||||
|
|
||||||
class HomepageBasicsCest {
|
class HomepageBasicsCest {
|
||||||
public function _before() {
|
|
||||||
(new Features())->withFeatureEnabled(FeaturesController::FEATURE_HOMEPAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function homepageRenders(\AcceptanceTester $i) {
|
public function homepageRenders(\AcceptanceTester $i) {
|
||||||
$i->wantTo('Check homepage renders and is present in menu');
|
$i->wantTo('Check homepage renders and is present in menu');
|
||||||
$i->login();
|
$i->login();
|
||||||
|
Reference in New Issue
Block a user