Add feature flag for displaying trigger filters

[MAILPOET-5257]
This commit is contained in:
Jan Jakes
2023-04-21 14:47:37 +02:00
committed by Aschepikov
parent f75620a7c1
commit 8a228ed854
2 changed files with 5 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { useSelect } from '@wordpress/data';
import { storeName } from '../../../store';
import { FiltersPanel } from '../../filters';
import { StepCard } from '../../step-card';
import { MailPoet } from '../../../../../mailpoet';
function StepSidebarGeneralError(): JSX.Element {
const { errors } = useSelect(
@@ -63,7 +64,8 @@ export function StepSidebar(): JSX.Element {
key={selectedStep.id}
/>
{selectedStep.type === 'trigger' && <FiltersPanel />}
{MailPoet.FeaturesController.isSupported('automation_filters') &&
selectedStep.type === 'trigger' && <FiltersPanel />}
</div>
);
}

View File

@@ -7,12 +7,14 @@ use MailPoetVendor\Doctrine\DBAL\Exception\TableNotFoundException;
class FeaturesController {
const LANDINGPAGE_AB_TEST_DEBUGGER = 'landingpage_ab_test_debugger';
const FEATURE_BRAND_TEMPLATES = 'brand_templates';
const AUTOMATION_FILTERS = 'automation_filters';
// Define feature defaults in the array below in the following form:
// self::FEATURE_NAME_OF_FEATURE => true,
private $defaults = [
self::LANDINGPAGE_AB_TEST_DEBUGGER => false,
self::FEATURE_BRAND_TEMPLATES => false,
self::AUTOMATION_FILTERS => false,
];
/** @var array|null */