mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 08:25:06 +03:00
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:
parent
b678d345e3
commit
d3ab0a27eb
@ -485,7 +485,7 @@ export default class MembersController extends Controller {
|
||||
|
||||
// reset and reload
|
||||
this.store.unloadAll('member');
|
||||
this.reset();
|
||||
this.reload();
|
||||
|
||||
this.membersStats.invalidate();
|
||||
this.membersStats.fetchCounts();
|
||||
@ -510,9 +510,7 @@ export default class MembersController extends Controller {
|
||||
|
||||
// reset and reload
|
||||
this.store.unloadAll('member');
|
||||
this.reset();
|
||||
this.membersStats.invalidate();
|
||||
this.membersStats.fetchCounts();
|
||||
this.reload();
|
||||
|
||||
return response?.bulk?.meta;
|
||||
}
|
||||
@ -534,9 +532,7 @@ export default class MembersController extends Controller {
|
||||
|
||||
// reset and reload
|
||||
this.store.unloadAll('member');
|
||||
this.reset();
|
||||
this.membersStats.invalidate();
|
||||
this.membersStats.fetchCounts();
|
||||
this.reload();
|
||||
|
||||
return response?.bulk?.meta;
|
||||
}
|
||||
@ -546,9 +542,12 @@ export default class MembersController extends Controller {
|
||||
this.searchText = '';
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.filterParam = null;
|
||||
this.softFilterParam = null;
|
||||
resetFilters(params) {
|
||||
if (!params?.filterParam) {
|
||||
this.filters = A([]);
|
||||
this.softFilterParam = null;
|
||||
this.softFilters = A([]);
|
||||
}
|
||||
}
|
||||
|
||||
reload(params) {
|
||||
|
@ -24,6 +24,7 @@ export default class MembersRoute extends AuthenticatedRoute {
|
||||
}
|
||||
|
||||
model(params) {
|
||||
this.controllerFor('members').resetFilters(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user