mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 fixed active users list not showing more than 20 users (#806)
closes https://github.com/TryGhost/Ghost/issues/8773 - swap old custom `PaginationMixin` for `ember-infinity`
This commit is contained in:
parent
86759067ea
commit
68d2164672
2 changed files with 22 additions and 15 deletions
|
@ -1,24 +1,31 @@
|
|||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
||||
import PaginationMixin from 'ghost-admin/mixins/pagination';
|
||||
import InfinityRoute from 'ember-infinity/mixins/route';
|
||||
import RSVP from 'rsvp';
|
||||
import styleBody from 'ghost-admin/mixins/style-body';
|
||||
|
||||
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, PaginationMixin, {
|
||||
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, InfinityRoute, {
|
||||
titleToken: 'Team',
|
||||
|
||||
classNames: ['view-team'],
|
||||
|
||||
paginationModel: 'user',
|
||||
paginationSettings: {
|
||||
filter: 'status:-inactive',
|
||||
limit: 20
|
||||
},
|
||||
modelPath: 'controller.activeUsers',
|
||||
perPage: 15,
|
||||
perPageParam: 'limit',
|
||||
totalPagesParam: 'meta.pagination.pages',
|
||||
|
||||
model() {
|
||||
return this.get('session.user').then((user) => {
|
||||
let modelPath = this.get('modelPath');
|
||||
let perPage = this.get('perPage');
|
||||
|
||||
let modelPromises = {
|
||||
activeUsers: this.loadFirstPage()
|
||||
activeUsers: this.infinityModel('user', {
|
||||
modelPath,
|
||||
perPage,
|
||||
filter: 'status:-inactive',
|
||||
startingPage: 1
|
||||
})
|
||||
};
|
||||
|
||||
// authors do not have permission to hit the invites or suspended users endpoint
|
||||
|
|
|
@ -15,12 +15,7 @@
|
|||
modifier="action wide"}}
|
||||
{{/if}}
|
||||
|
||||
{{#gh-infinite-scroll
|
||||
fetch="loadNextPage"
|
||||
isLoading=isLoading
|
||||
tagName="section"
|
||||
classNames="gh-team"
|
||||
}}
|
||||
<section class="gh-team">
|
||||
|
||||
{{!-- Show invited users to everyone except authors --}}
|
||||
{{#unless session.user.isAuthor}}
|
||||
|
@ -97,7 +92,12 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
{{/gh-infinite-scroll}}
|
||||
{{infinity-loader
|
||||
infinityModel=activeUsers
|
||||
scrollable=".gh-main"
|
||||
triggerOffset=500}}
|
||||
|
||||
</section>
|
||||
|
||||
{{!-- Don't show if we have no suspended users or logged in as an author --}}
|
||||
{{#if (and suspendedUsers (not session.user.isAuthor))}}
|
||||
|
|
Loading…
Add table
Reference in a new issue