Match service/controller import to ember-modules-codemod style for consistency

no issue

Automated tools, code generators, and editor integrations are increasingly standardising on the import style used in `ember-modules-codemod`. Our import style differed a little with regards to service/controller injection imports which meant we were starting to see inconsistent naming.
This commit is contained in:
Kevin Ansfield 2017-10-30 09:38:01 +00:00
parent f2ef3944cd
commit 9adbcd1fd0
107 changed files with 359 additions and 377 deletions

View File

@ -2,7 +2,7 @@ import AjaxServiceSupport from 'ember-ajax/mixins/ajax-support';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
import RESTAdapter from 'ember-data/adapters/rest';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default RESTAdapter.extend(DataAdapterMixin, AjaxServiceSupport, {
authorizer: 'authorizer:oauth2',
@ -10,7 +10,7 @@ export default RESTAdapter.extend(DataAdapterMixin, AjaxServiceSupport, {
host: window.location.origin,
namespace: ghostPaths().apiRoot.slice(1),
session: injectService(),
session: service(),
shouldBackgroundReloadRecord() {
return false;

View File

@ -2,16 +2,16 @@ import Authenticator from 'ember-simple-auth/authenticators/oauth2-password-gran
import RSVP from 'rsvp';
import {assign} from '@ember/polyfills';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isEmpty} from '@ember/utils';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {makeArray as wrap} from '@ember/array';
export default Authenticator.extend({
ajax: injectService(),
session: injectService(),
config: injectService(),
ghostPaths: injectService(),
ajax: service(),
session: service(),
config: service(),
ghostPaths: service(),
init() {
this._super(...arguments);

View File

@ -1,13 +1,13 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
tagName: 'article',
classNames: ['gh-alert'],
classNameBindings: ['typeClass'],
notifications: injectService(),
notifications: service(),
typeClass: computed('message.type', function () {
let type = this.get('message.type');

View File

@ -1,13 +1,13 @@
import Component from '@ember/component';
import {alias} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {observer} from '@ember/object';
import {inject as service} from '@ember/service';
export default Component.extend({
tagName: 'aside',
classNames: 'gh-alerts',
notifications: injectService(),
notifications: service(),
messages: alias('notifications.alerts'),

View File

@ -1,9 +1,9 @@
import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown';
import layout from 'ember-basic-dropdown/templates/components/basic-dropdown';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default BasicDropdown.extend({
dropdown: injectService(),
dropdown: service(),
layout,

View File

@ -1,8 +1,8 @@
import Component from '@ember/component';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
tagName: '',
config: injectService()
config: service()
});

View File

@ -5,7 +5,7 @@ import boundOneWay from 'ghost-admin/utils/bound-one-way';
import {InvokeActionMixin} from 'ember-invoke-action';
import {assign} from '@ember/polyfills';
import {bind, once, scheduleOnce} from '@ember/runloop';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
const CmEditorComponent = Component.extend(InvokeActionMixin, {
classNameBindings: ['isFocused:focus'],
@ -21,7 +21,7 @@ const CmEditorComponent = Component.extend(InvokeActionMixin, {
_editor: null, // reference to CodeMirror editor
lazyLoader: injectService(),
lazyLoader: service(),
didReceiveAttrs() {
if (this.get('value') === null || undefined) {

View File

@ -11,10 +11,10 @@ Example:
**/
import Component from '@ember/component';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
ui: injectService(),
ui: service(),
classNames: ['content-cover'],

View File

@ -1,12 +1,12 @@
import Component from '@ember/component';
import moment from 'moment';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isBlank, isEmpty} from '@ember/utils';
import {or, reads} from '@ember/object/computed';
import {inject as service} from '@ember/service';
export default Component.extend({
settings: injectService(),
settings: service(),
tagName: '',

View File

@ -3,7 +3,7 @@ import boundOneWay from 'ghost-admin/utils/bound-one-way';
import moment from 'moment';
import {InvokeActionMixin} from 'ember-invoke-action';
import {formatDate} from 'ghost-admin/utils/date-formatting';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend(InvokeActionMixin, {
tagName: 'span',
@ -13,7 +13,7 @@ export default Component.extend(InvokeActionMixin, {
inputClass: null,
inputId: null,
inputName: null,
settings: injectService(),
settings: service(),
didReceiveAttrs() {
let datetime = this.get('datetime') || moment.utc();

View File

@ -1,14 +1,14 @@
import Component from '@ember/component';
import Ember from 'ember';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task, timeout} from 'ember-concurrency';
const {testing} = Ember;
const INTERVAL = testing ? 20 : 2000;
export default Component.extend({
ajax: injectService(),
ghostPaths: injectService(),
ajax: service(),
ghostPaths: service(),
tagName: '',
count: '',

View File

@ -1,6 +1,6 @@
import Component from '@ember/component';
import DropdownMixin from 'ghost-admin/mixins/dropdown-mixin';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend(DropdownMixin, {
tagName: 'button',
@ -10,7 +10,7 @@ export default Component.extend(DropdownMixin, {
// matches with the dropdown this button toggles
dropdownName: null,
dropdown: injectService(),
dropdown: service(),
// Notify dropdown service this dropdown should be toggled
click(event) {

View File

@ -1,8 +1,8 @@
import Component from '@ember/component';
import DropdownMixin from 'ghost-admin/mixins/dropdown-mixin';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
export default Component.extend(DropdownMixin, {
classNames: 'dropdown',
@ -22,7 +22,7 @@ export default Component.extend(DropdownMixin, {
return this.get('isOpen') && !this.get('closing');
}),
dropdown: injectService(),
dropdown: service(),
open() {
this.set('isOpen', true);

View File

@ -3,13 +3,13 @@ import {
IMAGE_EXTENSIONS,
IMAGE_MIME_TYPES
} from 'ghost-admin/components/gh-image-uploader';
import {inject as injectService} from '@ember/service';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
const {debounce} = run;
export default Component.extend({
ui: injectService(),
ui: service(),
classNameBindings: [
'isDraggedOver:-drag-over',

View File

@ -1,6 +1,6 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
const FeatureFlagComponent = Component.extend({
tagName: 'label',
@ -8,7 +8,7 @@ const FeatureFlagComponent = Component.extend({
attributeBindings: ['for'],
_flagValue: null,
feature: injectService(),
feature: service(),
init() {
this._super(...arguments);

View File

@ -7,11 +7,11 @@ import {
} from 'ghost-admin/services/ajax';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {invokeAction} from 'ember-invoke-action';
import {isBlank} from '@ember/utils';
import {isArray as isEmberArray} from '@ember/array';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
export default Component.extend({
tagName: 'section',
@ -32,9 +32,9 @@ export default Component.extend({
failureMessage: null,
uploadPercentage: 0,
ajax: injectService(),
eventBus: injectService(),
notifications: injectService(),
ajax: service(),
eventBus: service(),
notifications: service(),
formData: computed('file', function () {
let paramName = this.get('paramName');

View File

@ -2,17 +2,17 @@ import Component from '@ember/component';
import RSVP from 'rsvp';
import {computed} from '@ember/object';
import {A as emberA} from '@ember/array';
import {inject as injectService} from '@ember/service';
import {invokeAction} from 'ember-invoke-action';
import {isBlank} from '@ember/utils';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
const FullScreenModalComponent = Component.extend({
model: null,
modifier: null,
dropdown: injectService(),
dropdown: service(),
modalPath: computed('modal', function () {
return `modal-${this.get('modal') || 'unknown'}`;

View File

@ -8,20 +8,20 @@ import {
} from 'ghost-admin/services/ajax';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {invokeAction} from 'ember-invoke-action';
import {isBlank} from '@ember/utils';
import {isArray as isEmberArray} from '@ember/array';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
export const IMAGE_MIME_TYPES = 'image/gif,image/jpg,image/jpeg,image/png,image/svg+xml';
export const IMAGE_EXTENSIONS = ['gif', 'jpg', 'jpeg', 'png', 'svg'];
export default Component.extend({
ajax: injectService(),
config: injectService(),
notifications: injectService(),
settings: injectService(),
ajax: service(),
config: service(),
notifications: service(),
settings: service(),
tagName: 'section',
classNames: ['gh-image-uploader'],

View File

@ -6,9 +6,9 @@ import {assign} from '@ember/polyfills';
import {computed} from '@ember/object';
import {copy} from '@ember/object/internals';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {isEmpty, typeOf} from '@ember/utils';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
const MOBILEDOC_VERSION = '0.3.1';
@ -27,9 +27,9 @@ export const BLANK_DOC = {
export default Component.extend(ShortcutsMixin, {
config: injectService(),
notifications: injectService(),
settings: injectService(),
config: service(),
notifications: service(),
settings: service(),
classNames: ['gh-markdown-editor'],
classNameBindings: [

View File

@ -1,7 +1,7 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {reads} from '@ember/object/computed';
import {inject as service} from '@ember/service';
/*
This cute little component has two jobs.
@ -16,7 +16,7 @@ import {reads} from '@ember/object/computed';
export default Component.extend({
classNames: ['gh-menu-toggle'],
mediaQueries: injectService(),
mediaQueries: service(),
isMobile: reads('mediaQueries.isMobile'),
maximise: false,

View File

@ -1,8 +1,8 @@
import Component from '@ember/component';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
ui: injectService(),
ui: service(),
tagName: 'nav',
classNames: ['gh-mobile-nav-bar']

View File

@ -2,15 +2,15 @@ import Component from '@ember/component';
import calculatePosition from 'ember-basic-dropdown/utils/calculate-position';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
config: injectService(),
feature: injectService(),
ghostPaths: injectService(),
router: injectService('router'),
session: injectService(),
ui: injectService(),
config: service(),
feature: service(),
ghostPaths: service(),
router: service('router'),
session: service(),
ui: service(),
tagName: 'nav',
classNames: ['gh-nav'],

View File

@ -1,6 +1,6 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
tagName: 'article',
@ -9,7 +9,7 @@ export default Component.extend({
message: null,
notifications: injectService(),
notifications: service(),
typeClass: computed('message.type', function () {
let type = this.get('message.type');

View File

@ -1,12 +1,12 @@
import Component from '@ember/component';
import {alias} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
tagName: 'aside',
classNames: 'gh-notifications',
notifications: injectService(),
notifications: service(),
messages: alias('notifications.notifications')
});

View File

@ -7,8 +7,8 @@ import {alias, or} from '@ember/object/computed';
import {computed} from '@ember/object';
import {guidFor} from '@ember/object/internals';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {task, timeout} from 'ember-concurrency';
const PSM_ANIMATION_LENGTH = 400;
@ -17,14 +17,14 @@ export default Component.extend(SettingsMenuMixin, {
selectedAuthor: null,
authors: [],
store: injectService(),
config: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
slugGenerator: injectService(),
session: injectService(),
settings: injectService(),
ui: injectService(),
store: service(),
config: service(),
ghostPaths: service(),
notifications: service(),
slugGenerator: service(),
session: service(),
settings: service(),
ui: service(),
model: null,

View File

@ -4,13 +4,13 @@ import Ember from 'ember';
import {alias, equal} from '@ember/object/computed';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {isBlank} from '@ember/utils';
import {inject as service} from '@ember/service';
const {Handlebars} = Ember;
export default Component.extend({
ghostPaths: injectService(),
ghostPaths: service(),
tagName: 'li',
classNames: ['gh-posts-list-item'],

View File

@ -2,7 +2,7 @@ import $ from 'jquery';
import Component from '@ember/component';
import request from 'ember-ajax/request';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task, timeout} from 'ember-concurrency';
const ANIMATION_TIMEOUT = 1000;
@ -32,8 +32,8 @@ export default Component.extend({
// closure actions
setImage() {},
config: injectService(),
ghostPaths: injectService(),
config: service(),
ghostPaths: service(),
placeholderStyle: htmlSafe('background-image: url()'),
avatarStyle: htmlSafe('display: none'),

View File

@ -1,12 +1,12 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isEmpty} from '@ember/utils';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Component.extend({
store: injectService(),
store: service(),
// public attributes
tagName: '',

View File

@ -1,10 +1,10 @@
import Component from '@ember/component';
import moment from 'moment';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
clock: injectService(),
clock: service(),
post: null,
saveType: null,

View File

@ -1,12 +1,12 @@
import $ from 'jquery';
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {reads} from '@ember/object/computed';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Component.extend({
clock: injectService(),
clock: service(),
classNames: 'gh-publishmenu',
post: null,

View File

@ -3,9 +3,9 @@
import Component from '@ember/component';
import RSVP from 'rsvp';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isBlank, isEmpty} from '@ember/utils';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
export function computedGroup(category) {
return computed('content', 'currentSearch', function () {
@ -35,10 +35,10 @@ export default Component.extend({
users: computedGroup('Users'),
tags: computedGroup('Tags'),
_store: injectService('store'),
router: injectService('router'),
ajax: injectService(),
notifications: injectService(),
_store: service('store'),
router: service('router'),
ajax: service(),
notifications: service(),
refreshContent() {
let promises = [];

View File

@ -4,9 +4,9 @@ import Ember from 'ember';
import boundOneWay from 'ghost-admin/utils/bound-one-way';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {invokeAction} from 'ember-invoke-action';
import {reads} from '@ember/object/computed';
import {inject as service} from '@ember/service';
const {Handlebars} = Ember;
@ -22,9 +22,9 @@ export default Component.extend({
isViewingSubview: false,
feature: injectService(),
config: injectService(),
mediaQueries: injectService(),
feature: service(),
config: service(),
mediaQueries: service(),
isMobile: reads('mediaQueries.maxWidth600'),

View File

@ -1,16 +1,16 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {equal, reads} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {isBlank} from '@ember/utils';
import {observer} from '@ember/object';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
export default Component.extend({
classNames: ['view-container'],
classNameBindings: ['isMobile'],
mediaQueries: injectService(),
mediaQueries: service(),
tags: null,
selectedTag: null,

View File

@ -1,10 +1,10 @@
import OneWayTextarea from 'ember-one-way-controls/components/one-way-textarea';
import TextInputMixin from 'ghost-admin/mixins/text-input';
import {inject as injectService} from '@ember/service';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
export default OneWayTextarea.extend(TextInputMixin, {
resizeDetector: injectService(),
resizeDetector: service(),
classNames: 'gh-input',

View File

@ -1,9 +1,9 @@
import Component from '@ember/component';
import moment from 'moment';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {invokeAction} from 'ember-invoke-action';
import {mapBy} from '@ember/object/computed';
import {inject as service} from '@ember/service';
export default Component.extend({
classNames: ['form-group', 'for-select'],
@ -11,7 +11,7 @@ export default Component.extend({
activeTimezone: null,
availableTimezones: null,
clock: injectService(),
clock: service(),
availableTimezoneNames: mapBy('availableTimezones', 'name'),

View File

@ -1,9 +1,9 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isBlank} from '@ember/utils';
import {reads} from '@ember/object/computed';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
let instancesCounter = 0;
@ -68,8 +68,8 @@ let triangleClassPositions = {
const GhTourItemComponent = Component.extend({
mediaQueries: injectService(),
tour: injectService(),
mediaQueries: service(),
tour: service(),
tagName: '',

View File

@ -1,16 +1,16 @@
import Component from '@ember/component';
import ShortcutsMixin from 'ghost-admin/mixins/shortcuts';
import {bind} from '@ember/runloop';
import {inject as injectService} from '@ember/service';
import {or} from '@ember/object/computed';
import {inject as service} from '@ember/service';
const ONE_COLUMN_WIDTH = 540;
const TWO_COLUMN_WIDTH = 940;
export default Component.extend(ShortcutsMixin, {
resizeDetector: injectService(),
unsplash: injectService(),
ui: injectService(),
resizeDetector: service(),
unsplash: service(),
ui: service(),
tagName: '',
zoomedPhoto: null,

View File

@ -1,13 +1,13 @@
import Component from '@ember/component';
import {alias} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
tagName: 'section',
classNames: ['gh-upgrade-notification'],
upgradeNotification: injectService('upgrade-notification'),
upgradeNotification: service('upgrade-notification'),
message: alias('upgradeNotification.content')
});

View File

@ -2,10 +2,10 @@ import Component from '@ember/component';
import EmberObject from '@ember/object';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import {all, task} from 'ember-concurrency';
import {inject as injectService} from '@ember/service';
import {isArray as isEmberArray} from '@ember/array';
import {isEmpty} from '@ember/utils';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
// TODO: this is designed to be a more re-usable/composable upload component, it
// should be able to replace the duplicated upload logic in:
@ -45,7 +45,7 @@ const UploadTracker = EmberObject.extend({
export default Component.extend({
tagName: '',
ajax: injectService(),
ajax: service(),
// Public attributes
accept: '',

View File

@ -1,6 +1,6 @@
import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
/*
Example usage:
@ -11,7 +11,7 @@ export default Component.extend({
prefix: null,
slug: null,
config: injectService(),
config: service(),
url: computed('slug', function () {
// Get the blog URL and strip the scheme

View File

@ -3,7 +3,7 @@ import Ember from 'ember';
import moment from 'moment';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
const {Handlebars} = Ember;
@ -12,7 +12,7 @@ export default Component.extend({
user: null,
ghostPaths: injectService(),
ghostPaths: service(),
userDefault: computed('ghostPaths', function () {
return `${this.get('ghostPaths.assetRoot')}/img/user-image.png`;

View File

@ -1,8 +1,8 @@
import Component from '@ember/component';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Component.extend({
ui: injectService(),
ui: service(),
tagName: 'h2',
classNames: ['view-title']

View File

@ -1,13 +1,13 @@
import ModalComponent from 'ghost-admin/components/modal-base';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default ModalComponent.extend({
ghostPaths: injectService(),
notifications: injectService(),
store: injectService(),
ajax: injectService(),
ghostPaths: service(),
notifications: service(),
store: service(),
ajax: service(),
_deleteAll() {
let deleteUrl = this.get('ghostPaths.url').api('db');

View File

@ -1,6 +1,6 @@
import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default ModalComponent.extend({
@ -8,7 +8,7 @@ export default ModalComponent.extend({
post: alias('model.post'),
onSuccess: alias('model.onSuccess'),
notifications: injectService(),
notifications: service(),
_deletePost() {
let post = this.get('post');

View File

@ -2,8 +2,8 @@ import ModalComponent from 'ghost-admin/components/modal-base';
import RSVP from 'rsvp';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {A as emberA} from '@ember/array';
import {inject as injectService} from '@ember/service';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
const {Promise} = RSVP;
@ -17,8 +17,8 @@ export default ModalComponent.extend(ValidationEngine, {
validationType: 'inviteUser',
notifications: injectService(),
store: injectService(),
notifications: service(),
store: service(),
init() {
this._super(...arguments);

View File

@ -3,8 +3,8 @@ import ModalComponent from 'ghost-admin/components/modal-base';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default ModalComponent.extend(ValidationEngine, {
@ -12,9 +12,9 @@ export default ModalComponent.extend(ValidationEngine, {
authenticationError: null,
config: injectService(),
notifications: injectService(),
session: injectService(),
config: service(),
notifications: service(),
session: service(),
identification: computed('session.user.email', function () {
return this.get('session.user.email');

View File

@ -1,8 +1,8 @@
import ModalComponent from 'ghost-admin/components/modal-base';
import cajaSanitizers from 'ghost-admin/utils/caja-sanitizers';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isEmpty} from '@ember/utils';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default ModalComponent.extend({
@ -12,8 +12,8 @@ export default ModalComponent.extend({
newUrl: '',
_isUploading: false,
config: injectService(),
notifications: injectService(),
config: service(),
notifications: service(),
image: computed('model.model', 'model.imageProperty', {
get() {

View File

@ -6,10 +6,10 @@ import {
} from 'ghost-admin/services/ajax';
import {computed} from '@ember/object';
import {get} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {invokeAction} from 'ember-invoke-action';
import {mapBy, or} from '@ember/object/computed';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
export default ModalComponent.extend({
@ -21,8 +21,8 @@ export default ModalComponent.extend({
theme: false,
displayOverwriteWarning: false,
eventBus: injectService(),
store: injectService(),
eventBus: service(),
store: service(),
hideUploader: or('theme', 'displayOverwriteWarning'),

View File

@ -1,12 +1,12 @@
import Controller from '@ember/controller';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Controller.extend({
dropdown: injectService(),
session: injectService(),
settings: injectService(),
ui: injectService(),
dropdown: service(),
session: service(),
settings: service(),
ui: service(),
showNavMenu: computed('currentPath', 'session.isAuthenticated', 'session.user.isFulfilled', function () {
// we need to defer showing the navigation menu until the session.user

View File

@ -1,12 +1,11 @@
import Controller from '@ember/controller';
import {inject as injectController} from '@ember/controller';
import {inject as injectService} from '@ember/service';
import Controller, {inject as controller} from '@ember/controller';
import {readOnly} from '@ember/object/computed';
import {inject as service} from '@ember/service';
export default Controller.extend({
postsController: injectController('posts'),
session: injectService(),
postsController: controller('posts'),
session: service(),
availableTypes: readOnly('postsController.availableTypes'),
selectedType: readOnly('postsController.selectedType'),

View File

@ -1,12 +1,12 @@
import Controller from '@ember/controller';
import {computed} from '@ember/object';
import {get} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Controller.extend({
session: injectService(),
store: injectService(),
session: service(),
store: service(),
queryParams: ['type', 'author', 'tag', 'order'],
type: null,

View File

@ -1,7 +1,7 @@
import Controller from '@ember/controller';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend(ValidationEngine, {
@ -12,11 +12,11 @@ export default Controller.extend(ValidationEngine, {
validationType: 'reset',
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
ajax: injectService(),
config: injectService(),
ghostPaths: service(),
notifications: service(),
session: service(),
ajax: service(),
config: service(),
email: computed('token', function () {
// The token base64 encodes the email (and some other stuff),

View File

@ -1,11 +1,11 @@
import Controller from '@ember/controller';
import {alias} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend({
notifications: injectService(),
settings: injectService(),
notifications: service(),
settings: service(),
model: alias('settings.amp'),

View File

@ -1,6 +1,6 @@
import Controller from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Controller.extend({
settings: injectService()
settings: service()
});

View File

@ -1,15 +1,15 @@
import Controller from '@ember/controller';
import {alias} from '@ember/object/computed';
import {empty} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {isInvalidError} from 'ember-ajax/errors';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend({
ghostPaths: injectService(),
ajax: injectService(),
notifications: injectService(),
settings: injectService(),
ghostPaths: service(),
ajax: service(),
notifications: service(),
settings: service(),
model: alias('settings.slack.firstObject'),
testNotificationDisabled: empty('model.url'),

View File

@ -1,11 +1,11 @@
import Controller from '@ember/controller';
import {alias} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend({
notifications: injectService(),
settings: injectService(),
notifications: service(),
settings: service(),
model: alias('settings.unsplash'),

View File

@ -1,9 +1,9 @@
import Controller from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend({
notifications: injectService(),
notifications: service(),
save: task(function* () {
let notifications = this.get('notifications');

View File

@ -3,17 +3,17 @@ import Controller from '@ember/controller';
import NavigationItem from 'ghost-admin/models/navigation-item';
import RSVP from 'rsvp';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isEmpty} from '@ember/utils';
import {isThemeValidationError} from 'ghost-admin/services/ajax';
import {notEmpty} from '@ember/object/computed';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend({
config: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
config: service(),
ghostPaths: service(),
notifications: service(),
session: service(),
newNavItem: null,

View File

@ -6,16 +6,16 @@ import {
IMAGE_MIME_TYPES
} from 'ghost-admin/components/gh-image-uploader';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {observer} from '@ember/object';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend({
config: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
config: service(),
ghostPaths: service(),
notifications: service(),
session: service(),
availableTimezones: null,
iconExtensions: ['ico', 'png'],

View File

@ -7,10 +7,10 @@ import {
isRequestEntityTooLargeError,
isUnsupportedMediaTypeError
} from 'ghost-admin/services/ajax';
import {inject as injectService} from '@ember/service';
import {isBlank} from '@ember/utils';
import {isArray as isEmberArray} from '@ember/array';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {task, timeout} from 'ember-concurrency';
const {testing} = Ember;
@ -27,12 +27,12 @@ export default Controller.extend({
jsonExtension: ['json'],
jsonMimeType: ['application/json'],
ajax: injectService(),
config: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
settings: injectService(),
ajax: service(),
config: service(),
ghostPaths: service(),
notifications: service(),
session: service(),
settings: service(),
// TODO: convert to ember-concurrency task
_validate(file) {

View File

@ -1,11 +1,10 @@
import Controller from '@ember/controller';
import Controller, {inject as controller} from '@ember/controller';
import {alias, equal, sort} from '@ember/object/computed';
import {inject as injectController} from '@ember/controller';
import {run} from '@ember/runloop';
export default Controller.extend({
tagController: injectController('settings.tags.tag'),
tagController: controller('settings.tags.tag'),
selectedTag: alias('tagController.tag'),

View File

@ -1,7 +1,6 @@
import Controller from '@ember/controller';
import Controller, {inject as controller} from '@ember/controller';
import {alias} from '@ember/object/computed';
import {inject as injectController} from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Controller.extend({
@ -10,9 +9,9 @@ export default Controller.extend({
tag: alias('model'),
isMobile: alias('tagsController.isMobile'),
applicationController: injectController('application'),
tagsController: injectController('settings.tags'),
notifications: injectService(),
applicationController: controller('application'),
tagsController: controller('settings.tags'),
notifications: service(),
_saveTagProperty(propKey, newValue) {
let tag = this.get('tag');

View File

@ -1,12 +1,11 @@
import Controller from '@ember/controller';
import Controller, {inject as controller} from '@ember/controller';
import {computed} from '@ember/object';
import {inject as injectController} from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {match} from '@ember/object/computed';
import {inject as service} from '@ember/service';
export default Controller.extend({
appController: injectController('application'),
ghostPaths: injectService(),
appController: controller('application'),
ghostPaths: service(),
showBackLink: match('appController.currentRouteName', /^setup\.(two|three)$/),

View File

@ -1,21 +1,20 @@
import Controller from '@ember/controller';
import Controller, {inject as controller} from '@ember/controller';
import DS from 'ember-data';
import RSVP from 'rsvp';
import {alias} from '@ember/object/computed';
import {computed} from '@ember/object';
import {A as emberA} from '@ember/array';
import {htmlSafe} from '@ember/string';
import {inject as injectController} from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {isInvalidError} from 'ember-ajax/errors';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {task, timeout} from 'ember-concurrency';
const {Errors} = DS;
export default Controller.extend({
notifications: injectService(),
two: injectController('setup/two'),
notifications: service(),
two: controller('setup/two'),
errors: Errors.create(),
hasValidated: emberA(),

View File

@ -1,21 +1,20 @@
/* eslint-disable camelcase */
import Controller from '@ember/controller';
import Controller, {inject as controller} from '@ember/controller';
import RSVP from 'rsvp';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {inject as injectController} from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {isInvalidError} from 'ember-ajax/errors';
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend(ValidationEngine, {
ajax: injectService(),
application: injectController(),
config: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
settings: injectService(),
ajax: service(),
application: controller(),
config: service(),
ghostPaths: service(),
notifications: service(),
session: service(),
settings: service(),
// ValidationEngine settings
validationType: 'setup',

View File

@ -1,11 +1,10 @@
import $ from 'jquery';
import Controller from '@ember/controller';
import Controller, {inject as controller} from '@ember/controller';
import RSVP from 'rsvp';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {inject as injectController} from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {isArray as isEmberArray} from '@ember/array';
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend(ValidationEngine, {
@ -13,13 +12,13 @@ export default Controller.extend(ValidationEngine, {
loggingIn: false,
authProperties: ['identification', 'password'],
ajax: injectService(),
application: injectController(),
config: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
settings: injectService(),
ajax: service(),
application: controller(),
config: service(),
ghostPaths: service(),
notifications: service(),
session: service(),
settings: service(),
flowErrors: '',

View File

@ -5,17 +5,17 @@ import {
VersionMismatchError,
isVersionMismatchError
} from 'ghost-admin/services/ajax';
import {inject as injectService} from '@ember/service';
import {isArray as isEmberArray} from '@ember/array';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Controller.extend(ValidationEngine, {
ajax: injectService(),
config: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
settings: injectService(),
ajax: service(),
config: service(),
ghostPaths: service(),
notifications: service(),
session: service(),
settings: service(),
// ValidationEngine settings
validationType: 'signup',

View File

@ -5,7 +5,7 @@ import Table from 'ember-light-table';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import {assign} from '@ember/polyfills';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Controller.extend(PaginationMixin, {
@ -19,7 +19,7 @@ export default Controller.extend(PaginationMixin, {
table: null,
subscriberToDelete: null,
session: injectService(),
session: service(),
// paginationSettings is replaced by the pagination mixin so we need a
// getter/setter CP here so that we don't lose the dynamic order param

View File

@ -1,5 +1,5 @@
import Controller from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {sort} from '@ember/object/computed';
export default Controller.extend({
@ -10,7 +10,7 @@ export default Controller.extend({
suspendedUsers: null,
invites: null,
session: injectService(),
session: service(),
inviteOrder: ['email'],
sortedInvites: sort('invites', 'inviteOrder'),

View File

@ -5,9 +5,9 @@ import isNumber from 'ghost-admin/utils/isNumber';
import {alias, and, not, or, readOnly} from '@ember/object/computed';
import {computed} from '@ember/object';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {isArray as isEmberArray} from '@ember/array';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {task, taskGroup} from 'ember-concurrency';
// ember-cli-shims doesn't export this
@ -22,13 +22,13 @@ export default Controller.extend({
_scratchFacebook: null,
_scratchTwitter: null,
ajax: injectService(),
config: injectService(),
dropdown: injectService(),
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
slugGenerator: injectService(),
ajax: service(),
config: service(),
dropdown: service(),
ghostPaths: service(),
notifications: service(),
session: service(),
slugGenerator: service(),
user: alias('model'),
currentUser: alias('session.user'),

View File

@ -1,10 +1,10 @@
import Helper from '@ember/component/helper';
import moment from 'moment';
import {assert} from '@ember/debug';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Helper.extend({
settings: injectService(),
settings: service(),
compute([timeago], {draft, scheduled, published}) {
assert(timeago, 'You must pass a time to the gh-format-post-time helper');

View File

@ -6,14 +6,14 @@ import ghostPaths from 'ghost-admin/utils/ghost-paths';
import isNumber from 'ghost-admin/utils/isNumber';
import moment from 'moment';
import {computed} from '@ember/object';
import {inject as controller} from '@ember/controller';
import {htmlSafe} from '@ember/string';
import {inject as injectController} from '@ember/controller';
import {inject as injectService} from '@ember/service';
import {isBlank} from '@ember/utils';
import {isArray as isEmberArray} from '@ember/array';
import {isInvalidError} from 'ember-ajax/errors';
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
import {mapBy, reads} from '@ember/object/computed';
import {inject as service} from '@ember/service';
import {task, taskGroup, timeout} from 'ember-concurrency';
// ember-cli-shims doesn't export Ember.testing
@ -41,11 +41,11 @@ export default Mixin.create({
showDeletePostModal: false,
shouldFocusEditor: true,
application: injectController(),
notifications: injectService(),
clock: injectService(),
slugGenerator: injectService(),
ui: injectService(),
application: controller(),
notifications: service(),
clock: service(),
slugGenerator: service(),
ui: service(),
wordcount: 0,
cards: [], // for apps

View File

@ -2,7 +2,7 @@ import Mixin from '@ember/object/mixin';
import RSVP from 'rsvp';
import {assign} from '@ember/polyfills';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
let defaultPaginationSettings = {
page: 1,
@ -10,7 +10,7 @@ let defaultPaginationSettings = {
};
export default Mixin.create({
notifications: injectService(),
notifications: service(),
paginationModel: null,
paginationSettings: null,

View File

@ -1,11 +1,11 @@
import Mixin from '@ember/object/mixin';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Mixin.create({
ajax: injectService(),
ghostPaths: injectService(),
session: injectService(),
ajax: service(),
ghostPaths: service(),
session: service(),
routeIfAlreadyAuthenticated: 'posts',

View File

@ -2,7 +2,7 @@
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import {belongsTo} from 'ember-data/relationships';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Model.extend({
token: attr('string'),
@ -15,8 +15,8 @@ export default Model.extend({
status: attr('string'),
role: belongsTo('role', {async: false}),
ajax: injectService(),
ghostPaths: injectService(),
ajax: service(),
ghostPaths: service(),
resend() {
let fullInviteData = this.toJSON();

View File

@ -9,9 +9,9 @@ import {belongsTo, hasMany} from 'ember-data/relationships';
import {compare} from '@ember/utils';
import {computed} from '@ember/object';
import {equal, filterBy} from '@ember/object/computed';
import {inject as injectService} from '@ember/service';
import {isBlank} from '@ember/utils';
import {observer} from '@ember/object';
import {inject as service} from '@ember/service';
// ember-cli-shims doesn't export these so we must get them manually
const {Comparable} = Ember;
@ -68,10 +68,10 @@ function publishedAtCompare(postA, postB) {
}
export default Model.extend(Comparable, ValidationEngine, {
config: injectService(),
ghostPaths: injectService(),
clock: injectService(),
settings: injectService(),
config: service(),
ghostPaths: service(),
clock: service(),
settings: service(),
validationType: 'post',

View File

@ -5,8 +5,8 @@ import attr from 'ember-data/attr';
import {computed} from '@ember/object';
import {equal} from '@ember/object/computed';
import {guidFor} from '@ember/object/internals';
import {inject as injectService} from '@ember/service';
import {observer} from '@ember/object';
import {inject as service} from '@ember/service';
export default Model.extend(ValidationEngine, {
validationType: 'tag',
@ -28,7 +28,7 @@ export default Model.extend(ValidationEngine, {
isInternal: equal('visibility', 'internal'),
isPublic: equal('visibility', 'public'),
feature: injectService(),
feature: service(),
// HACK: ugly hack to main compatibility with selectize as used in the
// PSM tags input

View File

@ -5,7 +5,7 @@ import attr from 'ember-data/attr';
import {computed} from '@ember/object';
import {equal} from '@ember/object/computed';
import {hasMany} from 'ember-data/relationships';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default Model.extend(ValidationEngine, {
@ -38,11 +38,11 @@ export default Model.extend(ValidationEngine, {
twitter: attr('twitter-url-user'),
tour: attr('json-string'),
ghostPaths: injectService(),
ajax: injectService(),
session: injectService(),
notifications: injectService(),
config: injectService(),
ghostPaths: service(),
ajax: service(),
session: service(),
notifications: service(),
config: service(),
// TODO: Once client-side permissions are in place,
// remove the hard role check.

View File

@ -2,14 +2,14 @@ import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import documentTitle from 'ghost-admin/utils/document-title';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import {inject as injectService} from '@ember/service';
import {on} from '@ember/object/evented';
import {inject as service} from '@ember/service';
const Router = EmberRouter.extend({
location: config.locationType, // use HTML5 History API instead of hash-tag based URLs
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
notifications: injectService(),
notifications: service(),
displayDelayedNotifications: on('didTransition', function () {
this.get('notifications').displayDelayed();

View File

@ -1,14 +1,14 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, {
titleToken: 'About',
classNames: ['view-about'],
ghostPaths: injectService(),
ajax: injectService(),
ghostPaths: service(),
ajax: service(),
cachedConfig: false,

View File

@ -8,11 +8,11 @@ import ctrlOrCmd from 'ghost-admin/utils/ctrl-or-cmd';
import moment from 'moment';
import windowProxy from 'ghost-admin/utils/window-proxy';
import {htmlSafe} from '@ember/string';
import {inject as injectService} from '@ember/service';
import {isArray as isEmberArray} from '@ember/array';
import {isUnauthorizedError} from 'ember-ajax/errors';
import {observer} from '@ember/object';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
function K() {
return this;
@ -28,14 +28,14 @@ export default Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
routeAfterAuthentication: 'posts',
config: injectService(),
feature: injectService(),
lazyLoader: injectService(),
notifications: injectService(),
settings: injectService(),
upgradeNotification: injectService(),
tour: injectService(),
ui: injectService(),
config: service(),
feature: service(),
lazyLoader: service(),
notifications: service(),
settings: service(),
upgradeNotification: service(),
tour: service(),
ui: service(),
beforeModel() {
return this.get('config').fetch();

View File

@ -1,13 +1,13 @@
import Route from '@ember/routing/route';
import UnauthenticatedRouteMixin from 'ghost-admin/mixins/unauthenticated-route-mixin';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
classNames: ['ghost-reset'],
notifications: injectService(),
session: injectService(),
notifications: service(),
session: service(),
beforeModel() {
if (this.get('session.isAuthenticated')) {

View File

@ -1,10 +1,10 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
settings: injectService(),
settings: service(),
titleToken: 'Settings - Apps',
classNames: ['settings-view-apps'],

View File

@ -1,11 +1,11 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import UnsplashObject from 'ghost-admin/models/unsplash-integration';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, {
config: injectService(),
settings: injectService(),
config: service(),
settings: service(),
titleToken: 'Settings - Apps - Unsplash',
classNames: ['settings-view-apps-unsplash'],

View File

@ -1,13 +1,13 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
titleToken: 'Settings - Code injection',
classNames: ['settings-view-code'],
settings: injectService(),
settings: service(),
beforeModel() {
this._super(...arguments);

View File

@ -3,10 +3,10 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import RSVP from 'rsvp';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
settings: injectService(),
settings: service(),
titleToken: 'Settings - Design',
classNames: ['settings-view-design'],

View File

@ -2,11 +2,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import RSVP from 'rsvp';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
config: injectService(),
settings: injectService(),
config: service(),
settings: service(),
titleToken: 'Settings - General',
classNames: ['settings-view-general'],

View File

@ -1,10 +1,10 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
settings: injectService(),
settings: service(),
titleToken: 'Settings - Labs',
classNames: ['settings'],

View File

@ -1,8 +1,8 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend({
mediaQueries: injectService(),
mediaQueries: service(),
beforeModel() {
let firstTag = this.modelFor('settings.tags').get('firstObject');

View File

@ -1,16 +1,16 @@
import Route from '@ember/routing/route';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default Route.extend(styleBody, {
titleToken: 'Setup',
classNames: ['ghost-setup'],
ghostPaths: injectService(),
session: injectService(),
ajax: injectService(),
config: injectService(),
ghostPaths: service(),
session: service(),
ajax: service(),
config: service(),
// use the beforeModel hook to check to see whether or not setup has been
// previously completed. If it has, stop the transition into the setup page.

View File

@ -1,7 +1,7 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import Ember from 'ember';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
// ember-cli-shims doesn't export canInvoke
const {canInvoke} = Ember;
@ -11,7 +11,7 @@ export default AuthenticatedRoute.extend(styleBody, {
classNames: ['ghost-signout'],
notifications: injectService(),
notifications: service(),
afterModel(model, transition) {
this.get('notifications').clearAll();

View File

@ -4,7 +4,7 @@ import RSVP from 'rsvp';
import Route from '@ember/routing/route';
import UnauthenticatedRouteMixin from 'ghost-admin/mixins/unauthenticated-route-mixin';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
const {Promise} = RSVP;
const {Errors} = DS;
@ -12,11 +12,11 @@ const {Errors} = DS;
export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
classNames: ['ghost-signup'],
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
ajax: injectService(),
config: injectService(),
ghostPaths: service(),
notifications: service(),
session: service(),
ajax: service(),
config: service(),
beforeModel() {
if (this.get('session.isAuthenticated')) {

View File

@ -1,11 +1,11 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import RSVP from 'rsvp';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend({
titleToken: 'Subscribers',
feature: injectService(),
feature: service(),
// redirect if subscribers is disabled or user isn't owner/admin
beforeModel() {

View File

@ -3,9 +3,9 @@ import config from 'ghost-admin/config/environment';
import {AjaxError, isAjaxError} from 'ember-ajax/errors';
import {computed} from '@ember/object';
import {get} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {isArray as isEmberArray} from '@ember/array';
import {isNone} from '@ember/utils';
import {inject as service} from '@ember/service';
const JSONContentType = 'application/json';
@ -113,7 +113,7 @@ export function isThemeValidationError(errorOrStatus, payload) {
/* end: custom error types */
let ajaxService = AjaxService.extend({
session: injectService(),
session: service(),
headers: computed('session.isAuthenticated', function () {
let session = this.get('session');

View File

@ -1,15 +1,14 @@
import Ember from 'ember';
import Service from '@ember/service';
import Service, {inject as service} from '@ember/service';
import {assign} from '@ember/polyfills';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
// ember-cli-shims doesn't export _ProxyMixin
const {_ProxyMixin} = Ember;
export default Service.extend(_ProxyMixin, {
ajax: injectService(),
ghostPaths: injectService(),
ajax: service(),
ghostPaths: service(),
content: {},

View File

@ -1,9 +1,8 @@
import Ember from 'ember';
import EmberError from '@ember/error';
import RSVP from 'rsvp';
import Service from '@ember/service';
import Service, {inject as service} from '@ember/service';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {set} from '@ember/object';
export function feature(name, user = false) {
@ -29,11 +28,11 @@ export function feature(name, user = false) {
}
export default Service.extend({
store: injectService(),
config: injectService(),
session: injectService(),
settings: injectService(),
notifications: injectService(),
store: service(),
config: service(),
session: service(),
settings: service(),
notifications: service(),
publicAPI: feature('publicAPI'),
subscribers: feature('subscribers'),

View File

@ -1,14 +1,13 @@
import $ from 'jquery';
import Ember from 'ember';
import RSVP from 'rsvp';
import Service from '@ember/service';
import {inject as injectService} from '@ember/service';
import Service, {inject as service} from '@ember/service';
const {testing} = Ember;
export default Service.extend({
ajax: injectService(),
ghostPaths: injectService(),
ajax: service(),
ghostPaths: service(),
// This is needed so we can disable it in unit tests
testing,

View File

@ -1,15 +1,13 @@
import Service from '@ember/service';
import Service, {inject as service} from '@ember/service';
import {dasherize} from '@ember/string';
import {A as emberA, isArray as isEmberArray} from '@ember/array';
import {filter} from '@ember/object/computed';
import {get} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {get, set} from '@ember/object';
import {isBlank} from '@ember/utils';
import {
isMaintenanceError,
isVersionMismatchError
} from 'ghost-admin/services/ajax';
import {set} from '@ember/object';
// Notification keys take the form of "noun.verb.message", eg:
//
@ -24,7 +22,7 @@ export default Service.extend({
delayedNotifications: emberA(),
content: emberA(),
upgradeStatus: injectService(),
upgradeStatus: service(),
alerts: filter('content', function (notification) {
let status = get(notification, 'status');

View File

@ -1,12 +1,12 @@
import RSVP from 'rsvp';
import SessionService from 'ember-simple-auth/services/session';
import {computed} from '@ember/object';
import {inject as injectService} from '@ember/service';
import {inject as service} from '@ember/service';
export default SessionService.extend({
feature: injectService(),
store: injectService(),
tour: injectService(),
feature: service(),
store: service(),
tour: service(),
user: computed(function () {
return this.get('store').queryRecord('user', {id: 'me'});

View File

@ -1,15 +1,14 @@
import Ember from 'ember';
import RSVP from 'rsvp';
import Service from '@ember/service';
import Service, {inject as service} from '@ember/service';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import {get} from '@ember/object';
import {inject as injectService} from '@ember/service';
// ember-cli-shims doesn't export _ProxyMixin
const {_ProxyMixin} = Ember;
export default Service.extend(_ProxyMixin, ValidationEngine, {
store: injectService(),
store: service(),
// will be set to the single Settings model, it's a reference so any later
// changes to the settings object in the store will be reflected

Some files were not shown because too many files have changed in this diff Show More