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 AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
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 RSVP from 'rsvp';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
import styleBody from 'ghost-admin/mixins/style-body';
|
||||||
|
|
||||||
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, PaginationMixin, {
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, InfinityRoute, {
|
||||||
titleToken: 'Team',
|
titleToken: 'Team',
|
||||||
|
|
||||||
classNames: ['view-team'],
|
classNames: ['view-team'],
|
||||||
|
|
||||||
paginationModel: 'user',
|
modelPath: 'controller.activeUsers',
|
||||||
paginationSettings: {
|
perPage: 15,
|
||||||
filter: 'status:-inactive',
|
perPageParam: 'limit',
|
||||||
limit: 20
|
totalPagesParam: 'meta.pagination.pages',
|
||||||
},
|
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return this.get('session.user').then((user) => {
|
return this.get('session.user').then((user) => {
|
||||||
|
let modelPath = this.get('modelPath');
|
||||||
|
let perPage = this.get('perPage');
|
||||||
|
|
||||||
let modelPromises = {
|
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
|
// authors do not have permission to hit the invites or suspended users endpoint
|
||||||
|
|
|
@ -15,12 +15,7 @@
|
||||||
modifier="action wide"}}
|
modifier="action wide"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#gh-infinite-scroll
|
<section class="gh-team">
|
||||||
fetch="loadNextPage"
|
|
||||||
isLoading=isLoading
|
|
||||||
tagName="section"
|
|
||||||
classNames="gh-team"
|
|
||||||
}}
|
|
||||||
|
|
||||||
{{!-- Show invited users to everyone except authors --}}
|
{{!-- Show invited users to everyone except authors --}}
|
||||||
{{#unless session.user.isAuthor}}
|
{{#unless session.user.isAuthor}}
|
||||||
|
@ -97,7 +92,12 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</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 --}}
|
{{!-- Don't show if we have no suspended users or logged in as an author --}}
|
||||||
{{#if (and suspendedUsers (not session.user.isAuthor))}}
|
{{#if (and suspendedUsers (not session.user.isAuthor))}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue