Skip to content

Commit 1f2eaf8

Browse files
committed
Fix bug where filters weren't shown immediately
1 parent f1176e0 commit 1f2eaf8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
### Fixed
1111
- Fixed a bug where webhooks would lose their custom payload template when enabled or disabled from the Manage Webhooks page. ([#22](https://github.com/craftcms/webhooks/issues/22))
12+
- Fixed a bug where the Edit Webhook page wouldn’t immediately show available filters if the webhook didn’t have any preselected filters.
1213

1314
## 2.2.0 - 2019-07-29
1415

src/templates/_manage/edit.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends '_layouts/cp' %}
22
{% set selectedSubnavItem = 'manage' %}
33
{% set fullPageForm = true %}
4+
{% set showFilters = allFilters|filter(f => f.show)|length != 0 %}
45

56
{% import '_includes/forms' as forms %}
67

@@ -73,8 +74,8 @@
7374

7475
{% set filtersInput %}
7576
<div class="pane" id="filter-pane">
76-
<p id="no-filters"{% if webhook.filters is not empty %} class="hidden"{% endif %}>{{ 'No filters match this event.'|t('webhooks') }}</p>
77-
<table id="filters" class="data{% if webhook.filters is empty %} hidden{% endif %}">
77+
<p id="no-filters"{% if showFilters %} class="hidden"{% endif %}>{{ 'No filters match this event.'|t('webhooks') }}</p>
78+
<table id="filters" class="data{% if not showFilters%} hidden{% endif %}">
7879
{% for filter in allFilters %}
7980
<tr data-class="{{ filter.class }}"{% if not filter.show %} class="hidden"{% endif %}>
8081
<th>{{ filter.displayName }}</th>

0 commit comments

Comments
 (0)