mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 11:54:33 +03:00
c61c42ce1d
ref 8ea1dfb
ref https://linear.app/tryghost/issue/ONC-111
* undid the reversion for the performance improvements
* built upon new tests for the posts list functionality in admin,
including right click actions
* added tests for pages view in Admin
This was reverted because it broke the Pages list view in Admin, which
is a thin extension of the Posts functionality in admin (route &
controller). That has been fixed and tests added.
This was originally reverted because the changes to improve loading
response times broke right click (bulk) actions in the posts list. This
was not caught because it turned out we had near-zero test coverage of
that part of the codebase. Test coverage has been expanded for the posts
list, and while not comprehensive, is a much better place for us to be
in.
43 lines
864 B
JavaScript
43 lines
864 B
JavaScript
import PostsController from './posts';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
const TYPES = [{
|
|
name: 'All pages',
|
|
value: null
|
|
}, {
|
|
name: 'Draft pages',
|
|
value: 'draft'
|
|
}, {
|
|
name: 'Published pages',
|
|
value: 'published'
|
|
}, {
|
|
name: 'Scheduled pages',
|
|
value: 'scheduled'
|
|
}, {
|
|
name: 'Featured pages',
|
|
value: 'featured'
|
|
}];
|
|
|
|
const ORDERS = [{
|
|
name: 'Newest first',
|
|
value: null
|
|
}, {
|
|
name: 'Oldest first',
|
|
value: 'published_at asc'
|
|
}, {
|
|
name: 'Recently updated',
|
|
value: 'updated_at desc'
|
|
}];
|
|
|
|
export default class PagesController extends PostsController {
|
|
@service router;
|
|
|
|
availableTypes = TYPES;
|
|
availableOrders = ORDERS;
|
|
|
|
@action
|
|
openEditor(page) {
|
|
this.router.transitionTo('lexical-editor.edit', 'page', page.get('id'));
|
|
}
|
|
} |