Removed unused body classes added by using the StyleBody mixin

no issue
- many routes were attaching classes to the `<body>` tag via the `StyleBody` mixin but those classes were never used and applied inconsistently throughout the app
This commit is contained in:
Kevin Ansfield 2019-05-20 14:15:46 +01:00
parent a0081a438c
commit 9186c84e64
13 changed files with 14 additions and 44 deletions

View File

@ -1,8 +1,5 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import styleBody from 'ghost-admin/mixins/style-body';
export default AuthenticatedRoute.extend(styleBody, {
titleToken: 'About',
classNames: ['view-about']
export default AuthenticatedRoute.extend({
titleToken: 'About'
});

View File

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

View File

@ -2,14 +2,12 @@ import $ from 'jquery';
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import RSVP from 'rsvp';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
export default AuthenticatedRoute.extend(CurrentUserSettings, {
settings: service(),
titleToken: 'Settings - Design',
classNames: ['settings-view-design'],
beforeModel() {
this._super(...arguments);

View File

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

View File

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

View File

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

View File

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

View File

@ -1,15 +1,13 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from '../../../mixins/current-user-settings';
import UnsplashObject from 'ghost-admin/models/unsplash-integration';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
export default AuthenticatedRoute.extend(CurrentUserSettings, {
config: service(),
settings: service(),
titleToken: 'Unsplash',
classNames: ['settings-view-integrations-unsplash'],
// reload settings to ensure we have latest values and pre-configure
// Unsplash to be active if the server doesn't have any unsplash setting

View File

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

View File

@ -1,14 +1,11 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, {
export default AuthenticatedRoute.extend({
notifications: service(),
titleToken: 'Sign Out',
classNames: ['ghost-signout'],
afterModel(/*model, transition*/) {
this.notifications.clearAll();
this.session.invalidate();

View File

@ -1,11 +1,8 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import styleBody from 'ghost-admin/mixins/style-body';
export default AuthenticatedRoute.extend(styleBody, {
export default AuthenticatedRoute.extend({
titleToken: 'Site',
classNames: ['view-site'],
model() {
return (new Date()).valueOf();
}

View File

@ -1,14 +1,12 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
export default AuthenticatedRoute.extend(CurrentUserSettings, {
infinity: service(),
session: service(),
titleToken: 'Staff',
classNames: ['view-team'],
model() {
return this.session.user;

View File

@ -1,13 +1,10 @@
/* eslint-disable camelcase */
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
import styleBody from 'ghost-admin/mixins/style-body';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
export default AuthenticatedRoute.extend(CurrentUserSettings, {
titleToken: 'Staff - User',
classNames: ['team-view-user'],
model(params) {
return this.store.queryRecord('user', {slug: params.user_slug, include: 'count.posts'});
},