Move filter removal functionality to Premium
[MAILPOET-3929]
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
const MinusIcon = (
|
|
||||||
<svg viewBox="0 0 24 24">
|
|
||||||
<path d="M20 14H4V10H20V14Z" />
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
|
|
||||||
export { MinusIcon };
|
|
@@ -12,7 +12,6 @@ import { Grid } from 'common/grid';
|
|||||||
import { SubscribersCounter } from './subscribers_counter';
|
import { SubscribersCounter } from './subscribers_counter';
|
||||||
import { FormFilterFields } from './form_filter_fields';
|
import { FormFilterFields } from './form_filter_fields';
|
||||||
import { isFormValid } from './validator';
|
import { isFormValid } from './validator';
|
||||||
import { MinusIcon } from '../../common/button/icon/minus';
|
|
||||||
import plusIcon from '../../common/button/icon/plus';
|
import plusIcon from '../../common/button/icon/plus';
|
||||||
import APIErrorsNotice from '../../notices/api_errors_notice';
|
import APIErrorsNotice from '../../notices/api_errors_notice';
|
||||||
import { PrivacyProtectionNotice } from './privacy_protection_notice';
|
import { PrivacyProtectionNotice } from './privacy_protection_notice';
|
||||||
@@ -32,6 +31,7 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const FiltersBefore = Hooks.applyFilters('mailpoet_dynamic_segments_form_filters_before', (): React.FunctionComponent => null);
|
const FiltersBefore = Hooks.applyFilters('mailpoet_dynamic_segments_form_filters_before', (): React.FunctionComponent => null);
|
||||||
|
const FilterBefore = Hooks.applyFilters('mailpoet_dynamic_filters_filter_before', (): React.FunctionComponent => null);
|
||||||
const FilterAfter = Hooks.applyFilters('mailpoet_dynamic_filters_filter_after', (): JSX.Element => (
|
const FilterAfter = Hooks.applyFilters('mailpoet_dynamic_filters_filter_after', (): JSX.Element => (
|
||||||
<div className="mailpoet-gap" />
|
<div className="mailpoet-gap" />
|
||||||
));
|
));
|
||||||
@@ -122,23 +122,7 @@ export const Form: React.FunctionComponent<Props> = ({
|
|||||||
{Array.isArray(filterRows) && filterRows.map((filterRow, index) => (
|
{Array.isArray(filterRows) && filterRows.map((filterRow, index) => (
|
||||||
<React.Fragment key={filterRow.index}>
|
<React.Fragment key={filterRow.index}>
|
||||||
<Grid.ThreeColumns automationId={`filter-row-${index}`}>
|
<Grid.ThreeColumns automationId={`filter-row-${index}`}>
|
||||||
{filterRows.length > 1 && (
|
<FilterBefore filterRows={filterRows} index={index} />
|
||||||
<a
|
|
||||||
href={undefined}
|
|
||||||
className="mailpoet-form-segment-delete"
|
|
||||||
data-automation-id="delete-filter-row"
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
const filters = segment.filters;
|
|
||||||
filters.splice(index, 1);
|
|
||||||
updateSegment({
|
|
||||||
filters,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{MinusIcon}
|
|
||||||
</a>
|
|
||||||
)}
|
|
||||||
<Grid.CenteredRow>
|
<Grid.CenteredRow>
|
||||||
<Select
|
<Select
|
||||||
dimension="small"
|
dimension="small"
|
||||||
|
Reference in New Issue
Block a user