ESLint fixes for latest eslint-plugin-ember

no issue
This commit is contained in:
Kevin Ansfield 2018-03-19 11:54:54 +00:00
parent c534ae83b4
commit daa0e85552
13 changed files with 54 additions and 50 deletions

View File

@ -275,6 +275,7 @@ export default Component.extend(ShortcutsMixin, {
this._editor.codemirror.setOption('mode', 'gfm');
// add non-breaking space as a special char
// eslint-disable-next-line no-control-regex
this._editor.codemirror.setOption('specialChars', /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\xa0]/g);
// HACK: move the toolbar & status bar elements outside of the

View File

@ -19,6 +19,15 @@ export default TextArea.extend(TextInputMixin, {
}
},
willInsertElement() {
this._super(...arguments);
// disable the draggable resize element that browsers add to textareas
if (this.get('autoExpand')) {
this.element.style.resize = 'none';
}
},
didInsertElement() {
this._super(...arguments);
@ -38,15 +47,6 @@ export default TextArea.extend(TextInputMixin, {
this._super(...arguments);
},
willInsertElement() {
this._super(...arguments);
// disable the draggable resize element that browsers add to textareas
if (this.get('autoExpand')) {
this.element.style.resize = 'none';
}
},
_autoExpand() {
let el = this.element;

View File

@ -39,12 +39,6 @@ export default Controller.extend({
queryParams: ['type', 'author', 'tag', 'order'],
init() {
this._super(...arguments);
this.availableTypes = TYPES;
this.availableOrders = ORDERS;
},
type: null,
author: null,
tag: null,
@ -56,6 +50,12 @@ export default Controller.extend({
availableTypes: null,
availableOrders: null,
init() {
this._super(...arguments);
this.availableTypes = TYPES;
this.availableOrders = ORDERS;
},
postsInfinityModel: alias('model'),
showingAll: computed('type', 'author', 'tag', function () {

View File

@ -12,14 +12,14 @@ export default Controller.extend({
notifications: service(),
settings: service(),
leaveSettingsTransition: null,
slackArray: null,
init() {
this._super(...arguments);
this.slackArray = [];
},
leaveSettingsTransition: null,
slackArray: null,
slackSettings: boundOneWay('settings.slack.firstObject'),
testNotificationDisabled: empty('slackSettings.url'),

View File

@ -17,17 +17,17 @@ export default Controller.extend({
session: service(),
settings: service(),
init() {
this._super(...arguments);
this.set('newNavItem', NavigationItem.create({isNew: true}));
},
newNavItem: null,
dirtyAttributes: false,
themes: null,
themeToDelete: null,
init() {
this._super(...arguments);
this.set('newNavItem', NavigationItem.create({isNew: true}));
},
showDeleteThemeModal: notEmpty('themeToDelete'),
blogUrl: computed('config.blogUrl', function () {

View File

@ -20,11 +20,6 @@ export default Controller.extend({
session: service(),
settings: service(),
init() {
this._super(...arguments);
this.iconExtensions = ICON_EXTENSIONS;
},
availableTimezones: null,
iconExtensions: null,
iconMimeTypes: 'image/png,image/x-icon',
@ -34,6 +29,11 @@ export default Controller.extend({
_scratchFacebook: null,
_scratchTwitter: null,
init() {
this._super(...arguments);
this.iconExtensions = ICON_EXTENSIONS;
},
isDatedPermalinks: computed('settings.permalinks', {
set(key, value) {
this.set('settings.permalinks', value ? '/:year/:month/:day/:slug/' : '/:slug/');

View File

@ -34,13 +34,6 @@ export default Controller.extend({
session: service(),
settings: service(),
init() {
this._super(...arguments);
this.importMimeType = IMPORT_MIME_TYPES;
this.jsonExtension = JSON_EXTENSION;
this.jsonMimeType = JSON_MIME_TYPE;
},
importErrors: null,
importSuccessful: false,
showDeleteAllModal: false,
@ -51,6 +44,13 @@ export default Controller.extend({
jsonExtension: null,
jsonMimeType: null,
init() {
this._super(...arguments);
this.importMimeType = IMPORT_MIME_TYPES;
this.jsonExtension = JSON_EXTENSION;
this.jsonMimeType = JSON_MIME_TYPE;
},
actions: {
onUpload(file) {
let formData = new FormData();

View File

@ -17,11 +17,6 @@ export default Controller.extend(ValidationEngine, {
session: service(),
settings: service(),
init() {
this._super(...arguments);
this.authProperties = ['identification', 'password'];
},
submitting: false,
loggingIn: false,
authProperties: null,
@ -30,6 +25,11 @@ export default Controller.extend(ValidationEngine, {
// ValidationEngine settings
validationType: 'signin',
init() {
this._super(...arguments);
this.authProperties = ['identification', 'password'];
},
signin: alias('model'),
actions: {

View File

@ -6,12 +6,6 @@ import {sort} from '@ember/object/computed';
export default Controller.extend({
session: service(),
init() {
this._super(...arguments);
this.inviteOrder = ['email'];
this.userOrder = ['name', 'email'];
},
showInviteUserModal: false,
activeUsers: null,
@ -21,6 +15,12 @@ export default Controller.extend({
inviteOrder: null,
userOrder: null,
init() {
this._super(...arguments);
this.inviteOrder = ['email'];
this.userOrder = ['name', 'email'];
},
sortedInvites: sort('invites', 'inviteOrder'),
sortedActiveUsers: sort('activeUsers', 'userOrder'),
sortedSuspendedUsers: sort('suspendedUsers', 'userOrder'),

View File

@ -6,6 +6,10 @@ import ShortcutsRoute from 'ghost-admin/mixins/shortcuts-route';
export default AuthenticatedRoute.extend(CurrentUserSettings, ShortcutsRoute, {
titleToken: 'Settings - Tags',
shortcuts: null,
init() {
this._super(...arguments);
this.shortcuts = {
@ -17,10 +21,6 @@ export default AuthenticatedRoute.extend(CurrentUserSettings, ShortcutsRoute, {
};
},
titleToken: 'Settings - Tags',
shortcuts: null,
// authors aren't allowed to manage tags
beforeModel() {
this._super(...arguments);

View File

@ -13,6 +13,7 @@ export default Service.extend({
hour: null,
init() {
this._super(...arguments);
this.tick();
},

View File

@ -39,6 +39,7 @@ export default Service.extend(Evented, {
throbbers: null,
init() {
this._super(...arguments);
let adminUrl = `${window.location.origin}${this.get('ghostPaths.url').admin()}`;
let adminDisplayUrl = adminUrl.replace(`${window.location.protocol}//`, '');

View File

@ -185,6 +185,7 @@ describe('Integration: Service: ajax', function () {
authenticated: null,
init() {
this._super(...arguments);
this.authenticated = {
expires_at: (new Date()).getTime() - 10000,
refresh_token: 'RefreshMe123'