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