mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
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:
parent
f2ef3944cd
commit
9adbcd1fd0
@ -2,7 +2,7 @@ import AjaxServiceSupport from 'ember-ajax/mixins/ajax-support';
|
|||||||
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
|
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
|
||||||
import RESTAdapter from 'ember-data/adapters/rest';
|
import RESTAdapter from 'ember-data/adapters/rest';
|
||||||
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
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, {
|
export default RESTAdapter.extend(DataAdapterMixin, AjaxServiceSupport, {
|
||||||
authorizer: 'authorizer:oauth2',
|
authorizer: 'authorizer:oauth2',
|
||||||
@ -10,7 +10,7 @@ export default RESTAdapter.extend(DataAdapterMixin, AjaxServiceSupport, {
|
|||||||
host: window.location.origin,
|
host: window.location.origin,
|
||||||
namespace: ghostPaths().apiRoot.slice(1),
|
namespace: ghostPaths().apiRoot.slice(1),
|
||||||
|
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
shouldBackgroundReloadRecord() {
|
shouldBackgroundReloadRecord() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -2,16 +2,16 @@ import Authenticator from 'ember-simple-auth/authenticators/oauth2-password-gran
|
|||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import {assign} from '@ember/polyfills';
|
import {assign} from '@ember/polyfills';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isEmpty} from '@ember/utils';
|
import {isEmpty} from '@ember/utils';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {makeArray as wrap} from '@ember/array';
|
import {makeArray as wrap} from '@ember/array';
|
||||||
|
|
||||||
export default Authenticator.extend({
|
export default Authenticator.extend({
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'article',
|
tagName: 'article',
|
||||||
classNames: ['gh-alert'],
|
classNames: ['gh-alert'],
|
||||||
classNameBindings: ['typeClass'],
|
classNameBindings: ['typeClass'],
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
typeClass: computed('message.type', function () {
|
typeClass: computed('message.type', function () {
|
||||||
let type = this.get('message.type');
|
let type = this.get('message.type');
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {alias} from '@ember/object/computed';
|
import {alias} from '@ember/object/computed';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {observer} from '@ember/object';
|
import {observer} from '@ember/object';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'aside',
|
tagName: 'aside',
|
||||||
classNames: 'gh-alerts',
|
classNames: 'gh-alerts',
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
messages: alias('notifications.alerts'),
|
messages: alias('notifications.alerts'),
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown';
|
import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown';
|
||||||
import layout from 'ember-basic-dropdown/templates/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({
|
export default BasicDropdown.extend({
|
||||||
dropdown: injectService(),
|
dropdown: service(),
|
||||||
|
|
||||||
layout,
|
layout,
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: '',
|
tagName: '',
|
||||||
|
|
||||||
config: injectService()
|
config: service()
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,7 @@ import boundOneWay from 'ghost-admin/utils/bound-one-way';
|
|||||||
import {InvokeActionMixin} from 'ember-invoke-action';
|
import {InvokeActionMixin} from 'ember-invoke-action';
|
||||||
import {assign} from '@ember/polyfills';
|
import {assign} from '@ember/polyfills';
|
||||||
import {bind, once, scheduleOnce} from '@ember/runloop';
|
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, {
|
const CmEditorComponent = Component.extend(InvokeActionMixin, {
|
||||||
classNameBindings: ['isFocused:focus'],
|
classNameBindings: ['isFocused:focus'],
|
||||||
@ -21,7 +21,7 @@ const CmEditorComponent = Component.extend(InvokeActionMixin, {
|
|||||||
|
|
||||||
_editor: null, // reference to CodeMirror editor
|
_editor: null, // reference to CodeMirror editor
|
||||||
|
|
||||||
lazyLoader: injectService(),
|
lazyLoader: service(),
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
if (this.get('value') === null || undefined) {
|
if (this.get('value') === null || undefined) {
|
||||||
|
@ -11,10 +11,10 @@ Example:
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
classNames: ['content-cover'],
|
classNames: ['content-cover'],
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank, isEmpty} from '@ember/utils';
|
import {isBlank, isEmpty} from '@ember/utils';
|
||||||
import {or, reads} from '@ember/object/computed';
|
import {or, reads} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
tagName: '',
|
tagName: '',
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import boundOneWay from 'ghost-admin/utils/bound-one-way';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {InvokeActionMixin} from 'ember-invoke-action';
|
import {InvokeActionMixin} from 'ember-invoke-action';
|
||||||
import {formatDate} from 'ghost-admin/utils/date-formatting';
|
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, {
|
export default Component.extend(InvokeActionMixin, {
|
||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
@ -13,7 +13,7 @@ export default Component.extend(InvokeActionMixin, {
|
|||||||
inputClass: null,
|
inputClass: null,
|
||||||
inputId: null,
|
inputId: null,
|
||||||
inputName: null,
|
inputName: null,
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
let datetime = this.get('datetime') || moment.utc();
|
let datetime = this.get('datetime') || moment.utc();
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
import {task, timeout} from 'ember-concurrency';
|
import {task, timeout} from 'ember-concurrency';
|
||||||
|
|
||||||
const {testing} = Ember;
|
const {testing} = Ember;
|
||||||
const INTERVAL = testing ? 20 : 2000;
|
const INTERVAL = testing ? 20 : 2000;
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
tagName: '',
|
tagName: '',
|
||||||
count: '',
|
count: '',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import DropdownMixin from 'ghost-admin/mixins/dropdown-mixin';
|
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, {
|
export default Component.extend(DropdownMixin, {
|
||||||
tagName: 'button',
|
tagName: 'button',
|
||||||
@ -10,7 +10,7 @@ export default Component.extend(DropdownMixin, {
|
|||||||
// matches with the dropdown this button toggles
|
// matches with the dropdown this button toggles
|
||||||
dropdownName: null,
|
dropdownName: null,
|
||||||
|
|
||||||
dropdown: injectService(),
|
dropdown: service(),
|
||||||
|
|
||||||
// Notify dropdown service this dropdown should be toggled
|
// Notify dropdown service this dropdown should be toggled
|
||||||
click(event) {
|
click(event) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import DropdownMixin from 'ghost-admin/mixins/dropdown-mixin';
|
import DropdownMixin from 'ghost-admin/mixins/dropdown-mixin';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend(DropdownMixin, {
|
export default Component.extend(DropdownMixin, {
|
||||||
classNames: 'dropdown',
|
classNames: 'dropdown',
|
||||||
@ -22,7 +22,7 @@ export default Component.extend(DropdownMixin, {
|
|||||||
return this.get('isOpen') && !this.get('closing');
|
return this.get('isOpen') && !this.get('closing');
|
||||||
}),
|
}),
|
||||||
|
|
||||||
dropdown: injectService(),
|
dropdown: service(),
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
this.set('isOpen', true);
|
this.set('isOpen', true);
|
||||||
|
@ -3,13 +3,13 @@ import {
|
|||||||
IMAGE_EXTENSIONS,
|
IMAGE_EXTENSIONS,
|
||||||
IMAGE_MIME_TYPES
|
IMAGE_MIME_TYPES
|
||||||
} from 'ghost-admin/components/gh-image-uploader';
|
} from 'ghost-admin/components/gh-image-uploader';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const {debounce} = run;
|
const {debounce} = run;
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
classNameBindings: [
|
classNameBindings: [
|
||||||
'isDraggedOver:-drag-over',
|
'isDraggedOver:-drag-over',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const FeatureFlagComponent = Component.extend({
|
const FeatureFlagComponent = Component.extend({
|
||||||
tagName: 'label',
|
tagName: 'label',
|
||||||
@ -8,7 +8,7 @@ const FeatureFlagComponent = Component.extend({
|
|||||||
attributeBindings: ['for'],
|
attributeBindings: ['for'],
|
||||||
_flagValue: null,
|
_flagValue: null,
|
||||||
|
|
||||||
feature: injectService(),
|
feature: service(),
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -7,11 +7,11 @@ import {
|
|||||||
} from 'ghost-admin/services/ajax';
|
} from 'ghost-admin/services/ajax';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {invokeAction} from 'ember-invoke-action';
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'section',
|
tagName: 'section',
|
||||||
@ -32,9 +32,9 @@ export default Component.extend({
|
|||||||
failureMessage: null,
|
failureMessage: null,
|
||||||
uploadPercentage: 0,
|
uploadPercentage: 0,
|
||||||
|
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
eventBus: injectService(),
|
eventBus: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
formData: computed('file', function () {
|
formData: computed('file', function () {
|
||||||
let paramName = this.get('paramName');
|
let paramName = this.get('paramName');
|
||||||
|
@ -2,17 +2,17 @@ import Component from '@ember/component';
|
|||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {A as emberA} from '@ember/array';
|
import {A as emberA} from '@ember/array';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {invokeAction} from 'ember-invoke-action';
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const FullScreenModalComponent = Component.extend({
|
const FullScreenModalComponent = Component.extend({
|
||||||
|
|
||||||
model: null,
|
model: null,
|
||||||
modifier: null,
|
modifier: null,
|
||||||
|
|
||||||
dropdown: injectService(),
|
dropdown: service(),
|
||||||
|
|
||||||
modalPath: computed('modal', function () {
|
modalPath: computed('modal', function () {
|
||||||
return `modal-${this.get('modal') || 'unknown'}`;
|
return `modal-${this.get('modal') || 'unknown'}`;
|
||||||
|
@ -8,20 +8,20 @@ import {
|
|||||||
} from 'ghost-admin/services/ajax';
|
} from 'ghost-admin/services/ajax';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {invokeAction} from 'ember-invoke-action';
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {run} from '@ember/runloop';
|
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_MIME_TYPES = 'image/gif,image/jpg,image/jpeg,image/png,image/svg+xml';
|
||||||
export const IMAGE_EXTENSIONS = ['gif', 'jpg', 'jpeg', 'png', 'svg'];
|
export const IMAGE_EXTENSIONS = ['gif', 'jpg', 'jpeg', 'png', 'svg'];
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
tagName: 'section',
|
tagName: 'section',
|
||||||
classNames: ['gh-image-uploader'],
|
classNames: ['gh-image-uploader'],
|
||||||
|
@ -6,9 +6,9 @@ import {assign} from '@ember/polyfills';
|
|||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {copy} from '@ember/object/internals';
|
import {copy} from '@ember/object/internals';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isEmpty, typeOf} from '@ember/utils';
|
import {isEmpty, typeOf} from '@ember/utils';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const MOBILEDOC_VERSION = '0.3.1';
|
const MOBILEDOC_VERSION = '0.3.1';
|
||||||
|
|
||||||
@ -27,9 +27,9 @@ export const BLANK_DOC = {
|
|||||||
|
|
||||||
export default Component.extend(ShortcutsMixin, {
|
export default Component.extend(ShortcutsMixin, {
|
||||||
|
|
||||||
config: injectService(),
|
config: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
classNames: ['gh-markdown-editor'],
|
classNames: ['gh-markdown-editor'],
|
||||||
classNameBindings: [
|
classNameBindings: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {reads} from '@ember/object/computed';
|
import {reads} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This cute little component has two jobs.
|
This cute little component has two jobs.
|
||||||
@ -16,7 +16,7 @@ import {reads} from '@ember/object/computed';
|
|||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNames: ['gh-menu-toggle'],
|
classNames: ['gh-menu-toggle'],
|
||||||
|
|
||||||
mediaQueries: injectService(),
|
mediaQueries: service(),
|
||||||
isMobile: reads('mediaQueries.isMobile'),
|
isMobile: reads('mediaQueries.isMobile'),
|
||||||
maximise: false,
|
maximise: false,
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
tagName: 'nav',
|
tagName: 'nav',
|
||||||
classNames: ['gh-mobile-nav-bar']
|
classNames: ['gh-mobile-nav-bar']
|
||||||
|
@ -2,15 +2,15 @@ import Component from '@ember/component';
|
|||||||
import calculatePosition from 'ember-basic-dropdown/utils/calculate-position';
|
import calculatePosition from 'ember-basic-dropdown/utils/calculate-position';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
config: injectService(),
|
config: service(),
|
||||||
feature: injectService(),
|
feature: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
router: injectService('router'),
|
router: service('router'),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
tagName: 'nav',
|
tagName: 'nav',
|
||||||
classNames: ['gh-nav'],
|
classNames: ['gh-nav'],
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'article',
|
tagName: 'article',
|
||||||
@ -9,7 +9,7 @@ export default Component.extend({
|
|||||||
|
|
||||||
message: null,
|
message: null,
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
typeClass: computed('message.type', function () {
|
typeClass: computed('message.type', function () {
|
||||||
let type = this.get('message.type');
|
let type = this.get('message.type');
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {alias} from '@ember/object/computed';
|
import {alias} from '@ember/object/computed';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'aside',
|
tagName: 'aside',
|
||||||
classNames: 'gh-notifications',
|
classNames: 'gh-notifications',
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
messages: alias('notifications.notifications')
|
messages: alias('notifications.notifications')
|
||||||
});
|
});
|
||||||
|
@ -7,8 +7,8 @@ import {alias, or} from '@ember/object/computed';
|
|||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {guidFor} from '@ember/object/internals';
|
import {guidFor} from '@ember/object/internals';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task, timeout} from 'ember-concurrency';
|
import {task, timeout} from 'ember-concurrency';
|
||||||
|
|
||||||
const PSM_ANIMATION_LENGTH = 400;
|
const PSM_ANIMATION_LENGTH = 400;
|
||||||
@ -17,14 +17,14 @@ export default Component.extend(SettingsMenuMixin, {
|
|||||||
selectedAuthor: null,
|
selectedAuthor: null,
|
||||||
authors: [],
|
authors: [],
|
||||||
|
|
||||||
store: injectService(),
|
store: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
slugGenerator: injectService(),
|
slugGenerator: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
model: null,
|
model: null,
|
||||||
|
|
||||||
|
@ -4,13 +4,13 @@ import Ember from 'ember';
|
|||||||
import {alias, equal} from '@ember/object/computed';
|
import {alias, equal} from '@ember/object/computed';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const {Handlebars} = Ember;
|
const {Handlebars} = Ember;
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
tagName: 'li',
|
tagName: 'li',
|
||||||
classNames: ['gh-posts-list-item'],
|
classNames: ['gh-posts-list-item'],
|
||||||
|
@ -2,7 +2,7 @@ import $ from 'jquery';
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import request from 'ember-ajax/request';
|
import request from 'ember-ajax/request';
|
||||||
import {htmlSafe} from '@ember/string';
|
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';
|
import {task, timeout} from 'ember-concurrency';
|
||||||
|
|
||||||
const ANIMATION_TIMEOUT = 1000;
|
const ANIMATION_TIMEOUT = 1000;
|
||||||
@ -32,8 +32,8 @@ export default Component.extend({
|
|||||||
// closure actions
|
// closure actions
|
||||||
setImage() {},
|
setImage() {},
|
||||||
|
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
placeholderStyle: htmlSafe('background-image: url()'),
|
placeholderStyle: htmlSafe('background-image: url()'),
|
||||||
avatarStyle: htmlSafe('display: none'),
|
avatarStyle: htmlSafe('display: none'),
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isEmpty} from '@ember/utils';
|
import {isEmpty} from '@ember/utils';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
|
|
||||||
store: injectService(),
|
store: service(),
|
||||||
|
|
||||||
// public attributes
|
// public attributes
|
||||||
tagName: '',
|
tagName: '',
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
clock: injectService(),
|
clock: service(),
|
||||||
|
|
||||||
post: null,
|
post: null,
|
||||||
saveType: null,
|
saveType: null,
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {reads} from '@ember/object/computed';
|
import {reads} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
clock: injectService(),
|
clock: service(),
|
||||||
|
|
||||||
classNames: 'gh-publishmenu',
|
classNames: 'gh-publishmenu',
|
||||||
post: null,
|
post: null,
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank, isEmpty} from '@ember/utils';
|
import {isBlank, isEmpty} from '@ember/utils';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export function computedGroup(category) {
|
export function computedGroup(category) {
|
||||||
return computed('content', 'currentSearch', function () {
|
return computed('content', 'currentSearch', function () {
|
||||||
@ -35,10 +35,10 @@ export default Component.extend({
|
|||||||
users: computedGroup('Users'),
|
users: computedGroup('Users'),
|
||||||
tags: computedGroup('Tags'),
|
tags: computedGroup('Tags'),
|
||||||
|
|
||||||
_store: injectService('store'),
|
_store: service('store'),
|
||||||
router: injectService('router'),
|
router: service('router'),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
refreshContent() {
|
refreshContent() {
|
||||||
let promises = [];
|
let promises = [];
|
||||||
|
@ -4,9 +4,9 @@ import Ember from 'ember';
|
|||||||
import boundOneWay from 'ghost-admin/utils/bound-one-way';
|
import boundOneWay from 'ghost-admin/utils/bound-one-way';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {invokeAction} from 'ember-invoke-action';
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
import {reads} from '@ember/object/computed';
|
import {reads} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const {Handlebars} = Ember;
|
const {Handlebars} = Ember;
|
||||||
|
|
||||||
@ -22,9 +22,9 @@ export default Component.extend({
|
|||||||
|
|
||||||
isViewingSubview: false,
|
isViewingSubview: false,
|
||||||
|
|
||||||
feature: injectService(),
|
feature: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
mediaQueries: injectService(),
|
mediaQueries: service(),
|
||||||
|
|
||||||
isMobile: reads('mediaQueries.maxWidth600'),
|
isMobile: reads('mediaQueries.maxWidth600'),
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {equal, reads} from '@ember/object/computed';
|
import {equal, reads} from '@ember/object/computed';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {observer} from '@ember/object';
|
import {observer} from '@ember/object';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNames: ['view-container'],
|
classNames: ['view-container'],
|
||||||
classNameBindings: ['isMobile'],
|
classNameBindings: ['isMobile'],
|
||||||
|
|
||||||
mediaQueries: injectService(),
|
mediaQueries: service(),
|
||||||
|
|
||||||
tags: null,
|
tags: null,
|
||||||
selectedTag: null,
|
selectedTag: null,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import OneWayTextarea from 'ember-one-way-controls/components/one-way-textarea';
|
import OneWayTextarea from 'ember-one-way-controls/components/one-way-textarea';
|
||||||
import TextInputMixin from 'ghost-admin/mixins/text-input';
|
import TextInputMixin from 'ghost-admin/mixins/text-input';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default OneWayTextarea.extend(TextInputMixin, {
|
export default OneWayTextarea.extend(TextInputMixin, {
|
||||||
resizeDetector: injectService(),
|
resizeDetector: service(),
|
||||||
|
|
||||||
classNames: 'gh-input',
|
classNames: 'gh-input',
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {invokeAction} from 'ember-invoke-action';
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
import {mapBy} from '@ember/object/computed';
|
import {mapBy} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNames: ['form-group', 'for-select'],
|
classNames: ['form-group', 'for-select'],
|
||||||
@ -11,7 +11,7 @@ export default Component.extend({
|
|||||||
activeTimezone: null,
|
activeTimezone: null,
|
||||||
availableTimezones: null,
|
availableTimezones: null,
|
||||||
|
|
||||||
clock: injectService(),
|
clock: service(),
|
||||||
|
|
||||||
availableTimezoneNames: mapBy('availableTimezones', 'name'),
|
availableTimezoneNames: mapBy('availableTimezones', 'name'),
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {reads} from '@ember/object/computed';
|
import {reads} from '@ember/object/computed';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
let instancesCounter = 0;
|
let instancesCounter = 0;
|
||||||
|
|
||||||
@ -68,8 +68,8 @@ let triangleClassPositions = {
|
|||||||
|
|
||||||
const GhTourItemComponent = Component.extend({
|
const GhTourItemComponent = Component.extend({
|
||||||
|
|
||||||
mediaQueries: injectService(),
|
mediaQueries: service(),
|
||||||
tour: injectService(),
|
tour: service(),
|
||||||
|
|
||||||
tagName: '',
|
tagName: '',
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import ShortcutsMixin from 'ghost-admin/mixins/shortcuts';
|
import ShortcutsMixin from 'ghost-admin/mixins/shortcuts';
|
||||||
import {bind} from '@ember/runloop';
|
import {bind} from '@ember/runloop';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {or} from '@ember/object/computed';
|
import {or} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const ONE_COLUMN_WIDTH = 540;
|
const ONE_COLUMN_WIDTH = 540;
|
||||||
const TWO_COLUMN_WIDTH = 940;
|
const TWO_COLUMN_WIDTH = 940;
|
||||||
|
|
||||||
export default Component.extend(ShortcutsMixin, {
|
export default Component.extend(ShortcutsMixin, {
|
||||||
resizeDetector: injectService(),
|
resizeDetector: service(),
|
||||||
unsplash: injectService(),
|
unsplash: service(),
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
tagName: '',
|
tagName: '',
|
||||||
zoomedPhoto: null,
|
zoomedPhoto: null,
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {alias} from '@ember/object/computed';
|
import {alias} from '@ember/object/computed';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: 'section',
|
tagName: 'section',
|
||||||
|
|
||||||
classNames: ['gh-upgrade-notification'],
|
classNames: ['gh-upgrade-notification'],
|
||||||
|
|
||||||
upgradeNotification: injectService('upgrade-notification'),
|
upgradeNotification: service('upgrade-notification'),
|
||||||
|
|
||||||
message: alias('upgradeNotification.content')
|
message: alias('upgradeNotification.content')
|
||||||
});
|
});
|
||||||
|
@ -2,10 +2,10 @@ import Component from '@ember/component';
|
|||||||
import EmberObject from '@ember/object';
|
import EmberObject from '@ember/object';
|
||||||
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
||||||
import {all, task} from 'ember-concurrency';
|
import {all, task} from 'ember-concurrency';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {isEmpty} from '@ember/utils';
|
import {isEmpty} from '@ember/utils';
|
||||||
import {run} from '@ember/runloop';
|
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
|
// TODO: this is designed to be a more re-usable/composable upload component, it
|
||||||
// should be able to replace the duplicated upload logic in:
|
// should be able to replace the duplicated upload logic in:
|
||||||
@ -45,7 +45,7 @@ const UploadTracker = EmberObject.extend({
|
|||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: '',
|
tagName: '',
|
||||||
|
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
|
|
||||||
// Public attributes
|
// Public attributes
|
||||||
accept: '',
|
accept: '',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Example usage:
|
Example usage:
|
||||||
@ -11,7 +11,7 @@ export default Component.extend({
|
|||||||
prefix: null,
|
prefix: null,
|
||||||
slug: null,
|
slug: null,
|
||||||
|
|
||||||
config: injectService(),
|
config: service(),
|
||||||
|
|
||||||
url: computed('slug', function () {
|
url: computed('slug', function () {
|
||||||
// Get the blog URL and strip the scheme
|
// Get the blog URL and strip the scheme
|
||||||
|
@ -3,7 +3,7 @@ import Ember from 'ember';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const {Handlebars} = Ember;
|
const {Handlebars} = Ember;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ export default Component.extend({
|
|||||||
|
|
||||||
user: null,
|
user: null,
|
||||||
|
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
userDefault: computed('ghostPaths', function () {
|
userDefault: computed('ghostPaths', function () {
|
||||||
return `${this.get('ghostPaths.assetRoot')}/img/user-image.png`;
|
return `${this.get('ghostPaths.assetRoot')}/img/user-image.png`;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
tagName: 'h2',
|
tagName: 'h2',
|
||||||
classNames: ['view-title']
|
classNames: ['view-title']
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import ModalComponent from 'ghost-admin/components/modal-base';
|
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';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default ModalComponent.extend({
|
export default ModalComponent.extend({
|
||||||
|
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
store: injectService(),
|
store: service(),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
|
|
||||||
_deleteAll() {
|
_deleteAll() {
|
||||||
let deleteUrl = this.get('ghostPaths.url').api('db');
|
let deleteUrl = this.get('ghostPaths.url').api('db');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import ModalComponent from 'ghost-admin/components/modal-base';
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
||||||
import {alias} from '@ember/object/computed';
|
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';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default ModalComponent.extend({
|
export default ModalComponent.extend({
|
||||||
@ -8,7 +8,7 @@ export default ModalComponent.extend({
|
|||||||
post: alias('model.post'),
|
post: alias('model.post'),
|
||||||
onSuccess: alias('model.onSuccess'),
|
onSuccess: alias('model.onSuccess'),
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
_deletePost() {
|
_deletePost() {
|
||||||
let post = this.get('post');
|
let post = this.get('post');
|
||||||
|
@ -2,8 +2,8 @@ import ModalComponent from 'ghost-admin/components/modal-base';
|
|||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
||||||
import {A as emberA} from '@ember/array';
|
import {A as emberA} from '@ember/array';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
const {Promise} = RSVP;
|
const {Promise} = RSVP;
|
||||||
@ -17,8 +17,8 @@ export default ModalComponent.extend(ValidationEngine, {
|
|||||||
|
|
||||||
validationType: 'inviteUser',
|
validationType: 'inviteUser',
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
store: injectService(),
|
store: service(),
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -3,8 +3,8 @@ import ModalComponent from 'ghost-admin/components/modal-base';
|
|||||||
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default ModalComponent.extend(ValidationEngine, {
|
export default ModalComponent.extend(ValidationEngine, {
|
||||||
@ -12,9 +12,9 @@ export default ModalComponent.extend(ValidationEngine, {
|
|||||||
|
|
||||||
authenticationError: null,
|
authenticationError: null,
|
||||||
|
|
||||||
config: injectService(),
|
config: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
identification: computed('session.user.email', function () {
|
identification: computed('session.user.email', function () {
|
||||||
return this.get('session.user.email');
|
return this.get('session.user.email');
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import ModalComponent from 'ghost-admin/components/modal-base';
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
||||||
import cajaSanitizers from 'ghost-admin/utils/caja-sanitizers';
|
import cajaSanitizers from 'ghost-admin/utils/caja-sanitizers';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isEmpty} from '@ember/utils';
|
import {isEmpty} from '@ember/utils';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default ModalComponent.extend({
|
export default ModalComponent.extend({
|
||||||
@ -12,8 +12,8 @@ export default ModalComponent.extend({
|
|||||||
newUrl: '',
|
newUrl: '',
|
||||||
_isUploading: false,
|
_isUploading: false,
|
||||||
|
|
||||||
config: injectService(),
|
config: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
image: computed('model.model', 'model.imageProperty', {
|
image: computed('model.model', 'model.imageProperty', {
|
||||||
get() {
|
get() {
|
||||||
|
@ -6,10 +6,10 @@ import {
|
|||||||
} from 'ghost-admin/services/ajax';
|
} from 'ghost-admin/services/ajax';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {get} from '@ember/object';
|
import {get} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {invokeAction} from 'ember-invoke-action';
|
import {invokeAction} from 'ember-invoke-action';
|
||||||
import {mapBy, or} from '@ember/object/computed';
|
import {mapBy, or} from '@ember/object/computed';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default ModalComponent.extend({
|
export default ModalComponent.extend({
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ export default ModalComponent.extend({
|
|||||||
theme: false,
|
theme: false,
|
||||||
displayOverwriteWarning: false,
|
displayOverwriteWarning: false,
|
||||||
|
|
||||||
eventBus: injectService(),
|
eventBus: service(),
|
||||||
store: injectService(),
|
store: service(),
|
||||||
|
|
||||||
hideUploader: or('theme', 'displayOverwriteWarning'),
|
hideUploader: or('theme', 'displayOverwriteWarning'),
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
dropdown: injectService(),
|
dropdown: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
showNavMenu: computed('currentPath', 'session.isAuthenticated', 'session.user.isFulfilled', function () {
|
showNavMenu: computed('currentPath', 'session.isAuthenticated', 'session.user.isFulfilled', function () {
|
||||||
// we need to defer showing the navigation menu until the session.user
|
// we need to defer showing the navigation menu until the session.user
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller, {inject as controller} from '@ember/controller';
|
||||||
import {inject as injectController} from '@ember/controller';
|
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {readOnly} from '@ember/object/computed';
|
import {readOnly} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
|
|
||||||
postsController: injectController('posts'),
|
postsController: controller('posts'),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
availableTypes: readOnly('postsController.availableTypes'),
|
availableTypes: readOnly('postsController.availableTypes'),
|
||||||
selectedType: readOnly('postsController.selectedType'),
|
selectedType: readOnly('postsController.selectedType'),
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {get} 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({
|
export default Controller.extend({
|
||||||
|
|
||||||
session: injectService(),
|
session: service(),
|
||||||
store: injectService(),
|
store: service(),
|
||||||
|
|
||||||
queryParams: ['type', 'author', 'tag', 'order'],
|
queryParams: ['type', 'author', 'tag', 'order'],
|
||||||
type: null,
|
type: null,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend(ValidationEngine, {
|
export default Controller.extend(ValidationEngine, {
|
||||||
@ -12,11 +12,11 @@ export default Controller.extend(ValidationEngine, {
|
|||||||
|
|
||||||
validationType: 'reset',
|
validationType: 'reset',
|
||||||
|
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
|
|
||||||
email: computed('token', function () {
|
email: computed('token', function () {
|
||||||
// The token base64 encodes the email (and some other stuff),
|
// The token base64 encodes the email (and some other stuff),
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {alias} from '@ember/object/computed';
|
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';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
model: alias('settings.amp'),
|
model: alias('settings.amp'),
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
settings: injectService()
|
settings: service()
|
||||||
});
|
});
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {alias} from '@ember/object/computed';
|
import {alias} from '@ember/object/computed';
|
||||||
import {empty} from '@ember/object/computed';
|
import {empty} from '@ember/object/computed';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isInvalidError} from 'ember-ajax/errors';
|
import {isInvalidError} from 'ember-ajax/errors';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
model: alias('settings.slack.firstObject'),
|
model: alias('settings.slack.firstObject'),
|
||||||
testNotificationDisabled: empty('model.url'),
|
testNotificationDisabled: empty('model.url'),
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {alias} from '@ember/object/computed';
|
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';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
model: alias('settings.unsplash'),
|
model: alias('settings.unsplash'),
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
save: task(function* () {
|
save: task(function* () {
|
||||||
let notifications = this.get('notifications');
|
let notifications = this.get('notifications');
|
||||||
|
@ -3,17 +3,17 @@ import Controller from '@ember/controller';
|
|||||||
import NavigationItem from 'ghost-admin/models/navigation-item';
|
import NavigationItem from 'ghost-admin/models/navigation-item';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isEmpty} from '@ember/utils';
|
import {isEmpty} from '@ember/utils';
|
||||||
import {isThemeValidationError} from 'ghost-admin/services/ajax';
|
import {isThemeValidationError} from 'ghost-admin/services/ajax';
|
||||||
import {notEmpty} from '@ember/object/computed';
|
import {notEmpty} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
newNavItem: null,
|
newNavItem: null,
|
||||||
|
|
||||||
|
@ -6,16 +6,16 @@ import {
|
|||||||
IMAGE_MIME_TYPES
|
IMAGE_MIME_TYPES
|
||||||
} from 'ghost-admin/components/gh-image-uploader';
|
} from 'ghost-admin/components/gh-image-uploader';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {observer} from '@ember/object';
|
import {observer} from '@ember/object';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
availableTimezones: null,
|
availableTimezones: null,
|
||||||
iconExtensions: ['ico', 'png'],
|
iconExtensions: ['ico', 'png'],
|
||||||
|
@ -7,10 +7,10 @@ import {
|
|||||||
isRequestEntityTooLargeError,
|
isRequestEntityTooLargeError,
|
||||||
isUnsupportedMediaTypeError
|
isUnsupportedMediaTypeError
|
||||||
} from 'ghost-admin/services/ajax';
|
} from 'ghost-admin/services/ajax';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task, timeout} from 'ember-concurrency';
|
import {task, timeout} from 'ember-concurrency';
|
||||||
|
|
||||||
const {testing} = Ember;
|
const {testing} = Ember;
|
||||||
@ -27,12 +27,12 @@ export default Controller.extend({
|
|||||||
jsonExtension: ['json'],
|
jsonExtension: ['json'],
|
||||||
jsonMimeType: ['application/json'],
|
jsonMimeType: ['application/json'],
|
||||||
|
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
// TODO: convert to ember-concurrency task
|
// TODO: convert to ember-concurrency task
|
||||||
_validate(file) {
|
_validate(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 {alias, equal, sort} from '@ember/object/computed';
|
||||||
import {inject as injectController} from '@ember/controller';
|
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
|
|
||||||
tagController: injectController('settings.tags.tag'),
|
tagController: controller('settings.tags.tag'),
|
||||||
|
|
||||||
selectedTag: alias('tagController.tag'),
|
selectedTag: alias('tagController.tag'),
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller, {inject as controller} from '@ember/controller';
|
||||||
import {alias} from '@ember/object/computed';
|
import {alias} from '@ember/object/computed';
|
||||||
import {inject as injectController} from '@ember/controller';
|
import {inject as service} from '@ember/service';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
|
|
||||||
@ -10,9 +9,9 @@ export default Controller.extend({
|
|||||||
tag: alias('model'),
|
tag: alias('model'),
|
||||||
isMobile: alias('tagsController.isMobile'),
|
isMobile: alias('tagsController.isMobile'),
|
||||||
|
|
||||||
applicationController: injectController('application'),
|
applicationController: controller('application'),
|
||||||
tagsController: injectController('settings.tags'),
|
tagsController: controller('settings.tags'),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
_saveTagProperty(propKey, newValue) {
|
_saveTagProperty(propKey, newValue) {
|
||||||
let tag = this.get('tag');
|
let tag = this.get('tag');
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller, {inject as controller} from '@ember/controller';
|
||||||
import {computed} from '@ember/object';
|
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 {match} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
appController: injectController('application'),
|
appController: controller('application'),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
showBackLink: match('appController.currentRouteName', /^setup\.(two|three)$/),
|
showBackLink: match('appController.currentRouteName', /^setup\.(two|three)$/),
|
||||||
|
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller, {inject as controller} from '@ember/controller';
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import {alias} from '@ember/object/computed';
|
import {alias} from '@ember/object/computed';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {A as emberA} from '@ember/array';
|
import {A as emberA} from '@ember/array';
|
||||||
import {htmlSafe} from '@ember/string';
|
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 {isInvalidError} from 'ember-ajax/errors';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task, timeout} from 'ember-concurrency';
|
import {task, timeout} from 'ember-concurrency';
|
||||||
|
|
||||||
const {Errors} = DS;
|
const {Errors} = DS;
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
two: injectController('setup/two'),
|
two: controller('setup/two'),
|
||||||
|
|
||||||
errors: Errors.create(),
|
errors: Errors.create(),
|
||||||
hasValidated: emberA(),
|
hasValidated: emberA(),
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
import Controller from '@ember/controller';
|
import Controller, {inject as controller} from '@ember/controller';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
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 {isInvalidError} from 'ember-ajax/errors';
|
||||||
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend(ValidationEngine, {
|
export default Controller.extend(ValidationEngine, {
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
application: injectController(),
|
application: controller(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
// ValidationEngine settings
|
// ValidationEngine settings
|
||||||
validationType: 'setup',
|
validationType: 'setup',
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import Controller from '@ember/controller';
|
import Controller, {inject as controller} from '@ember/controller';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
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 {isArray as isEmberArray} from '@ember/array';
|
||||||
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend(ValidationEngine, {
|
export default Controller.extend(ValidationEngine, {
|
||||||
@ -13,13 +12,13 @@ export default Controller.extend(ValidationEngine, {
|
|||||||
loggingIn: false,
|
loggingIn: false,
|
||||||
authProperties: ['identification', 'password'],
|
authProperties: ['identification', 'password'],
|
||||||
|
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
application: injectController(),
|
application: controller(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
flowErrors: '',
|
flowErrors: '',
|
||||||
|
|
||||||
|
@ -5,17 +5,17 @@ import {
|
|||||||
VersionMismatchError,
|
VersionMismatchError,
|
||||||
isVersionMismatchError
|
isVersionMismatchError
|
||||||
} from 'ghost-admin/services/ajax';
|
} from 'ghost-admin/services/ajax';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task} from 'ember-concurrency';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Controller.extend(ValidationEngine, {
|
export default Controller.extend(ValidationEngine, {
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
// ValidationEngine settings
|
// ValidationEngine settings
|
||||||
validationType: 'signup',
|
validationType: 'signup',
|
||||||
|
@ -5,7 +5,7 @@ import Table from 'ember-light-table';
|
|||||||
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
||||||
import {assign} from '@ember/polyfills';
|
import {assign} from '@ember/polyfills';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend(PaginationMixin, {
|
export default Controller.extend(PaginationMixin, {
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ export default Controller.extend(PaginationMixin, {
|
|||||||
table: null,
|
table: null,
|
||||||
subscriberToDelete: null,
|
subscriberToDelete: null,
|
||||||
|
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
// paginationSettings is replaced by the pagination mixin so we need a
|
// 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
|
// getter/setter CP here so that we don't lose the dynamic order param
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Controller from '@ember/controller';
|
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';
|
import {sort} from '@ember/object/computed';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
@ -10,7 +10,7 @@ export default Controller.extend({
|
|||||||
suspendedUsers: null,
|
suspendedUsers: null,
|
||||||
invites: null,
|
invites: null,
|
||||||
|
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
inviteOrder: ['email'],
|
inviteOrder: ['email'],
|
||||||
sortedInvites: sort('invites', 'inviteOrder'),
|
sortedInvites: sort('invites', 'inviteOrder'),
|
||||||
|
@ -5,9 +5,9 @@ import isNumber from 'ghost-admin/utils/isNumber';
|
|||||||
import {alias, and, not, or, readOnly} from '@ember/object/computed';
|
import {alias, and, not, or, readOnly} from '@ember/object/computed';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task, taskGroup} from 'ember-concurrency';
|
import {task, taskGroup} from 'ember-concurrency';
|
||||||
|
|
||||||
// ember-cli-shims doesn't export this
|
// ember-cli-shims doesn't export this
|
||||||
@ -22,13 +22,13 @@ export default Controller.extend({
|
|||||||
_scratchFacebook: null,
|
_scratchFacebook: null,
|
||||||
_scratchTwitter: null,
|
_scratchTwitter: null,
|
||||||
|
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
dropdown: injectService(),
|
dropdown: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
slugGenerator: injectService(),
|
slugGenerator: service(),
|
||||||
|
|
||||||
user: alias('model'),
|
user: alias('model'),
|
||||||
currentUser: alias('session.user'),
|
currentUser: alias('session.user'),
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import Helper from '@ember/component/helper';
|
import Helper from '@ember/component/helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {assert} from '@ember/debug';
|
import {assert} from '@ember/debug';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Helper.extend({
|
export default Helper.extend({
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
compute([timeago], {draft, scheduled, published}) {
|
compute([timeago], {draft, scheduled, published}) {
|
||||||
assert(timeago, 'You must pass a time to the gh-format-post-time helper');
|
assert(timeago, 'You must pass a time to the gh-format-post-time helper');
|
||||||
|
@ -6,14 +6,14 @@ import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
|||||||
import isNumber from 'ghost-admin/utils/isNumber';
|
import isNumber from 'ghost-admin/utils/isNumber';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
|
import {inject as controller} from '@ember/controller';
|
||||||
import {htmlSafe} from '@ember/string';
|
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 {isBlank} from '@ember/utils';
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {isInvalidError} from 'ember-ajax/errors';
|
import {isInvalidError} from 'ember-ajax/errors';
|
||||||
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
import {isVersionMismatchError} from 'ghost-admin/services/ajax';
|
||||||
import {mapBy, reads} from '@ember/object/computed';
|
import {mapBy, reads} from '@ember/object/computed';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
import {task, taskGroup, timeout} from 'ember-concurrency';
|
import {task, taskGroup, timeout} from 'ember-concurrency';
|
||||||
|
|
||||||
// ember-cli-shims doesn't export Ember.testing
|
// ember-cli-shims doesn't export Ember.testing
|
||||||
@ -41,11 +41,11 @@ export default Mixin.create({
|
|||||||
showDeletePostModal: false,
|
showDeletePostModal: false,
|
||||||
shouldFocusEditor: true,
|
shouldFocusEditor: true,
|
||||||
|
|
||||||
application: injectController(),
|
application: controller(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
clock: injectService(),
|
clock: service(),
|
||||||
slugGenerator: injectService(),
|
slugGenerator: service(),
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
wordcount: 0,
|
wordcount: 0,
|
||||||
cards: [], // for apps
|
cards: [], // for apps
|
||||||
|
@ -2,7 +2,7 @@ import Mixin from '@ember/object/mixin';
|
|||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import {assign} from '@ember/polyfills';
|
import {assign} from '@ember/polyfills';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
let defaultPaginationSettings = {
|
let defaultPaginationSettings = {
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -10,7 +10,7 @@ let defaultPaginationSettings = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default Mixin.create({
|
export default Mixin.create({
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
paginationModel: null,
|
paginationModel: null,
|
||||||
paginationSettings: null,
|
paginationSettings: null,
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import Mixin from '@ember/object/mixin';
|
import Mixin from '@ember/object/mixin';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Mixin.create({
|
export default Mixin.create({
|
||||||
|
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
routeIfAlreadyAuthenticated: 'posts',
|
routeIfAlreadyAuthenticated: 'posts',
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import Model from 'ember-data/model';
|
import Model from 'ember-data/model';
|
||||||
import attr from 'ember-data/attr';
|
import attr from 'ember-data/attr';
|
||||||
import {belongsTo} from 'ember-data/relationships';
|
import {belongsTo} from 'ember-data/relationships';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Model.extend({
|
export default Model.extend({
|
||||||
token: attr('string'),
|
token: attr('string'),
|
||||||
@ -15,8 +15,8 @@ export default Model.extend({
|
|||||||
status: attr('string'),
|
status: attr('string'),
|
||||||
role: belongsTo('role', {async: false}),
|
role: belongsTo('role', {async: false}),
|
||||||
|
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
resend() {
|
resend() {
|
||||||
let fullInviteData = this.toJSON();
|
let fullInviteData = this.toJSON();
|
||||||
|
@ -9,9 +9,9 @@ import {belongsTo, hasMany} from 'ember-data/relationships';
|
|||||||
import {compare} from '@ember/utils';
|
import {compare} from '@ember/utils';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {equal, filterBy} from '@ember/object/computed';
|
import {equal, filterBy} from '@ember/object/computed';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {observer} from '@ember/object';
|
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
|
// ember-cli-shims doesn't export these so we must get them manually
|
||||||
const {Comparable} = Ember;
|
const {Comparable} = Ember;
|
||||||
@ -68,10 +68,10 @@ function publishedAtCompare(postA, postB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default Model.extend(Comparable, ValidationEngine, {
|
export default Model.extend(Comparable, ValidationEngine, {
|
||||||
config: injectService(),
|
config: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
clock: injectService(),
|
clock: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
validationType: 'post',
|
validationType: 'post',
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import attr from 'ember-data/attr';
|
|||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {equal} from '@ember/object/computed';
|
import {equal} from '@ember/object/computed';
|
||||||
import {guidFor} from '@ember/object/internals';
|
import {guidFor} from '@ember/object/internals';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {observer} from '@ember/object';
|
import {observer} from '@ember/object';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default Model.extend(ValidationEngine, {
|
export default Model.extend(ValidationEngine, {
|
||||||
validationType: 'tag',
|
validationType: 'tag',
|
||||||
@ -28,7 +28,7 @@ export default Model.extend(ValidationEngine, {
|
|||||||
isInternal: equal('visibility', 'internal'),
|
isInternal: equal('visibility', 'internal'),
|
||||||
isPublic: equal('visibility', 'public'),
|
isPublic: equal('visibility', 'public'),
|
||||||
|
|
||||||
feature: injectService(),
|
feature: service(),
|
||||||
|
|
||||||
// HACK: ugly hack to main compatibility with selectize as used in the
|
// HACK: ugly hack to main compatibility with selectize as used in the
|
||||||
// PSM tags input
|
// PSM tags input
|
||||||
|
@ -5,7 +5,7 @@ import attr from 'ember-data/attr';
|
|||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {equal} from '@ember/object/computed';
|
import {equal} from '@ember/object/computed';
|
||||||
import {hasMany} from 'ember-data/relationships';
|
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';
|
import {task} from 'ember-concurrency';
|
||||||
|
|
||||||
export default Model.extend(ValidationEngine, {
|
export default Model.extend(ValidationEngine, {
|
||||||
@ -38,11 +38,11 @@ export default Model.extend(ValidationEngine, {
|
|||||||
twitter: attr('twitter-url-user'),
|
twitter: attr('twitter-url-user'),
|
||||||
tour: attr('json-string'),
|
tour: attr('json-string'),
|
||||||
|
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
|
|
||||||
// TODO: Once client-side permissions are in place,
|
// TODO: Once client-side permissions are in place,
|
||||||
// remove the hard role check.
|
// remove the hard role check.
|
||||||
|
@ -2,14 +2,14 @@ import EmberRouter from '@ember/routing/router';
|
|||||||
import config from './config/environment';
|
import config from './config/environment';
|
||||||
import documentTitle from 'ghost-admin/utils/document-title';
|
import documentTitle from 'ghost-admin/utils/document-title';
|
||||||
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {on} from '@ember/object/evented';
|
import {on} from '@ember/object/evented';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const Router = EmberRouter.extend({
|
const Router = EmberRouter.extend({
|
||||||
location: config.locationType, // use HTML5 History API instead of hash-tag based URLs
|
location: config.locationType, // use HTML5 History API instead of hash-tag based URLs
|
||||||
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
|
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
displayDelayedNotifications: on('didTransition', function () {
|
displayDelayedNotifications: on('didTransition', function () {
|
||||||
this.get('notifications').displayDelayed();
|
this.get('notifications').displayDelayed();
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default AuthenticatedRoute.extend(styleBody, {
|
||||||
titleToken: 'About',
|
titleToken: 'About',
|
||||||
|
|
||||||
classNames: ['view-about'],
|
classNames: ['view-about'],
|
||||||
|
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
|
|
||||||
cachedConfig: false,
|
cachedConfig: false,
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ import ctrlOrCmd from 'ghost-admin/utils/ctrl-or-cmd';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import windowProxy from 'ghost-admin/utils/window-proxy';
|
import windowProxy from 'ghost-admin/utils/window-proxy';
|
||||||
import {htmlSafe} from '@ember/string';
|
import {htmlSafe} from '@ember/string';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {isUnauthorizedError} from 'ember-ajax/errors';
|
import {isUnauthorizedError} from 'ember-ajax/errors';
|
||||||
import {observer} from '@ember/object';
|
import {observer} from '@ember/object';
|
||||||
import {run} from '@ember/runloop';
|
import {run} from '@ember/runloop';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
function K() {
|
function K() {
|
||||||
return this;
|
return this;
|
||||||
@ -28,14 +28,14 @@ export default Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
|
|||||||
|
|
||||||
routeAfterAuthentication: 'posts',
|
routeAfterAuthentication: 'posts',
|
||||||
|
|
||||||
config: injectService(),
|
config: service(),
|
||||||
feature: injectService(),
|
feature: service(),
|
||||||
lazyLoader: injectService(),
|
lazyLoader: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
upgradeNotification: injectService(),
|
upgradeNotification: service(),
|
||||||
tour: injectService(),
|
tour: service(),
|
||||||
ui: injectService(),
|
ui: service(),
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
return this.get('config').fetch();
|
return this.get('config').fetch();
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import Route from '@ember/routing/route';
|
import Route from '@ember/routing/route';
|
||||||
import UnauthenticatedRouteMixin from 'ghost-admin/mixins/unauthenticated-route-mixin';
|
import UnauthenticatedRouteMixin from 'ghost-admin/mixins/unauthenticated-route-mixin';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
|
||||||
classNames: ['ghost-reset'],
|
classNames: ['ghost-reset'],
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
if (this.get('session.isAuthenticated')) {
|
if (this.get('session.isAuthenticated')) {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
titleToken: 'Settings - Apps',
|
titleToken: 'Settings - Apps',
|
||||||
classNames: ['settings-view-apps'],
|
classNames: ['settings-view-apps'],
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import UnsplashObject from 'ghost-admin/models/unsplash-integration';
|
import UnsplashObject from 'ghost-admin/models/unsplash-integration';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default AuthenticatedRoute.extend(styleBody, {
|
||||||
config: injectService(),
|
config: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
titleToken: 'Settings - Apps - Unsplash',
|
titleToken: 'Settings - Apps - Unsplash',
|
||||||
classNames: ['settings-view-apps-unsplash'],
|
classNames: ['settings-view-apps-unsplash'],
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||||
titleToken: 'Settings - Code injection',
|
titleToken: 'Settings - Code injection',
|
||||||
classNames: ['settings-view-code'],
|
classNames: ['settings-view-code'],
|
||||||
|
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -3,10 +3,10 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|||||||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
titleToken: 'Settings - Design',
|
titleToken: 'Settings - Design',
|
||||||
classNames: ['settings-view-design'],
|
classNames: ['settings-view-design'],
|
||||||
|
@ -2,11 +2,11 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|||||||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||||
config: injectService(),
|
config: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
titleToken: 'Settings - General',
|
titleToken: 'Settings - General',
|
||||||
classNames: ['settings-view-general'],
|
classNames: ['settings-view-general'],
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
|
|
||||||
titleToken: 'Settings - Labs',
|
titleToken: 'Settings - Labs',
|
||||||
classNames: ['settings'],
|
classNames: ['settings'],
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
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({
|
export default AuthenticatedRoute.extend({
|
||||||
mediaQueries: injectService(),
|
mediaQueries: service(),
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
let firstTag = this.modelFor('settings.tags').get('firstObject');
|
let firstTag = this.modelFor('settings.tags').get('firstObject');
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import Route from '@ember/routing/route';
|
import Route from '@ember/routing/route';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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, {
|
export default Route.extend(styleBody, {
|
||||||
titleToken: 'Setup',
|
titleToken: 'Setup',
|
||||||
|
|
||||||
classNames: ['ghost-setup'],
|
classNames: ['ghost-setup'],
|
||||||
|
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
|
|
||||||
// use the beforeModel hook to check to see whether or not setup has been
|
// 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.
|
// previously completed. If it has, stop the transition into the setup page.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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
|
// ember-cli-shims doesn't export canInvoke
|
||||||
const {canInvoke} = Ember;
|
const {canInvoke} = Ember;
|
||||||
@ -11,7 +11,7 @@ export default AuthenticatedRoute.extend(styleBody, {
|
|||||||
|
|
||||||
classNames: ['ghost-signout'],
|
classNames: ['ghost-signout'],
|
||||||
|
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
afterModel(model, transition) {
|
afterModel(model, transition) {
|
||||||
this.get('notifications').clearAll();
|
this.get('notifications').clearAll();
|
||||||
|
@ -4,7 +4,7 @@ import RSVP from 'rsvp';
|
|||||||
import Route from '@ember/routing/route';
|
import Route from '@ember/routing/route';
|
||||||
import UnauthenticatedRouteMixin from 'ghost-admin/mixins/unauthenticated-route-mixin';
|
import UnauthenticatedRouteMixin from 'ghost-admin/mixins/unauthenticated-route-mixin';
|
||||||
import styleBody from 'ghost-admin/mixins/style-body';
|
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 {Promise} = RSVP;
|
||||||
const {Errors} = DS;
|
const {Errors} = DS;
|
||||||
@ -12,11 +12,11 @@ const {Errors} = DS;
|
|||||||
export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
|
export default Route.extend(styleBody, UnauthenticatedRouteMixin, {
|
||||||
classNames: ['ghost-signup'],
|
classNames: ['ghost-signup'],
|
||||||
|
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
if (this.get('session.isAuthenticated')) {
|
if (this.get('session.isAuthenticated')) {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default AuthenticatedRoute.extend({
|
export default AuthenticatedRoute.extend({
|
||||||
titleToken: 'Subscribers',
|
titleToken: 'Subscribers',
|
||||||
|
|
||||||
feature: injectService(),
|
feature: service(),
|
||||||
|
|
||||||
// redirect if subscribers is disabled or user isn't owner/admin
|
// redirect if subscribers is disabled or user isn't owner/admin
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
|
@ -3,9 +3,9 @@ import config from 'ghost-admin/config/environment';
|
|||||||
import {AjaxError, isAjaxError} from 'ember-ajax/errors';
|
import {AjaxError, isAjaxError} from 'ember-ajax/errors';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {get} from '@ember/object';
|
import {get} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isArray as isEmberArray} from '@ember/array';
|
import {isArray as isEmberArray} from '@ember/array';
|
||||||
import {isNone} from '@ember/utils';
|
import {isNone} from '@ember/utils';
|
||||||
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
const JSONContentType = 'application/json';
|
const JSONContentType = 'application/json';
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ export function isThemeValidationError(errorOrStatus, payload) {
|
|||||||
/* end: custom error types */
|
/* end: custom error types */
|
||||||
|
|
||||||
let ajaxService = AjaxService.extend({
|
let ajaxService = AjaxService.extend({
|
||||||
session: injectService(),
|
session: service(),
|
||||||
|
|
||||||
headers: computed('session.isAuthenticated', function () {
|
headers: computed('session.isAuthenticated', function () {
|
||||||
let session = this.get('session');
|
let session = this.get('session');
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import Service from '@ember/service';
|
import Service, {inject as service} from '@ember/service';
|
||||||
import {assign} from '@ember/polyfills';
|
import {assign} from '@ember/polyfills';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
|
|
||||||
// ember-cli-shims doesn't export _ProxyMixin
|
// ember-cli-shims doesn't export _ProxyMixin
|
||||||
const {_ProxyMixin} = Ember;
|
const {_ProxyMixin} = Ember;
|
||||||
|
|
||||||
export default Service.extend(_ProxyMixin, {
|
export default Service.extend(_ProxyMixin, {
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
content: {},
|
content: {},
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import EmberError from '@ember/error';
|
import EmberError from '@ember/error';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import Service from '@ember/service';
|
import Service, {inject as service} from '@ember/service';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {set} from '@ember/object';
|
import {set} from '@ember/object';
|
||||||
|
|
||||||
export function feature(name, user = false) {
|
export function feature(name, user = false) {
|
||||||
@ -29,11 +28,11 @@ export function feature(name, user = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default Service.extend({
|
export default Service.extend({
|
||||||
store: injectService(),
|
store: service(),
|
||||||
config: injectService(),
|
config: service(),
|
||||||
session: injectService(),
|
session: service(),
|
||||||
settings: injectService(),
|
settings: service(),
|
||||||
notifications: injectService(),
|
notifications: service(),
|
||||||
|
|
||||||
publicAPI: feature('publicAPI'),
|
publicAPI: feature('publicAPI'),
|
||||||
subscribers: feature('subscribers'),
|
subscribers: feature('subscribers'),
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import Service from '@ember/service';
|
import Service, {inject as service} from '@ember/service';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
|
|
||||||
const {testing} = Ember;
|
const {testing} = Ember;
|
||||||
|
|
||||||
export default Service.extend({
|
export default Service.extend({
|
||||||
ajax: injectService(),
|
ajax: service(),
|
||||||
ghostPaths: injectService(),
|
ghostPaths: service(),
|
||||||
|
|
||||||
// This is needed so we can disable it in unit tests
|
// This is needed so we can disable it in unit tests
|
||||||
testing,
|
testing,
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
import Service from '@ember/service';
|
import Service, {inject as service} from '@ember/service';
|
||||||
import {dasherize} from '@ember/string';
|
import {dasherize} from '@ember/string';
|
||||||
import {A as emberA, isArray as isEmberArray} from '@ember/array';
|
import {A as emberA, isArray as isEmberArray} from '@ember/array';
|
||||||
import {filter} from '@ember/object/computed';
|
import {filter} from '@ember/object/computed';
|
||||||
import {get} from '@ember/object';
|
import {get, set} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
import {isBlank} from '@ember/utils';
|
import {isBlank} from '@ember/utils';
|
||||||
import {
|
import {
|
||||||
isMaintenanceError,
|
isMaintenanceError,
|
||||||
isVersionMismatchError
|
isVersionMismatchError
|
||||||
} from 'ghost-admin/services/ajax';
|
} from 'ghost-admin/services/ajax';
|
||||||
import {set} from '@ember/object';
|
|
||||||
|
|
||||||
// Notification keys take the form of "noun.verb.message", eg:
|
// Notification keys take the form of "noun.verb.message", eg:
|
||||||
//
|
//
|
||||||
@ -24,7 +22,7 @@ export default Service.extend({
|
|||||||
delayedNotifications: emberA(),
|
delayedNotifications: emberA(),
|
||||||
content: emberA(),
|
content: emberA(),
|
||||||
|
|
||||||
upgradeStatus: injectService(),
|
upgradeStatus: service(),
|
||||||
|
|
||||||
alerts: filter('content', function (notification) {
|
alerts: filter('content', function (notification) {
|
||||||
let status = get(notification, 'status');
|
let status = get(notification, 'status');
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
import SessionService from 'ember-simple-auth/services/session';
|
import SessionService from 'ember-simple-auth/services/session';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
import {inject as service} from '@ember/service';
|
||||||
|
|
||||||
export default SessionService.extend({
|
export default SessionService.extend({
|
||||||
feature: injectService(),
|
feature: service(),
|
||||||
store: injectService(),
|
store: service(),
|
||||||
tour: injectService(),
|
tour: service(),
|
||||||
|
|
||||||
user: computed(function () {
|
user: computed(function () {
|
||||||
return this.get('store').queryRecord('user', {id: 'me'});
|
return this.get('store').queryRecord('user', {id: 'me'});
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import RSVP from 'rsvp';
|
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 ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
||||||
import {get} from '@ember/object';
|
import {get} from '@ember/object';
|
||||||
import {inject as injectService} from '@ember/service';
|
|
||||||
|
|
||||||
// ember-cli-shims doesn't export _ProxyMixin
|
// ember-cli-shims doesn't export _ProxyMixin
|
||||||
const {_ProxyMixin} = Ember;
|
const {_ProxyMixin} = Ember;
|
||||||
|
|
||||||
export default Service.extend(_ProxyMixin, ValidationEngine, {
|
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
|
// 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
|
// 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
Loading…
Reference in New Issue
Block a user