mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
a7f4610381
no issue `ember-light-table` is falling behind Ember.js and other addon development and is increasingly causing issues with Ember deprecations and addon incompatibility. - swaps `ember-light-table` usage for a straightforward table using `vertical-collection` for occlusion - uses the same loading mechanism as the members screen with a slight optimisation where the initial load will fetch subscribers in batches of 200 until they are all loaded - removes now-unused pagination mixin - fixes duplicate subscriber validation handling
32 lines
868 B
JavaScript
32 lines
868 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import RSVP from 'rsvp';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default AuthenticatedRoute.extend({
|
|
feature: service(),
|
|
|
|
titleToken: 'Subscribers',
|
|
|
|
// redirect if subscribers is disabled or user isn't owner/admin
|
|
beforeModel() {
|
|
this._super(...arguments);
|
|
let promises = {
|
|
user: this.get('session.user'),
|
|
subscribers: this.get('feature.subscribers')
|
|
};
|
|
|
|
return RSVP.hash(promises).then((hash) => {
|
|
let {user, subscribers} = hash;
|
|
|
|
if (!subscribers || !user.isOwnerOrAdmin) {
|
|
return this.transitionTo('home');
|
|
}
|
|
});
|
|
},
|
|
|
|
setupController(controller) {
|
|
this._super(...arguments);
|
|
controller.fetchSubscribers.perform();
|
|
}
|
|
});
|