mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03: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
@ -75,6 +75,7 @@
|
||||
<div class="gh-filter-builder-footer">
|
||||
<button
|
||||
class="gh-btn"
|
||||
{{on "click" this.resetFilter}}
|
||||
>
|
||||
<span>Reset all</span>
|
||||
</button>
|
||||
|
@ -190,4 +190,9 @@ export default class GhMembersFilterLabsComponent extends Component {
|
||||
const query = this.generateNqlFilter(this.filters);
|
||||
this.args.onApplyFilter(query, this.filters);
|
||||
}
|
||||
|
||||
@action
|
||||
resetFilter() {
|
||||
this.args.onResetFilter();
|
||||
}
|
||||
}
|
||||
|
@ -216,16 +216,14 @@ export default class MembersController extends Controller {
|
||||
|
||||
@action
|
||||
applyFilter(filterStr, filters) {
|
||||
this.filters = filters.filter((filter) => {
|
||||
return filter.type !== 'name_email';
|
||||
});
|
||||
this.filters = filters;
|
||||
this.filterParam = filterStr || null;
|
||||
this.searchParam = null;
|
||||
filters.forEach((filter) => {
|
||||
if (filter.type === 'name_email' && filter.value) {
|
||||
this.searchParam = filter.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
resetFilter() {
|
||||
this.filters = A([]);
|
||||
this.filterParam = null;
|
||||
}
|
||||
|
||||
@action
|
||||
|
@ -32,6 +32,7 @@
|
||||
{{#if (feature "membersFiltering")}}
|
||||
<GhMembersFilterLabs
|
||||
@onApplyFilter={{this.applyFilter}}
|
||||
@onResetFilter={{this.resetFilter}}
|
||||
@onLabelEdit={{this.editLabel}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
Loading…
Reference in New Issue
Block a user