mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Wired reset filters filter button in filter builder
closes https://github.com/TryGhost/Team/issues/964 Wires the "Reset" button in filter builder to clear all filters easily and see the original full list of members.
This commit is contained in:
parent
f23e8bc801
commit
084380d155
4 changed files with 14 additions and 9 deletions
|
@ -75,6 +75,7 @@
|
||||||
<div class="gh-filter-builder-footer">
|
<div class="gh-filter-builder-footer">
|
||||||
<button
|
<button
|
||||||
class="gh-btn"
|
class="gh-btn"
|
||||||
|
{{on "click" this.resetFilter}}
|
||||||
>
|
>
|
||||||
<span>Reset all</span>
|
<span>Reset all</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -190,4 +190,9 @@ export default class GhMembersFilterLabsComponent extends Component {
|
||||||
const query = this.generateNqlFilter(this.filters);
|
const query = this.generateNqlFilter(this.filters);
|
||||||
this.args.onApplyFilter(query, this.filters);
|
this.args.onApplyFilter(query, this.filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
resetFilter() {
|
||||||
|
this.args.onResetFilter();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,16 +216,14 @@ export default class MembersController extends Controller {
|
||||||
|
|
||||||
@action
|
@action
|
||||||
applyFilter(filterStr, filters) {
|
applyFilter(filterStr, filters) {
|
||||||
this.filters = filters.filter((filter) => {
|
this.filters = filters;
|
||||||
return filter.type !== 'name_email';
|
|
||||||
});
|
|
||||||
this.filterParam = filterStr || null;
|
this.filterParam = filterStr || null;
|
||||||
this.searchParam = null;
|
}
|
||||||
filters.forEach((filter) => {
|
|
||||||
if (filter.type === 'name_email' && filter.value) {
|
@action
|
||||||
this.searchParam = filter.value;
|
resetFilter() {
|
||||||
}
|
this.filters = A([]);
|
||||||
});
|
this.filterParam = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
{{#if (feature "membersFiltering")}}
|
{{#if (feature "membersFiltering")}}
|
||||||
<GhMembersFilterLabs
|
<GhMembersFilterLabs
|
||||||
@onApplyFilter={{this.applyFilter}}
|
@onApplyFilter={{this.applyFilter}}
|
||||||
|
@onResetFilter={{this.resetFilter}}
|
||||||
@onLabelEdit={{this.editLabel}}
|
@onLabelEdit={{this.editLabel}}
|
||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue