🐛 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:
Kevin Ansfield 2017-07-31 17:10:52 +04:00 committed by GitHub
parent 9b8362634b
commit 91ac2dee40
2 changed files with 22 additions and 15 deletions

View File

@ -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

View File

@ -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))}}