Refined members list loading with filtering feature

no refs

- resets filter columns on list when query params are removed from the url via sidebar click transition
- reloads the updated list on new bulk actions on the filtered list
This commit is contained in:
Rishabh 2021-09-10 00:13:31 +05:30
parent b678d345e3
commit d3ab0a27eb
2 changed files with 10 additions and 16 deletions

View File

@ -485,7 +485,7 @@ export default class MembersController extends Controller {
// reset and reload // reset and reload
this.store.unloadAll('member'); this.store.unloadAll('member');
this.reset(); this.reload();
this.membersStats.invalidate(); this.membersStats.invalidate();
this.membersStats.fetchCounts(); this.membersStats.fetchCounts();
@ -510,9 +510,7 @@ export default class MembersController extends Controller {
// reset and reload // reset and reload
this.store.unloadAll('member'); this.store.unloadAll('member');
this.reset(); this.reload();
this.membersStats.invalidate();
this.membersStats.fetchCounts();
return response?.bulk?.meta; return response?.bulk?.meta;
} }
@ -534,9 +532,7 @@ export default class MembersController extends Controller {
// reset and reload // reset and reload
this.store.unloadAll('member'); this.store.unloadAll('member');
this.reset(); this.reload();
this.membersStats.invalidate();
this.membersStats.fetchCounts();
return response?.bulk?.meta; return response?.bulk?.meta;
} }
@ -546,9 +542,12 @@ export default class MembersController extends Controller {
this.searchText = ''; this.searchText = '';
} }
reset() { resetFilters(params) {
this.filterParam = null; if (!params?.filterParam) {
this.filters = A([]);
this.softFilterParam = null; this.softFilterParam = null;
this.softFilters = A([]);
}
} }
reload(params) { reload(params) {

View File

@ -24,6 +24,7 @@ export default class MembersRoute extends AuthenticatedRoute {
} }
model(params) { model(params) {
this.controllerFor('members').resetFilters(params);
return this.controllerFor('members').fetchMembersTask.perform(params); return this.controllerFor('members').fetchMembersTask.perform(params);
} }
@ -46,10 +47,4 @@ export default class MembersRoute extends AuthenticatedRoute {
}; };
} }
} }
resetController(controller, isExiting) {
if (isExiting) {
controller.reset();
}
}
} }