mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Refactored use of ShortcutsRoute mixin on tags screen
no issue - mixins are deprecated in Ember so we want to remove their usage - pre-requisite for easier automation for switching to native class syntax - removed ShortcutsRoute mixin in favor of using the `{{on-key}}` modifier and standard controller action
This commit is contained in:
parent
683a8584ce
commit
c868dd6224
@ -1,8 +1,10 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {alias, sort} from '@ember/object/computed';
|
import {alias, sort} from '@ember/object/computed';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
|
router: service(),
|
||||||
|
|
||||||
queryParams: ['type'],
|
queryParams: ['type'],
|
||||||
type: 'public',
|
type: 'public',
|
||||||
@ -24,6 +26,10 @@ export default Controller.extend({
|
|||||||
actions: {
|
actions: {
|
||||||
changeType(type) {
|
changeType(type) {
|
||||||
this.set('type', type);
|
this.set('type', type);
|
||||||
|
},
|
||||||
|
|
||||||
|
newTag() {
|
||||||
|
this.router.transitionTo('tag.new');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import ShortcutsRoute from 'ghost-admin/mixins/shortcuts-route';
|
|
||||||
|
|
||||||
export default AuthenticatedRoute.extend(ShortcutsRoute, {
|
export default AuthenticatedRoute.extend({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
type: {
|
type: {
|
||||||
refreshModel: true,
|
refreshModel: true,
|
||||||
@ -9,15 +8,6 @@ export default AuthenticatedRoute.extend(ShortcutsRoute, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
shortcuts: null,
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this._super(...arguments);
|
|
||||||
this.shortcuts = {
|
|
||||||
c: 'newTag'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
// authors aren't allowed to manage tags
|
// authors aren't allowed to manage tags
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
@ -40,12 +30,6 @@ export default AuthenticatedRoute.extend(ShortcutsRoute, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
|
||||||
newTag() {
|
|
||||||
this.transitionTo('tag.new');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
buildRouteInfoMetadata() {
|
buildRouteInfoMetadata() {
|
||||||
return {
|
return {
|
||||||
titleToken: 'Tags'
|
titleToken: 'Tags'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<section class="gh-canvas">
|
<section class="gh-canvas" {{on-key "c" (action "newTag")}}>
|
||||||
<GhCanvasHeader class="gh-canvas-header">
|
<GhCanvasHeader class="gh-canvas-header">
|
||||||
<h2 class="gh-canvas-title" data-test-screen-title>Tags</h2>
|
<h2 class="gh-canvas-title" data-test-screen-title>Tags</h2>
|
||||||
<section class="view-actions">
|
<section class="view-actions">
|
||||||
|
Loading…
Reference in New Issue
Block a user