Skip to content

Commit f432027

Browse files
fix: feed filter condition
1 parent 493daae commit f432027

4 files changed

Lines changed: 7 additions & 19 deletions

File tree

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,6 @@ function closeModal(e) {
486486
if (e.key === "Escape") closeModal();
487487
});
488488

489-
jQuery('.fz-conditions').on('click', '.fz-action-btn.is-upsell', function (event) {
490-
openModal('#feedzy-add-filter-condition');
491-
event.preventDefault();
492-
});
493489
});
494490
</script>
495491
<div id="feedzy-add-new-import" class="wp-core-ui feedzy-modal" style="display:none;">

includes/util/feedzy-rss-feeds-conditions.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,6 @@ public function is_condition_met( $condition, $value ): bool {
247247
* @return bool True if the conditions are met, false otherwise.
248248
*/
249249
public function evaluate_conditions( $default_value, $attrs, $item, $feed_url, $index ): bool {
250-
if ( feedzy_is_new() && ! feedzy_is_pro() ) {
251-
return $default_value;
252-
}
253-
254250
if ( ! isset( $attrs['filters'] ) || empty( $attrs['filters'] ) ) {
255251
return $default_value;
256252
}

js/Conditions/ConditionsControl.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ const ConditionsControl = ({ conditions, setConditions }) => {
7272
});
7373
};
7474

75+
const el = document.querySelector('.editor-sidebar__panel-tabs');
7576
const addCondition = () => {
7677
if (!isPro && 1 <= conditions.conditions.length) {
7778
// the Inspector panel use sticky position with their own stacking context,
7879
// which causes them to appear above our popup overlay. We set their z-index to 0 so the popup covers them.
79-
document.querySelector('.editor-sidebar__panel-tabs').style.zIndex = 0;
80+
if (el) {
81+
el.style.zIndex = 0;
82+
}
8083
setModelOpen(true);
8184
return;
8285
}
@@ -132,7 +135,9 @@ const ConditionsControl = ({ conditions, setConditions }) => {
132135
};
133136

134137
const closeModal = () => {
135-
document.querySelector('.editor-sidebar__panel-tabs').style.zIndex = 1;
138+
if (el) {
139+
el.style.zIndex = 0;
140+
}
136141
setModelOpen(false)
137142
}
138143

js/Conditions/index.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ const App = () => {
2828
});
2929

3030
useEffect(() => {
31-
if (!feedzyData.isPro) {
32-
setConditions(dummyConditions);
33-
return;
34-
}
35-
3631
const field = document.getElementById('feed-post-filters-conditions');
3732
if (field && field.value) {
3833
const parsedConditions = JSON.parse(field.value);
@@ -45,10 +40,6 @@ const App = () => {
4540
}, []);
4641

4742
useEffect(() => {
48-
if (!feedzyData.isPro) {
49-
return;
50-
}
51-
5243
document.getElementById('feed-post-filters-conditions').value =
5344
JSON.stringify(conditions);
5445
}, [conditions]);

0 commit comments

Comments
 (0)